Böyle bir DllMain yazıyordu:Dllmain çağrılmıyor mu?
#include "main.h"
#include "init.h"
#include <iostream>
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
{
//std::cout<<"hi\n"; //only for debug. did not shown.
switch (fdwReason)
{
case DLL_PROCESS_ATTACH:
// attach to process
// return FALSE to fail DLL load
//std::cout<<"hello\n"; //only for debug. did not shown.
init(); //did not run :(
break;
case DLL_PROCESS_DETACH:
// detach from process
break;
case DLL_THREAD_ATTACH:
// attach to thread
break;
case DLL_THREAD_DETACH:
// detach from thread
break;
}
return TRUE; // succesful
}
ama bir test programından sonra LoadLibrary kullandığı(), hiçbir şey olmadı, hiçbir Merhaba veya ekranda selam. Sorunu çözmek ister misiniz? Çok teşekkürler!
P.S. DllMain not being called sorusunu izledim, ancak yine de yardımcı olmuyor.
PS2: Arayan programı
int main()
{
cout<<"This is a test program to test.\n";
HINSTANCE hinstDLL;
hinstDLL=LoadLibrary("ijl15.dll");
cout<<"Look like everything goes well.\n";
cout<<hinstDLL;
return 0;
}
gibi çalıştırdığı çıkışları ise:
This is a test program to test.
Look like everything goes well.
0x6a980000
Process returned 0 (0x0) execution time : 0.007 s
Press any key to continue.
Hmm ... Tamam görünüyor ... LoadLibrary() kodu ekleyebilir misin? Ayrıca, sadece emin olmak için - konsol penceresinden çıktılar arıyorsunuz, sağa mı? – TCS
Çalıştırıldığını init() görmeye istekliydim ama asla işe yaramaz bu yüzden biraz cout denedim ama hala işe yaramıyor – xxbidiao
Tüm linker anahtarlarınız nedir? –