I think you should load the dlls by your own.
Take a look:
unsigned int scopy(TCHAR* dst,const unsigned int len,const unsigned int pos,const TCHAR* cat)
{
unsigned int i,n = min(len-1,pos+_tcslen(cat));
for(i=pos;i<len;i++) dst[i]=cat[i-pos]; dst[i]=0;
return i;
}
HINSTANCE DllLoad(const TCHAR* dll,const TCHAR* dllpath=__TEXT("DLL\\"))
{
TCHAR mod[MAX_PATH];
unsigned int len = GetModuleFileName(__hinst,mod,sizeof(mod)/sizeof(mod[0]));
for(;(0<len)&&('\\'!=mod[len-1]);len--);
len = scopy(mod,sizeof(mod)/sizeof(mod[0]),len,dllpath);
len = scopy(mod,sizeof(mod)/sizeof(mod[0]),len,dll);
return LoadLibrary(mod);
}
int FAR PASCAL WinMain(HINSTANCE h,HINSTANCE p,LPSTR c,int sw)
{
__hinst = h;
HINSTANCE hdll = DllLoad(__TEXT("first.dll"));
if(32<(unsigned int)hdll)
{
void (FAR PASCAL *myfunc)() = (void (FAR PASCAL *)())GetProcAddress(hdll,"first_func");
myfunc();
FreeLibrary(hdll);
}
return 42;
}