Problem calling a DLL from another DLL
-
Hi there, I have a DLL (DLL_1)for some measurement instrument that exports some functions, when I load DLL_1 from an MFC application and call Function_1 everything goes fine, but this not the way I want to use DLL_1. What I am trying to do is to create another DLL (DLL_2) to load the DLL_1 and call Function_1 but this always fails with a memory read error saying something like: "the memory at address 0x5435345 could not be read", this is wiered coz it is exactly the same code on the same machine. btw: Function_1 has one integer parameter so I don't think it has anything to do with passing parameters to the function! Could this have anything with the way DLLs manage memory? Any help? Any ideas? Thanks alot
And ever has it been that love knows not its own depth until the hour of separation Mohammad Gdeisat
-
Hi there, I have a DLL (DLL_1)for some measurement instrument that exports some functions, when I load DLL_1 from an MFC application and call Function_1 everything goes fine, but this not the way I want to use DLL_1. What I am trying to do is to create another DLL (DLL_2) to load the DLL_1 and call Function_1 but this always fails with a memory read error saying something like: "the memory at address 0x5435345 could not be read", this is wiered coz it is exactly the same code on the same machine. btw: Function_1 has one integer parameter so I don't think it has anything to do with passing parameters to the function! Could this have anything with the way DLLs manage memory? Any help? Any ideas? Thanks alot
And ever has it been that love knows not its own depth until the hour of separation Mohammad Gdeisat
Did you try to use your debugger to retrieve more information about the problem ?
Cédric Moonen Software developer
Charting control [v2.0 - Updated] OpenGL game tutorial in C++ -
Hi there, I have a DLL (DLL_1)for some measurement instrument that exports some functions, when I load DLL_1 from an MFC application and call Function_1 everything goes fine, but this not the way I want to use DLL_1. What I am trying to do is to create another DLL (DLL_2) to load the DLL_1 and call Function_1 but this always fails with a memory read error saying something like: "the memory at address 0x5435345 could not be read", this is wiered coz it is exactly the same code on the same machine. btw: Function_1 has one integer parameter so I don't think it has anything to do with passing parameters to the function! Could this have anything with the way DLLs manage memory? Any help? Any ideas? Thanks alot
And ever has it been that love knows not its own depth until the hour of separation Mohammad Gdeisat
Are you allocating/unallocating memory? If the answer is yes, see, for instance [^], <[^]. :)
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] -
Are you allocating/unallocating memory? If the answer is yes, see, for instance [^], <[^]. :)
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]No, I am not allocating any memory in my own code, I only call one function like this:
int res = MyFunction(5);
that's all I do. Thanks for the reply
And ever has it been that love knows not its own depth until the hour of separation Mohammad Gdeisat
-
Did you try to use your debugger to retrieve more information about the problem ?
Cédric Moonen Software developer
Charting control [v2.0 - Updated] OpenGL game tutorial in C++Hi, Unfortunately I have the DLL as release mode executable with no debugging information at all! the only thing the debugger will be able to display is some assembly code along with memory addresses which are not likely to be of much use, if you think that I can use them in someway plz let me know. btw: the function call (that craches when is made from a DLL) is so simple that it goes like this:
int res = MyFunction(4);
Cheers
And ever has it been that love knows not its own depth until the hour of separation Mohammad Gdeisat