Board index » cppbuilder » huge problem: class methods = ????
infernal
![]() CBuilder Developer |
huge problem: class methods = ????2005-03-13 02:15:09 AM cppbuilder102 hi, I have an application which AV's on me. It is quite big so i cant post the code, ive been debugging on it for days - and have seen something which i really cant understand. The program is an EXE file, which dynamically loads DLL's - and the DLL has an exported class - based on similar approach as in this thread: groups.google.dk/groups&lr=&threadm=3e84190d%40newsgroups.borland.com&rnum=1&prev=/groups%3Fq%3Dwww.experts-exchange.com/Programming/Programming_Languages/Cplusplus/Q_20562300.html%26hl%3Dda%26lr%3D%26selm%3D3e84190d%2540newsgroups.borland.com%26rnum%3D1 Anyway it is working okay - normally, there is some issues though - and one of the ive seen in my debugging, is inspecting the class pointer to the DLL class. When the AV comes, i can see that the class has all its variables and its own classes initiated fine, but the memberfunctions is all: ?????? (which means they dont have a memoryaddress - somehow not created ?). Which ofcourse creates the AV, because the program is calling a function which doesnt have a memory address. The mysterious part is that it is only happening sometimes, its not everytime the code is run - in my testing im loading, and reloading the DLL continously. What i suspect is that somewhere in the routine where i load the DLL it goes wrong: hLibrary = (HINSTANCE)::LoadLibrary( "line.dll" ); if (hLibrary!=NULL) { getclassplugin = (GETCLASSPLUGIN) GetProcAddress( hLibrary, "_LineGetClass" ); setclassplugin = (SETCLASSPLUGIN) GetProcAddress( hLibrary, "_LineSetClass" ); setclassplugin( (long)( this ) ); if (getclassplugin!=NULL) { lineDLL = NULL; getclassplugin( &lineDLL ); if (lineDLL != NULL) { lineDLL->Create(); LineLoaded ( true ); } } } As you can see ive tried to protect myself by checking on NULL's - but they are always != NULL, so it should be alright - but apparently something goes wrong. Anyway - do any of you know how a class can be initiated with variables, and class inside the variable segment - but memberfunctions arent created ? Really hope you can help here :( |