Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Macro quote expansion

Status
Not open for further replies.

Skute

Programmer
Jul 21, 2003
272
GB
Hi,

is it possible to get quotes inside a macro??

basically i want to change this:

#ifdef PEGASUS_EXPORTS
#define PEGASUS_API __declspec(dllexport)
#else
#define PEGASUS_API __declspec(dllimport)
#endif

to this:

#ifdef PEGASUS_EXPORTS
#define PEGASUS_API extern "C" __declspec(dllexport)
#else
#define PEGASUS_API extern "C" __declspec(dllimport)
#endif


Obviously the second macros give compiler errors.

Thanks

Skute

"There are 10 types of people in this World, those that understand binary, and those that don't!"
 
ok ive since discovered that it isnt the define which is the problem, its the expansion in the class definition

class PEGASUS_API Cpegasus
{
public:
Cpegasus();
};

That generates a load of errors, but seems to work ok when extern "C" isnt included. im guessing thats because you cant have classes in C.

Skute

"There are 10 types of people in this World, those that understand binary, and those that don't!"
 
I can access exported functions from an unmanaged C++ DLL in C#, but i want to be able to access an unmanaged C++ class. Also i have a problem of any global variables that are declared in the DLL cause my application to stop responding. If i define a global variable:

CIMClient client;
void Connect();
void Disconnect();

It stops the app from responding, any ideas?



Skute

"There are 10 types of people in this World, those that understand binary, and those that don't!"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top