Re: Problem Importing DLL function



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
.



Relevant Pages

  • Re: Dll problems after suspend
    ... EXE becomes invalid, so after wake when it tries to page it pukes. ... But when I switch the device on and off while the MessageBox ... takes place during resume that could influence Dll positions/registers? ...
    (microsoft.public.windowsce.app.development)
  • Have big problem with windows control dll
    ... One project that build a windows control dll ... In the windows control c-tor is there a call to a method in the class ... So in the project referense settings for the windows control I have a ... In the exe file c-tor I have a call to a method in the class library. ...
    (microsoft.public.dotnet.languages.csharp)
  • This must be a bug in C# when using user control DLL and class library DLL
    ... One project that build a user control dll called B ... One project that build a class library dll called C ... In the exe file c-tor I have a call to a method in the class library. ... the windows control because I can drag the windows control from the toolbox ...
    (microsoft.public.dotnet.general)
  • Re: trivial question about building exe
    ... exe file, so that I can send it to another machine and it works. ... DLL, ... source files in your exe project and remove all the DLL references. ... exe file that would install the application and all its DLLs on the user's ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Need Binary code edit tool
    ... > It should be easy to do if the dll uses the MessageBox API. ... > disassembler output to make sure that you really have found the correct ... but also the 4 PUSH instructions. ...
    (borland.public.delphi.thirdpartytools.general)

Loading