Hello, I'm almost new on working with Dlls, I've read most but I have some questions.
1) the functions in a Dll can access to the global memory of the calling application; true?
2) as an exe, the dlls can have a global data space, which is lost every time a called function exits, true?
3) many doubts about dlls and objects..can a dll contain "objects"? I'm explaining, if I can...let's say I have an exported function as following:
Code:
MyClass* CreateMyClassObject( LPVOID params )
{
return new MyClass(params);
}
the implementation of MyClass is compiled in the dll. Now, my program creates a MyClass object loading the library, say myClass.dll, and creating the object:
Code:
...
LoadLibrary( _T("MyClass.dll"));
pFuncCreate = GetProcAddress( "CreateMyClassObject");
MyClass *p = (*pFuncCreate)( NULL );
now, the object is created in the heap, so the members are all accessible, but what about the methods? Is the library somehow called every time I access to a method of MyClass?
I'm sorry if you find many errors on fundamentals of dlls, please advise me on all those errors, because there's something fundamental I think I don't know about dlls...
Thank you all,
BrownB