I am facing some issues in Successful loading MDL apps on Startup.
I have modified code as below and loaded MDL app.
if (strcmp(l_str_argument.c_str(), "MS_INITAPPS") == 0)
{
mdlSystem_enterGraphics();
mdlInput_sendCommand(CMD_DIALOG_OPENFILE, L"STARTUP", MSInputQueuePos::INPUTQ_HEAD, NULL, 0);
SystemCallback::SetFileSaveFunction(OnFileSaveCallBack);
}
After executing above code, I am able to get MicroStation window. When I select any file displayed , Application gets crashed.
Rajesh Varatharajan said:When I select any file displayed
Try mdlSystem_enterGraphicsExtended(0) instead of mdlSystem_enterGraphics().
mdlSystem_enterGraphicsExtended(0)
mdlSystem_enterGraphics()
Regards, Jon Summers LA Solutions
Tried with that too.
same behavior.Is there anything I need to change in this?
Log not captured at that location."STARTUP" i have taken from initapp sample application.
Rajesh Varatharajan said:initapp sample application
Please supply more detail. I don't see an INITAPP sample in the CONNECT SDK.
7484.initapp.zipIt was referred by MicroStation Support Team.
please also compare with example from ..\ Documentation\Migration\Workshop\Labs\MigrationTesting\v0811\initapp\initapp.cpp
Rajesh Varatharajan said:It was referred by MicroStation Support Team
That's an old example from the days of MicroStation V8.
Rajesh Varatharajan said:..\ Documentation\Migration\Workshop\Labs\MigrationTesting\v0811\initapp
That's a better example. If you build that example, does it work for you?
I notice that example's function MdlMain() uses 8-bit C strings, which is obsolete. MdlMain for CONNECT looks like this:
MdlMain()
MdlMain
extern "C" DLLEXPORT void MdlMain (int argc, WCharCP argv[])
Hi Rajesh,
Rajesh Varatharajan said:same behavior.
because you did not react, I have to repeat my question: Do you analyze the log and memory dump, created by MicroStation? In some situations, it's recommended to set MicroStation to produce not standard, but full detail memory dump.
Regards,
Jan
Bentley Accredited Developer: iTwin Platform - AssociateLabyrinth Technology | dev.notes() | cad.point
Hi Jan,
Sorry for late reply. I have not seen any memory dump or event log in windows. Attached Exception log generated by MicroStation.Exception Log.txt
Rajesh Varatharajan said:I have not seen any memory dump or event log in windows
It does not tell too much. What locations did you check?
I recommend to evaluate whether MicroStation is configured to (do not) produce memory dumps, because typically, when exception log is created, the memory dump is saved as well.
See (all related to CE) articles in Exceptions wiki.
What can help is to configure MicroStation to produce the dump with maximum details. It's huge, but can help. And to be able to use tools like WinDbg is mandatory knowledge of all native code developers anyway.
Hi Jan,Attached WinDbg log. Help me to sort out this crash issue. Thanks.
Here it is. Windbg log.txt
Rajesh Varatharajan said:Attached WinDbg log.
It looks like you do not understand what memory dump is and how to work with WinDbg (or any other similar tool). Such log is not very useful.
Rajesh Varatharajan said:Help me to sort out this crash issue.
This types of bugs require to have the project plus exactly defined workspace to be able to debug it (alternatively with WinDbg attached to the process at runtime). When the crash is reproduced, memory dump may help to understand the state.
It's something that every developer should be able to do, especially because it can be really time consuming task requiring detail knowledge of the project and API, with some detective work. Do you really expect it can be done in free time "just for fun" (notwithstanding that provided information is not enough)?
Hi Rajesh Varatharajan,
Within your original Exception.log, a native code (small) memory dump is listed specific to your issue and along with the exception.log is a very good starting point towards identifying exact issues.
Since the memory dump is small it can be very helpful for native code issues, though larger full memory dumps may be required if the issue: a.) needs more detailed information, or b.) is Microsoft .NET related (not this/your issue here).
Can you zip and provide your small memory dump of the issue listed in the exception.log?File: C:\Users\RVaratharajan\AppData\Local\Temp\Bentley\MicroStation\10.0.0\MiniDump.dmpPlease note windbg is a very nice lite-weight and powerful debugger to use, though the Windbg log.txt provided is only showing symbol file loading and not details of the actual exception/crash that occured within the .dmp file (requested above).
Thank you and HTH,Bob
Thanks Robert,
Attached dmp file.
MiniDump.zip
I would suggest that you rebuild your project listed below with Microsoft Symbols (*.pdb) since your solution's project appears not to be producing any, or you will need to find, test, and provide (current) build binaries (.ma, .dll, .pdb) so you can identify the source line of the crash in your code.
0:000> lmvm hc_shield Browse full module list start end module name 00007ffa`8a300000 00007ffa`8a417000 hc_shield T (no symbols) Loaded symbol image file: hc.shield.dll Image path: C:\Program Files\Bentley\MicroStation CONNECT Edition\MicroStation\Mdlapps\hc.shield.dll Image name: hc.shield.dll Browse all global symbols functions data Timestamp: Wed Mar 10 05:16:16 2021 (60489C70) CheckSum: 00000000 ImageSize: 00117000 File version: 1.0.0.4 Product version: 1.0.0.0 File flags: 0 (Mask 3F) File OS: 40004 NT Win32 File type: 1.0 App File date: 00000000.00000000 Translations: 0000.04b0 0000.04e4 0409.04b0 0409.04e4
HTH,Bob
Hi Robert,
Thanks for your help. I have found the issue and solved it. The issue is with our custom dependent dll.
Now MS_INITAPPS is loading Add-on on startup.
Regards
Rajesh