Re: Problem Importing DLL function
- From: Joseph M. Newcomer <newcomer@xxxxxxxxxxxx>
- Date: Wed, 21 Sep 2005 00:53:41 -0400
Generally, you would not have anything retained "in memory". Is the DLL being built into
the same directory as your .exe file? Your suggestion that you have multiple versions of
exdll.dll would suggest to me that you first nuke all copies of the DLL (note that the
string ;you are looking for would be stored as Unicode, not ANSI, so searching for that
exact text string is problematic at best, and is not a good indicator of where the problem
might be) and rebuild. It could be you have something in the PATH that contains one of
your directories (if you do, be aware that depending on PATH is dangerous and should be
avoided).
Typically, I set my builds up to build all the DLLs into the same directory as my
project's .exe file. This has solved all such problems. What I usually do is create a
single \bin directory and change all the builds to build into ..\bin\debug\whatever.dll
instead of .\debug\whatever.dll. I redirect the .pdb and .lib files there also.
joe
On Mon, 19 Sep 2005 17:28:04 -0700, "victorsk" <victorsk@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
>Hello,
>
>I have a very strange problem. I am trying to import a function from one
>DLL and use that function in another DLL. I am trying to get a function from
>'exdll.dll' and use it in 'msvg.dll'. This is what I am trying to do:
>
>--------- export part (from exdll.dll): --------------
>extern "C" __declspec (dllexport) long CallDlg()
>{
> AFX_MANAGE_STATE(AfxGetStaticModuleState());
> CMain* dlg;
> try
> {
> dlg = new CMain();
> dlg->Create(IDD_MAIN);
> dlg->ShowWindow(SW_SHOW);
> }
> catch (CMain* dlg)
> {
> delete dlg;
> }
> return 0;
>}
>
>--------- import part (into msvg.dll): -------------
>
>extern "C" __declspec(dllimport) long CallDlg();
>long CSvg::OnFtpShow()
>{
> CallDlg();
> return 0;
>}
>
>What I do is in the project settings specify library module as being
>'exdll.lib'. This compiles no problem. BUT, the problem is when I try to
>invoke my OnFtpShow() function. When calling OnFtpShow(), I get a MessageBox
>message that I put for debugging purposes into my 'exdll.dll' a while back
>and then REMOVED it and re-compiled with that MessageBox removed over and
>over again. Yet, I keep getting that MessageBox message and have NO idea
>where it is coming from. I ran the text Finder in all of my 'exdll.dll'
>project files and couldn't find that message. Then, when after clicking
>through this MessageBox, I get the error pointing to:
>
>075F89C7 movsx eax,byte ptr [ebp+edx-270h]
>
>In the program Debugger.
>
>I will very much appreciated it if somebody could please let me know what is
>going on. I don't where that MessageBox (that I removed) is coming from much
>less how to fix that memory address problem. I hope somebody would be able
>to help me.
>
>Thank you,
>Victor.
Joseph M. Newcomer [MVP]
email: newcomer@xxxxxxxxxxxx
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
.
- References:
- Problem Importing DLL function
- From: victorsk
- Problem Importing DLL function
- Prev by Date: Re: How can I call a static member function of class reside in DLL?
- Next by Date: Re: CStatic in a CDialog
- Previous by thread: Problem Importing DLL function
- Next by thread: Proper sizing of a frame with splitter window
- Index(es):
Relevant Pages
|
Loading