Posts: 19
Registered: ‎09-02-2003
Message 1 of 1 (122 Views)

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

122 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 Going To Be @ AU 2014? Feel free to drop by our AU topic post and share your plans, plug a class that you're teaching, or simply check out who else from the community might be in attendance. Ohh and don't forgot to stop by the Autodesk Help | Learn | Collaborate booths in the Exhibit Hall and meet our community team if you get a chance!