|
Hi,
I am unable to load my test.dll using LoadLibrary() API. I get error code 126 (Module not found)using GetLastError().
By Dependency Walker, I have come to know that my test.dll depends on "xerces-c_2_7.dll" and "Xalan-C_1_10.dll". These dlls were already present on the same path as the exe.Still I am getting the error.
So I tried to load both the above mentioned third party dlls using LoadLibrary() which returned handle as 0x10000000. By GetLastError() I am getting error code 6 (Invalid Handle).
Can anyone please guide me on why I am getting the Invalid Handle error?
HINSTANCE hLib = LoadLibrary(_T("Xalan-C_1_10"));
TCHAR szMessage[MAX_PATH];
FormatMessage(FORMAT_MESSAGE_IGNORE_INSERTS|
FORMAT_MESSAGE_FROM_SYSTEM,
NULL, GetLastError(),
MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL),
szMessage, MAX_PATH, NULL);
hLib = LoadLibrary(_T("xerces-c_2_7"));
FormatMessage(FORMAT_MESSAGE_IGNORE_INSERTS|
FORMAT_MESSAGE_FROM_SYSTEM,
NULL, GetLastError(),
MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL),
szMessage, MAX_PATH, NULL);
|
|
|
|
|
Have you tried this:
HINSTANCE hLib = LoadLibrary(_T("test.dll"));
I noticed that the file extension is missing in your sample code.
|
|
|
|
|
Yes. It is not making any difference.
|
|
|
|
|
Member 4504339 wrote: I am unable to load my test.dll using LoadLibrary() API. I get error code 126 (Module not found)using GetLastError()
Are you sure the module is in the LoadLibrary search path?
Member 4504339 wrote: So I tried to load both the above mentioned third party dlls using LoadLibrary() which returned handle as 0x10000000
That's fine.
Member 4504339 wrote: By GetLastError() I am getting error code 6
Why did you call GetLastError while LoadLibrary didn't fail?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
|
Just as a silly check, try to put test.dll file into the system directory (for instance: C:\Windows\System32 ).
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
It's not making any difference.
|
|
|
|
|
Then I would drop any dependance (i.e. make a stub of 'test.dll', an almost-empty DLL just for testing purposes) and then try to load it.
You should stay simple when debugging.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Thanks all for replying. I could able to solve the issue. The problem was not with those two third party dlls. test.dll requires some MFC & Visual Studio specific dlls (mfc90d.dll, msvcp71d.dll, msvcp90d.dll, msvcr90.dll, msvcr90d.dll, msvcr71d.dll).
|
|
|
|
|
If hLib is not NULL , then LoadLibrary() is not failing.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
hLib is NULL for test.dll
|
|
|
|
|
Is it possible that your app is a 64 bit application and your dll an 32 bit dll?
|
|
|
|
|
you should load the dll from the directory where it was installed, so the dll can find the depending modules.
Press F1 for help or google it.
Greetings from Germany
|
|
|
|
|
Hii everybody,
Now, i have a project about networking but i must to built a program for my project.
I want to scan port for many host & server & dicevice network.
So, could you show me full code(every programing language) about scan port for range IP that it's simple and quickly.
Thanks you so much
my email: onemore86@yahoo.com.vn
|
|
|
|
|
onemore86 wrote: Now, i have a project about networking but i must to built a program for my project.
I want to scan port for many host & server & dicevice network.
So, could you show me full code(every programing language) about scan port for range IP that it's simple and quickly.
Point #2 in the post "How to ask a question"[^]:
Be specific! Don't ask "can someone send me the code to create an application that does 'X'. Pinpoint exactly what it is you need help with.
“Follow your bliss.” – Joseph Campbell
|
|
|
|
|
OP wrote: every programing language
I thought that part was quite ambitious as well...
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
I suppose he could get started here[^].
“Follow your bliss.” – Joseph Campbell
|
|
|
|
|
Hic, my major is not programing but my project relate with it. And i have not enough time start to program a new application.
So, could you help me, thanks a lot
email: onemore86@yahoo.com.vn
|
|
|
|
|
Hi
I want the source code of featured based image morphing implementing with openGL vc++ 2008.
I am looking forward to the source code.
Thanks,
Peh
|
|
|
|
|
Did u google.
Величие не Бога может быть недооценена.
|
|
|
|
|
Yes, i googled .. but i cant find the source code written with openGL vc++ 2008
|
|
|
|
|
Just refer this link to get an idea[^]
Just refer this link to get the sample source code in c++ [^]
Величие не Бога может быть недооценена.
|
|
|
|
|
Hi,
I need to know how can i pass the type _Connection (or _ConnectionPtr) as parameter in function in the IDL file ?
This is some lines of code :
Test.cpp
_Connection *pConn = NULL;
IDataExtract->get_ADOConnectionObject(&pConn);
IDL file
[id(38), helpstring("get connection")] HRESULT get_ADOConnectionObject([in, out] ???????????????);
thank you for help.
|
|
|
|
|
If you import ADO into your IDL file (try using importlib with the ADO type-library), then you can use _Connection*, i.e. an interface pointer.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
i have include ADO type-library like this:
importlib("C:\Program Files\Fichiers communs\System\ado\msado15.dll");
in the Library section
and i had wrote :
[id(38), helpstring("get connection")] HRESULT get_ADOConnectionObject([in, out] _Connection** pConnptr);
but it display error :
Error 1 error MIDL2009 : undefined symbol : _Connection [ Parameter 'ppAdoConnection' of Procedure 'get_ADOConnectionObject' ]
So how can resolve this problem ?
thank you
|
|
|
|