wxDynamicLibrary and class
Posted: Wed May 24, 2006 5:20 pm
HI, i have a little question xD
I Maked a DLL and inside that i have got a class : "DllClass".
I maked it without problem, but when i want call the class member/function i dont know how i can do this.
With this code, i know ( i thing ) thath inside "pfnCreateTest" there is the class , but, How i can use this ?
DLL CODEThanks
I Maked a DLL and inside that i have got a class : "DllClass".
I maked it without problem, but when i want call the class member/function i dont know how i can do this.
Code: Select all
typedef DllClass* (* DllClass_v)(void);
wxDynamicLibrary dyn;
if( dyn.Load (LIB_NAME, wxDL_VERBATIM) )
{
wxMessageBox ( _T ("#Worked") , _T("DLL LOaded") , wxICON_INFORMATION | wxOK ) ;
}
else
{
wxMessageBox ( _T ("#ARgh, i cant open it") , _T("DLL Error") , wxICON_INFORMATION | wxOK ) ;
}
wxDYNLIB_FUNCTION ( DllClass_v , CreateTest , dyn ) ;
if ( ! pfnCreateTest )
{
wxMessageBox ( _T ( "NO FUNCTION" ) , _T ( "NO FUNCTION" ) , wxICON_INFORMATION | wxOK ) ;
}
else
{
wxMessageBox ( _T ( "FUNCTION" ) , _T ( "FUNCTION" ) , wxICON_INFORMATION | wxOK ) ;
}
DLL CODE
Code: Select all
BOOL APIENTRY DllMain( HANDLE hModule, DWORD ul_reason_for_call, LPVOID lpReserved )
{
return TRUE;
}
extern "C" __declspec (dllexport) DllClass* CreateTest()
{
//Nothing
}