मैं इस तरह एक DllMain लिख रहा था:डेलमेन नहीं कहा जा रहा है?
#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
}
लेकिन एक परीक्षण कार्यक्रम के बाद LoadLibrary का उपयोग करता है(), कुछ भी नहीं हुआ, कोई नमस्ते या स्क्रीन पर हाय। क्या आप समस्या का पता लगाना चाहते हैं? बहुत धन्यवाद!
पीएस मैंने DllMain not being called पर सवाल देखा है लेकिन यह अभी भी मदद नहीं करता है।
पीएस 2: फोन करने वाले कार्यक्रम
तरह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;
}
परीक्षक कार्यक्रम outputs है:
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.
हम्म ... ठीक लगता है ... क्या आप LoadLibrary() कोड जोड़ सकते हैं? इसके अलावा, बस निश्चित होने के लिए - आप कंसोल विंडो में प्रिंटआउट की तलाश में हैं, है ना? – TCS
मैं इनिट() को चलाने के लिए तैयार था, लेकिन यह कभी काम नहीं करता तो मैंने कुछ कोउट की कोशिश की लेकिन यह अभी भी काम नहीं कर रहा है। – xxbidiao
सभी के लिए आपके लिंकर स्विच क्या हैं? –