Click here to Skip to main content
15,897,891 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: How to import a file into PE header of an exe then load that file from within modified exe Pin
Richard MacCutchan9-Feb-10 6:17
mveRichard MacCutchan9-Feb-10 6:17 
GeneralRe: How to import a file into PE header of an exe then load that file from within modified exe Pin
only_jack9-Feb-10 7:08
only_jack9-Feb-10 7:08 
GeneralRe: How to import a file into PE header of an exe then load that file from within modified exe Pin
David Crow9-Feb-10 7:19
David Crow9-Feb-10 7:19 
GeneralRe: How to import a file into PE header of an exe then load that file from within modified exe Pin
LunaticFringe9-Feb-10 7:32
LunaticFringe9-Feb-10 7:32 
GeneralRe: How to import a file into PE header of an exe then load that file from within modified exe Pin
only_jack9-Feb-10 10:53
only_jack9-Feb-10 10:53 
GeneralRe: How to import a file into PE header of an exe then load that file from within modified exe Pin
Richard MacCutchan9-Feb-10 21:53
mveRichard MacCutchan9-Feb-10 21:53 
GeneralRe: How to import a file into PE header of an exe then load that file from within modified exe Pin
Richard MacCutchan9-Feb-10 7:47
mveRichard MacCutchan9-Feb-10 7:47 
Questionerror LNK2001: unresolved external symbol "private: static class std::map<class std::basic_string Pin
transoft9-Feb-10 3:24
transoft9-Feb-10 3:24 
Hi
I did following:

struct BaseFactory 
{
    typedef std::map<std::string, CBaseClass*(*)()> map_type;

...
protected:
    static map_type * getMap() 
    {
        if(!map) { map = new map_type; } 
        return map; 
    }

private:
    static map_type * map;
};

template<typename T>
struct RegisterUserClass : BaseFactory 
{ 
    RegisterUserClass( std::string const& s ) 
    { 
        getMap()->insert(std::make_pair(s, &createT<T>));
    };
};

myCode.h
class CMyCode
{
...
private:
RegisterUserClass<CMyCode&gt; reg;
}

myCode.cpp
RegisterUserClass<CMyCode> reg("CMyCode");


I got a link error. I know the "map" did not get initialized. How can "map" be initialized for my case?

Thanks,
AnswerRe: error LNK2001: unresolved external symbol "private: static class std::map<class std::basic_string Pin
Graham Breach9-Feb-10 3:44
Graham Breach9-Feb-10 3:44 
QuestionMIDL cascading Pin
William Engberts9-Feb-10 1:26
William Engberts9-Feb-10 1:26 
QuestionMessage Removed Pin
9-Feb-10 0:18
gregarion9-Feb-10 0:18 
AnswerRe: Database Syntax Pin
ThatsAlok9-Feb-10 0:46
ThatsAlok9-Feb-10 0:46 
GeneralRe: Database Syntax Pin
gregarion9-Feb-10 1:05
gregarion9-Feb-10 1:05 
AnswerRe: Database Syntax Pin
Game-point9-Feb-10 0:56
Game-point9-Feb-10 0:56 
GeneralRe: Database Syntax Pin
gregarion9-Feb-10 1:06
gregarion9-Feb-10 1:06 
GeneralRe: Database Syntax Pin
Game-point9-Feb-10 1:23
Game-point9-Feb-10 1:23 
GeneralRe: Database Syntax Pin
gregarion9-Feb-10 1:49
gregarion9-Feb-10 1:49 
GeneralRe: Database Syntax Pin
Richard MacCutchan9-Feb-10 2:40
mveRichard MacCutchan9-Feb-10 2:40 
GeneralRe: Database Syntax Pin
David Crow9-Feb-10 3:14
David Crow9-Feb-10 3:14 
GeneralRe: Database Syntax Pin
gregarion9-Feb-10 3:32
gregarion9-Feb-10 3:32 
AnswerRe: Database Syntax Pin
David Crow9-Feb-10 3:37
David Crow9-Feb-10 3:37 
GeneralRe: Database Syntax Pin
gregarion9-Feb-10 3:38
gregarion9-Feb-10 3:38 
QuestionRe: Database Syntax Pin
David Crow9-Feb-10 3:55
David Crow9-Feb-10 3:55 
AnswerRe: Database Syntax Pin
gregarion9-Feb-10 3:55
gregarion9-Feb-10 3:55 
GeneralRe: Database Syntax Pin
Maximilien9-Feb-10 4:16
Maximilien9-Feb-10 4:16 

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.