Start a new topic

Loading multiple extensions (site IDs)

Original Post by: ToddSmith_RC Mon Aug 27 21:06:43 2012

I'm new to OpenFlight API and so I hope you can forgive me if I'm asking a silly question and/or not quite using proper terminology.

I'm loading extension DLLs for two different products - each with its own unique site ID. Both libraries load just fine. Here's where I'm having the problem though.

I'm confused about how I'm supposed to use mgGetExtRec(). If I were to pass in a record code, how would the function know which site ID the code corresponds to? Both extension libraries that I'm loading begin their record table enumeration list at 256.

As an example, pretend that product 1 has "myExt4" which equals 260 in its record table index, and product 2 has "hisExt3" which also equals 260 in its record table index. Thus, if I call the function as follows:

mgGetExtRec(rec, myExt4);

How does mgGetExtRec know which site ID I mean when I pass in (effectively) 260? Is it myExt4 or is it hisExt3?

I have to assume there is a simple answer to this question, but I have not been able to find it in my searching through documentation. I would appreciate any help that could be given.



Original Post by: SteveThompson Mon Aug 27 22:01:51 2012

Hi Todd,

Actually if you look at the extension code .h file, you should see that the extension codes are defined using a macro that includes a call to ddGetUCode. This function "global-izes" the local codes (those starting with "e"). Here is an excerpt from a sample extension included with the OpenFlight API SDK.

/* Record table index defines */

#define myHeader (ddGetUCode(MY_SITEID, eMyHeader))

#define myEnums (ddGetUCode(MY_SITEID, eMyEnums))

#define myFlags (ddGetUCode(MY_SITEID, eMyFlags))

#define myPolyExt (ddGetUCode(MY_SITEID, eMyPolyExt))

That said you should be able to use the code myExt4 directly. You cannot use the local code (the one starting with lower case 'e').

If you don't see this macro in use, chances are you are using a very old version of the extension, in which case you can simply use the ddGetUCode function yourself.

Original Post by: ToddSmith_RC Mon Aug 27 22:05:23 2012

Fantastic! I was trying to use the codes with the lower case e.

I appreciate the help :)

Login to post a comment