aced Commands in DBX

Martin Schmid

Usenet Archive
Joined
Jul 11, 2003
Messages
47
Reaction score
0
I have found that aced commands are not available in DBX... I suppose this makes sense...

What I need to do get the value variable (i.e., acedGetVar) in the 'drawable' function of a DBX

Would it be possible to do this instead:

1. In an ARX have a reactor that sets a variable.
2. In the 'drawable' of my DBX, have it read from that variable?
-- is there some way to check what the DBX host appiclation is... i.e., if it is not acad, and the arx is unavailable, do nothing?

How would I structure my code such that the DBX can read a variable from the ARX space?
 
Tony, thanks for the response...
AcDbDatabase has members that return database-specific
system variables. If you want some other system variable that is not database specific, your're no longer "dbx-safe", since the host may not expose any such system variables.

That is what I reasoned to be the case...
You can implement drawing editor specific behavior in an ARX library, and you have your DBX check to see if it's being hosted in AutoCAD, and if so, dynamically link to your ARX library's functions.

Ok... you answered my quesiton #2.. that it is possible... but how would I go about doing this? It seems that now my ARX is Statically linked to my DBX (i.e., in the link settings for my ARX, I have my <whatever>.lib listed from my DBX)... I need some help on how to dynamically link my DBX to my ARX...

Thanks for your insight...
 
Use GetProcAddress with the module handle of the
ARX library to get a pointer to a function. Since
you can't assume that the ARX is loaded, you have
to dynamically link to it.
 
I suppose the other option is to build this custom entity entirely within the ARX so I don't have to mess w/ the dynamic linking.. since it is not DBX safe anyway, there would be no significant advantage to segregating UI from the DBExtension code (would there?). Other than the fact that the Wizard will build the necessary skeleton code for me in the DBX, I can always have a parallel project, and copy over what I need.
 

Latest threads

Back
Top