Galf 0 Newbie Poster

Hi all,

I'm a little wary of posting this, since there were no posts on autoexp.dat, and this is a general C++ forum, but I thought I'd give it a shot.

I'm trying to create an AddIn to display some custom datatypes for an application that uses RogueWave. I created a very basic DLL to test functionality, and it works, provided I don't include a specific RogueWave header (that unfortunately I need to include). Experimenting, I've found that the line in the header that the DLL doesn't like is:

/*
 * The RWDecimalPortableInit class initializes static variables before 
 * user code using the iostream trick of putting a static init object in 
 * every translation unit and initializing the first time one is 
 * constructed. The implementation data structures and static vars NaN, 
 * null, missing are initialized.
 */
class RWExport RWDecimalPortableInit
{
public:
    RWDecimalPortableInit();
private:
    static int count;
};

// static object for one time initialization
static RWDecimalPortableInit RWDecimalPortableInitVar;

I only have the header for this class, so I can't dig into the source code that implements the above. I tried creating my own class that would behave similarly -- an Init class that ensures another class's static const variables are initialized -- but it doesn't halt the execution. The specific export function I want is still exported with the same name. Everything SHOULD work, but doesn't.

Does anyone have any ideas on what could be going on in the background here that would prevent the AddIn from functioning correctly after that static variable? All I can think of is that the RVA is different if I include that header -- but I don't know enough about DLLs to understand why that should make a difference.