Click here to Skip to main content
15,913,055 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralCRicheditView n Dialog (MDI) Pin
Majid Khattak12-Jun-01 14:22
Majid Khattak12-Jun-01 14:22 
GeneralCopy icon to clipboard.. Pin
J Patel12-Jun-01 12:37
J Patel12-Jun-01 12:37 
GeneralSafely remove files... Pin
12-Jun-01 11:26
suss12-Jun-01 11:26 
GeneralRe: Safely remove files... Pin
Jeff Naber12-Jun-01 11:33
Jeff Naber12-Jun-01 11:33 
GeneralBuilding a linked list inside a DLL before DllMain Pin
Steve The Plant12-Jun-01 11:02
Steve The Plant12-Jun-01 11:02 
GeneralRe: Building a linked list inside a DLL before DllMain Pin
Tomasz Sowinski12-Jun-01 11:20
Tomasz Sowinski12-Jun-01 11:20 
GeneralRe: Building a linked list inside a DLL before DllMain Pin
Tim Deveaux12-Jun-01 14:13
Tim Deveaux12-Jun-01 14:13 
GeneralRe: Building a linked list inside a DLL before DllMain Pin
Steve The Plant12-Jun-01 15:24
Steve The Plant12-Jun-01 15:24 
Hey!

I checked it out. It's the same address all around. So they are pointing
to the same instance of g_List.

Also, it looks like the g_List's contructor only gets called before
DllMain(), even though it AddNode() gets called twice (in cListBuilder
and cListBuilder2). I just find that odd.

What I don't understand is how this method seems to work within an .exe
but not inside a DLL.

Another question would be, is there another way to accomplish this?
The whole goal of this is to have a linkedlist of information that
can be got from a DLL, but the linkedlist can only be built inside
.h files. Almost like building a linkedlist at compile time.

The only place I've seen this done is inside Monolith's Lithtech 3d engine.
They use a similar method to build an array of actor classes that can
be exported from a DLL so that the game client knows about what kind of
objects/enemies it can create. For them, to add a new class to the
array they just create the .cpp and the. h file for the new actor class and
call various macros in the actor's .h file. These macros, from what I've
understood, automatically add the new actor class to this actor "database".
They don't need to modify any other file, or modify any "factory" functions
to able to create an instance of the new actor class. I find their method
to be incredibly elegant, but I just can't totally figure out how they did it.

To find out what I mean, you can download the source code to Shogo in the
"files" section of PlanetShogo.com. Look at any of the actor classes inside
of the "server/objects" workspace, and you'll see what I mean.

Shawn
GeneralRe: Building a linked list inside a DLL before DllMain Pin
12-Jun-01 16:32
suss12-Jun-01 16:32 
GeneralRe: Building a linked list inside a DLL before DllMain Pin
Steve The Plant12-Jun-01 17:36
Steve The Plant12-Jun-01 17:36 
GeneralExporting classes in a dll that uses MFC Pin
Wes Jones12-Jun-01 9:59
Wes Jones12-Jun-01 9:59 
GeneralText viewer application Pin
Jeff Naber12-Jun-01 9:55
Jeff Naber12-Jun-01 9:55 
GeneralRe: Text viewer application Pin
Jeff Naber12-Jun-01 11:29
Jeff Naber12-Jun-01 11:29 
Generalopen files. Pin
12-Jun-01 8:58
suss12-Jun-01 8:58 
GeneralRe: open files. Pin
Carlos Antollini12-Jun-01 9:05
Carlos Antollini12-Jun-01 9:05 
GeneralI did not understand you !!!! Pin
12-Jun-01 19:17
suss12-Jun-01 19:17 
GeneralRe: open files. Pin
12-Jun-01 9:06
suss12-Jun-01 9:06 
Generalwell done !!!!! It was realy silly misprint! Pin
12-Jun-01 19:25
suss12-Jun-01 19:25 
General*.dsw and Borland Compiler Pin
12-Jun-01 8:19
suss12-Jun-01 8:19 
GeneralRe: *.dsw and Borland Compiler Pin
Tim Deveaux12-Jun-01 12:18
Tim Deveaux12-Jun-01 12:18 
GeneralSerial Port Communication. Pin
John Uhlenbrock12-Jun-01 7:44
John Uhlenbrock12-Jun-01 7:44 
GeneralRe: Serial Port Communication. Pin
John Uhlenbrock12-Jun-01 8:55
John Uhlenbrock12-Jun-01 8:55 
GeneralRe: Serial Port Communication. Pin
Eric Hansen12-Jun-01 9:52
Eric Hansen12-Jun-01 9:52 
GeneralRe: Serial Port Communication. Pin
12-Jun-01 22:38
suss12-Jun-01 22:38 
GeneralRe: Serial Port Communication. Pin
Eric Hansen12-Jun-01 9:49
Eric Hansen12-Jun-01 9:49 

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.