19 Posts
0 Kudos
Registered: ‎09-02-2003
Post 1 of 1

Custom entity wrapper – trapping error if DBX is not loaded…

128 Views, 0 Replies
11-20-2006 04:08 AM

I had created a custom entity derived from AcDbEntity in unmanaged C++ using ObjectARX 2007 wizard. I also created a suitable ARX application to draw the custom entity in AutoCAD, just to serve as a proof that my DBX part is coded fully and working fine.

Then I created a managed C++ wrapper for the above said custom entity using mixed mode code. This also went flawless.

Then I created a managed C# application in which I will use this custom entity, through the wrapper and post it to AutoCAD’s database. This too went flawless.

The dependency relationship is like this:

C# UI depends on wrapper. Wrapper depends on DBX.

But my problem is this: I want to have a mechanism that will help me to throw a user friendly message when the dependent module is not loaded. This mechanism is required in the managed application end, to check whether the wrapper is loaded or not. I had successfully done this. The mechanism is also required in the wrapper to handle the exception when the required DBX is not loaded. I am unable to successfully trap this exception.

In the class of acrxEntryPoint.cpp in wrapper I have the InitAppMsg handler:

virtual AcRx::AppRetCode On_kInitAppMsg (void *pkt)
AcRx::AppRetCode retCode =AcRxDbxApp::smileysurprised:n_kInitAppMsg (pkt);

The exception due to unavailability of DBX is thrown at AutoCAD’s screen even before entering these lines of code.

Any idea, how to trap this exception?

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Are you interested in helping shape the future of the Autodesk Community? To participate in this brief usability study, please click here. Your time and input is greatly appreciated!