Click here to Skip to main content
16,007,779 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: how to input JOYSTICK to vc++ ??? Pin
Mark Salsbery1-Dec-06 7:11
Mark Salsbery1-Dec-06 7:11 
QuestionSingleton template and dll Pin
Cedric Moonen1-Dec-06 4:34
Cedric Moonen1-Dec-06 4:34 
AnswerRe: Singleton template and dll Pin
Rick York1-Dec-06 8:04
mveRick York1-Dec-06 8:04 
GeneralRe: Singleton template and dll [modified] Pin
Cedric Moonen1-Dec-06 8:12
Cedric Moonen1-Dec-06 8:12 
GeneralRe: Singleton template and dll Pin
CPallini1-Dec-06 9:56
mveCPallini1-Dec-06 9:56 
GeneralRe: Singleton template and dll Pin
Cedric Moonen1-Dec-06 10:19
Cedric Moonen1-Dec-06 10:19 
GeneralRe: Singleton template and dll Pin
led mike1-Dec-06 10:22
led mike1-Dec-06 10:22 
GeneralRe: Singleton template and dll Pin
Cedric Moonen3-Dec-06 22:18
Cedric Moonen3-Dec-06 22:18 
Hello !

Sorry for the late answer but it was the week-end Wink | ;) .

I also thought that having a static Destroy method could solve the problem but unfortunately not. If I specify Destroy as static and if I call this function from my executable:
CMyClass::Destroy();

it won't work neither Frown | :( If I set a breakpoint inside the Destroy function, the m_pInstance member is NULL (resulting in a memory leak).

The only way that works is to have a global exported function in the dll that calls Destroy (the same way as the creating function):
#ifdef DLL_EXPORTS
#define DLL_API __declspec(dllexport)
#else
#define DLL_API __declspec(dllimport)
#endif // DLL_EXPORT

DLL_API CMyClass* CreateClass();
DLL_API void DestroyClass();


The DestroyClass function only calls CMyClass::Destroy(). If I do that, it works. But this not really what I would like.

Any idea of what's happening here and how to solve the problem ?
Thank you.





Cédric Moonen
Software developer

Charting control [v1.1]

GeneralRe: Singleton template and dll Pin
led mike4-Dec-06 5:48
led mike4-Dec-06 5:48 
GeneralRe: Singleton template and dll Pin
Cedric Moonen4-Dec-06 8:03
Cedric Moonen4-Dec-06 8:03 
GeneralRe: Singleton template and dll Pin
led mike4-Dec-06 9:06
led mike4-Dec-06 9:06 
GeneralRe: Singleton template and dll Pin
Cedric Moonen4-Dec-06 9:25
Cedric Moonen4-Dec-06 9:25 
GeneralRe: Singleton template and dll Pin
led mike4-Dec-06 11:00
led mike4-Dec-06 11:00 
GeneralRe: Singleton template and dll Pin
Cedric Moonen4-Dec-06 20:15
Cedric Moonen4-Dec-06 20:15 
GeneralRe: Singleton template and dll Pin
led mike5-Dec-06 6:03
led mike5-Dec-06 6:03 
GeneralRe: Singleton template and dll Pin
Cedric Moonen5-Dec-06 20:31
Cedric Moonen5-Dec-06 20:31 
GeneralRe: Singleton template and dll Pin
led mike6-Dec-06 6:10
led mike6-Dec-06 6:10 
GeneralRe: Singleton template and dll Pin
Cedric Moonen6-Dec-06 8:11
Cedric Moonen6-Dec-06 8:11 
GeneralRe: Singleton template and dll Pin
Rick York1-Dec-06 10:25
mveRick York1-Dec-06 10:25 
GeneralRe: Singleton template and dll Pin
CPallini1-Dec-06 10:32
mveCPallini1-Dec-06 10:32 
QuestionEnumerate DLL Exports Pin
peterchen1-Dec-06 3:46
peterchen1-Dec-06 3:46 
AnswerRe: Enumerate DLL Exports Pin
Mike Dimmick1-Dec-06 4:24
Mike Dimmick1-Dec-06 4:24 
GeneralRe: Enumerate DLL Exports Pin
peterchen1-Dec-06 5:08
peterchen1-Dec-06 5:08 
QuestionWindows class not created error? Pin
TheDelChop1-Dec-06 3:08
TheDelChop1-Dec-06 3:08 
QuestionRe: Windows class not created error? Pin
CPallini1-Dec-06 3:15
mveCPallini1-Dec-06 3:15 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.