ngc7000
January 2nd, 2003, 06:44 PM
hello everybody,
i loaded up a dll into a process by apihook.
in the dll is the dllmain() funktion call to initialise it.
but the process normaly calls a custom entrypoint
and not dllmain to register the dll to the process.
how do i call this custom funktion, which is seated
in a other dll from my dll.
it won't be a problem to load up a second dll with
loadlibrary an register the 2. dll, if it can't be done with the
first one.
is getprocddress() a way to get access to this custom
funkt. and how to use the returnvalue (the address)
in my code to execute the funktion?
this is called on startup the dll.
/////////////////////////////////////////////////////////////////////////////
// DLL Entry Point
extern "C"
BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID pkt/*lpReserved*/)
{
if (dwReason == DLL_PROCESS_ATTACH)
{
_hdllInstance = hInstance;
// Extension DLL one time initialization
DeluxeDLL.AttachInstance(hInstance);
DisableThreadLibraryCalls(hInstance);
InitAcUiDLL();
}
else if (dwReason == DLL_PROCESS_DETACH)
{
// Terminate the library before destructors are called
DeluxeDLL.DetachInstance();
// try to decrease the refcount on the dbx
// if we couldn't load it then this a no op.
}
return TRUE; // ok
}
this is the funktion that should called from the process,
but there is no call?????????? :-(
/////////////////////////////////////////////////////////////////////////////
// ObjectARX EntryPoint
extern "C" AcRx::AppRetCode
acrxEntryPoint(AcRx::AppMsgCode msg, void* pkt)
{
switch (msg)
{
case AcRx::kInitAppMsg:
AfxSetResourceHandle(_hdllInstance);
CSplashScreen::EnableSplashScreen(TRUE);
CSplashScreen::ShowSplashScreen(acedGetAcadFrame());
AfxSetResourceHandle(acedGetAcadResourceInstance());
// Comment out the following line if your
// application should be locked into memory
acrxDynamicLinker->unlockApplication(pkt);
acrxDynamicLinker->registerAppMDIAware(pkt);
InitApplication();
break;
case AcRx::kUnloadAppMsg:
UnloadApplication();
break;
}
return AcRx::kRetOK;
}
regards
ngc
i loaded up a dll into a process by apihook.
in the dll is the dllmain() funktion call to initialise it.
but the process normaly calls a custom entrypoint
and not dllmain to register the dll to the process.
how do i call this custom funktion, which is seated
in a other dll from my dll.
it won't be a problem to load up a second dll with
loadlibrary an register the 2. dll, if it can't be done with the
first one.
is getprocddress() a way to get access to this custom
funkt. and how to use the returnvalue (the address)
in my code to execute the funktion?
this is called on startup the dll.
/////////////////////////////////////////////////////////////////////////////
// DLL Entry Point
extern "C"
BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID pkt/*lpReserved*/)
{
if (dwReason == DLL_PROCESS_ATTACH)
{
_hdllInstance = hInstance;
// Extension DLL one time initialization
DeluxeDLL.AttachInstance(hInstance);
DisableThreadLibraryCalls(hInstance);
InitAcUiDLL();
}
else if (dwReason == DLL_PROCESS_DETACH)
{
// Terminate the library before destructors are called
DeluxeDLL.DetachInstance();
// try to decrease the refcount on the dbx
// if we couldn't load it then this a no op.
}
return TRUE; // ok
}
this is the funktion that should called from the process,
but there is no call?????????? :-(
/////////////////////////////////////////////////////////////////////////////
// ObjectARX EntryPoint
extern "C" AcRx::AppRetCode
acrxEntryPoint(AcRx::AppMsgCode msg, void* pkt)
{
switch (msg)
{
case AcRx::kInitAppMsg:
AfxSetResourceHandle(_hdllInstance);
CSplashScreen::EnableSplashScreen(TRUE);
CSplashScreen::ShowSplashScreen(acedGetAcadFrame());
AfxSetResourceHandle(acedGetAcadResourceInstance());
// Comment out the following line if your
// application should be locked into memory
acrxDynamicLinker->unlockApplication(pkt);
acrxDynamicLinker->registerAppMDIAware(pkt);
InitApplication();
break;
case AcRx::kUnloadAppMsg:
UnloadApplication();
break;
}
return AcRx::kRetOK;
}
regards
ngc