Click here to Skip to main content
15,883,929 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
In an MFC EXE or DLL you (can) have an extern-alised theApp global object to access members of your application class.

I'm developing an add-in DLL for third-party software, via their SDK. The App class I must use is not derived from CWinApp. How can I create a simpilar global pointer to the (single-instance) of the App class?
Posted
Comments
Richard MacCutchan 17-Jul-14 5:16am    
Why not ask the people who provide the SDK?

1 solution

Yes. You can use an global object or pointer for it.

These tasks are often solved with a handle, which in reality is a pointer to a valid object. In that case you export at least 3 functions from the dll like this blueprint:

HANDLE Create();//get object
void Destroy(HANDLE h);//free object

int DoSomeStuff( HANDLE h, int stuff);//do work
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900