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

C / C++ / MFC

 
GeneralRe: Singleton template and dll Pin
Cedric Moonen3-Dec-06 22:18
Cedric Moonen3-Dec-06 22:18 
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 
Well I added that new twist of the exported function but I still cannot reproduce your problem.

// logger.h
LOGLIBSINGLETON_API Logger& GetLogger();


// logger.cpp
LOGLIBSINGLETON_API Logger& GetLogger()
{
	return Logger::getInstance();
}


// application code
Logger& logger = GetLogger();
logger.log( msg, 0, 1, msg);
Logger::release();

I don't understand why you need an exported function that just returns a pointer to an instance but that's just me. Ultimately it does not change the fundamental structure of what you are doing which is why it still behaves exactly the same for me.

IMHO if you need parameters to set up the engine instance you are back to what I orginally suggested anyway. Let the user create an engine and setup the engine using it's interface. If the user must supply these parameters what difference does it make how (what functions/methods) they use to supply them?

Or even add the parameters to the static getInstance(....) method. The global exported functions are zero added vaule as far as I can tell (however they do not seem to be the cause of your error since it works for me).


led mike

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 
AnswerRe: Windows class not created error? Pin
TheDelChop1-Dec-06 3:17
TheDelChop1-Dec-06 3:17 
GeneralRe: Windows class not created error? Pin
CPallini1-Dec-06 6:26
mveCPallini1-Dec-06 6:26 
GeneralRe: Windows class not created error? Pin
TheDelChop1-Dec-06 7:26
TheDelChop1-Dec-06 7:26 
GeneralRe: Windows class not created error? Pin
CPallini1-Dec-06 7:35
mveCPallini1-Dec-06 7:35 
GeneralRe: Windows class not created error? Pin
TheDelChop1-Dec-06 7:37
TheDelChop1-Dec-06 7:37 
AnswerRe: Windows class not created error? Pin
Mark Salsbery1-Dec-06 7:44
Mark Salsbery1-Dec-06 7:44 
AnswerRe: Windows class not created error? Pin
Mark Salsbery1-Dec-06 8:09
Mark Salsbery1-Dec-06 8:09 

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.