我想加載在默認Windows打印機驅動程序資源文件中使用的unired.dll。 我可以爲Windows Vista x86加載unires.dll。我可以在x86應用程序中爲x64構建加載資源庫(DLL)嗎?
它位於C:\ WINDOWS \ SYSTEM32 \閥芯\ DRIVERS \ W32X86 \ 3
但現在我使用的是Windows 7專業版64位。
因此,位於 C:\ Windows \ System32 \ spool \ drivers \ x64 \ 3中的同名unires.dll無法加載。
通過下面的代碼,GetLastError()返回193
這可能嗎?或不可能? 我使用Visual Studio 2005 Pro。嘗試構建x64和x86,但每個都失敗。
TCHAR libName[MAX_PATH];
wsprintf(libName , _T("unires.dll"));
HINSTANCE hLibraryInstance = ::LoadLibrary(libName);
DWORD ErrorId=::GetLastError();
std::wofstream out;
out.open(_T("unires.txt"));
for(UINT resKey=0;resKey<100000;resKey++)
{
TCHAR * resBuf=new TCHAR[CHAR_MAX];
int BufferMaxSize=CHAR_MAX;
int Result=::LoadString(hLibraryInstance, resKey, resBuf, BufferMaxSize);
wstring resStr=resBuf;
if(!resStr.empty())
{
out<<resKey;
out<<" ";
out<<resStr.c_str();
out<<endl;
}
if(resBuf!=NULL)
{
delete [] resBuf;
}
}
out.close();
請幫幫我。 最好的問候!
的可能重複的[從一個32位進程上的64位的dll調用LoadLibrary](HTTP:/ /stackoverflow.com/questions/2466637/calling-loadlibrary-on-a-64-bit-dll-from-a-32-bit-process) – CharlesB