You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-users@xerces.apache.org by Robert William Vesterman <bo...@digitalarts.com> on 2005/09/01 17:19:22 UTC

Doing something wrong with the DLL

Hi,

I'm doing something wrong, setting up my application to use the Xerces DLL,
that I think might be obvious to people with more experience in this matter.
This is not (I believe) a source code issue; rather, I believe it's an issue
with my lack of understanding about how to incorporate the DLL itself into
my project.

I wrote a DLL using Microsoft's VC++ 6.0's ATL Wizard.  I was using it in an
application that I wrote in VB6.  It was working fine.

I then tried changing my DLL to use the Xerces DLL, using the following
steps:

(1) Downloaded the Xerces source.
(2) Added the provided project to my workspace (previously, I had only the
one project associated with my DLL).
(3) Built the Xerces DLL.  No errors or warnings.
(4) Changed my DLL's code to use the Xerces DLL.  I want to explicitly state
here that I just mean C++ code - I didn't do anything to somehow reference
the Xerces DLL, like change some sort of non-C++ configuration file.
(5) Tried to build my DLL.  It couldn't find the appropriate Xerces headers.
(6) Changed my DLL's project to look in the appropriate header include path.
(7) Tried to build my DLL.  Compiled with no errors or warnings, but
couldn't find the Xerces DLL to link to it.
(8) Changed my DLL's project to link to the ".lib" file generated by the
Xerces project.
(9) Built my DLL.  No errors or warnings.

Up to here, everything seems fine.  But now things start going wrong:

I started up the VB6 application via the VC++ IDE's debugger.  Started fine,
seemed to be using my DLL fine.  I then tried functionality that I expected
would invoke code from Xerces.

The application behaved as it did before I changed my code (i.e. noticably
differently than I was expecting).

I then set a breakpoint in my DLL, where it should be entered from the
application.  Invoked that functionality, and the breakpoint was not hit.
Note that this breakpoint had nothing to do with Xerces.

At this point, I figured that my VB6 executable was set up to use a
different version of my DLL than I had just compiled - perhaps I had
previously set up the executable to use the "Release" version of my
DLL, whereas I had just built the "Debug" version, for example.  So, I fired
up VB6, went to "References", unchecked my DLL's entry, and then browsed to
the DLL that I just built.  I selected it, and VB6 did not complain.

I then tried to make the executable.  VB6 complained about a type from my
DLL, saying it was not defined, as if I hadn't entered my DLL as a
reference.

So, I went back into "References", and sure enough, my DLL's entry was not
checked.  So I browsed to it again, and selected it again.  Again, VB6 did
not complain, but again, doing so did not cause my DLL's entry to become
checked.

I thought maybe the problem might be that the Xerces project didn't
automatically register its DLL.  So I tried to do so with Regsvr32.  It told
me, "xerces-c_2_6D.dll was loaded, but the DllRegisterServer entry point was
not found.  This file can not be registered."

I also noticed some references on the web to changing StdAfx.h to "#import"
DLLs, so I changed my DLL's StdAfx.h to "#import "xerces-c_2_6D.dll"".  When
I then tried to rebuild my project, the linker complained that it couldn't
find that DLL.  I set up the appropriate library path in the linker's
"Input" configuration, but it still said it couldn't find the DLL.

Does anyone have any suggestions?

Thanks in advance for any help.

Bob Vesterman.



RE: Doing something wrong with the DLL

Posted by Robert William Vesterman <bo...@digitalarts.com>.
That worked great! Thanks very much.

-----Original Message-----
From: Alberto Massari [mailto:amassari@datadirect.com]
Sent: Thursday, September 01, 2005 11:26 AM
To: c-users@xerces.apache.org
Subject: Re: Doing something wrong with the DLL


Hi Robert,
you shouldn't have tried the regsvr32 step, nor the #import
statement; just be sure to copy the Xerces DLL into the same
directory where your ATL DLL is located, or in any folder that is
listed in your PATH environment variable.

Alberto

At 11.19 01/09/2005 -0400, Robert William Vesterman wrote:
>Hi,
>
>I'm doing something wrong, setting up my application to use the Xerces DLL,
>that I think might be obvious to people with more experience in this
matter.
>This is not (I believe) a source code issue; rather, I believe it's an
issue
>with my lack of understanding about how to incorporate the DLL itself into
>my project.
>
>I wrote a DLL using Microsoft's VC++ 6.0's ATL Wizard.  I was using it in
an
>application that I wrote in VB6.  It was working fine.
>
>I then tried changing my DLL to use the Xerces DLL, using the following
>steps:
>
>(1) Downloaded the Xerces source.
>(2) Added the provided project to my workspace (previously, I had only the
>one project associated with my DLL).
>(3) Built the Xerces DLL.  No errors or warnings.
>(4) Changed my DLL's code to use the Xerces DLL.  I want to explicitly
state
>here that I just mean C++ code - I didn't do anything to somehow reference
>the Xerces DLL, like change some sort of non-C++ configuration file.
>(5) Tried to build my DLL.  It couldn't find the appropriate Xerces
headers.
>(6) Changed my DLL's project to look in the appropriate header include
path.
>(7) Tried to build my DLL.  Compiled with no errors or warnings, but
>couldn't find the Xerces DLL to link to it.
>(8) Changed my DLL's project to link to the ".lib" file generated by the
>Xerces project.
>(9) Built my DLL.  No errors or warnings.
>
>Up to here, everything seems fine.  But now things start going wrong:
>
>I started up the VB6 application via the VC++ IDE's debugger.  Started
fine,
>seemed to be using my DLL fine.  I then tried functionality that I expected
>would invoke code from Xerces.
>
>The application behaved as it did before I changed my code (i.e. noticably
>differently than I was expecting).
>
>I then set a breakpoint in my DLL, where it should be entered from the
>application.  Invoked that functionality, and the breakpoint was not hit.
>Note that this breakpoint had nothing to do with Xerces.
>
>At this point, I figured that my VB6 executable was set up to use a
>different version of my DLL than I had just compiled - perhaps I had
>previously set up the executable to use the "Release" version of my
>DLL, whereas I had just built the "Debug" version, for example.  So, I
fired
>up VB6, went to "References", unchecked my DLL's entry, and then browsed to
>the DLL that I just built.  I selected it, and VB6 did not complain.
>
>I then tried to make the executable.  VB6 complained about a type from my
>DLL, saying it was not defined, as if I hadn't entered my DLL as a
>reference.
>
>So, I went back into "References", and sure enough, my DLL's entry was not
>checked.  So I browsed to it again, and selected it again.  Again, VB6 did
>not complain, but again, doing so did not cause my DLL's entry to become
>checked.
>
>I thought maybe the problem might be that the Xerces project didn't
>automatically register its DLL.  So I tried to do so with Regsvr32.  It
told
>me, "xerces-c_2_6D.dll was loaded, but the DllRegisterServer entry point
was
>not found.  This file can not be registered."
>
>I also noticed some references on the web to changing StdAfx.h to "#import"
>DLLs, so I changed my DLL's StdAfx.h to "#import "xerces-c_2_6D.dll"".
When
>I then tried to rebuild my project, the linker complained that it couldn't
>find that DLL.  I set up the appropriate library path in the linker's
>"Input" configuration, but it still said it couldn't find the DLL.
>
>Does anyone have any suggestions?
>
>Thanks in advance for any help.
>
>Bob Vesterman.




Re: Doing something wrong with the DLL

Posted by Alberto Massari <am...@datadirect.com>.
Hi Robert,
you shouldn't have tried the regsvr32 step, nor the #import 
statement; just be sure to copy the Xerces DLL into the same 
directory where your ATL DLL is located, or in any folder that is 
listed in your PATH environment variable.

Alberto

At 11.19 01/09/2005 -0400, Robert William Vesterman wrote:
>Hi,
>
>I'm doing something wrong, setting up my application to use the Xerces DLL,
>that I think might be obvious to people with more experience in this matter.
>This is not (I believe) a source code issue; rather, I believe it's an issue
>with my lack of understanding about how to incorporate the DLL itself into
>my project.
>
>I wrote a DLL using Microsoft's VC++ 6.0's ATL Wizard.  I was using it in an
>application that I wrote in VB6.  It was working fine.
>
>I then tried changing my DLL to use the Xerces DLL, using the following
>steps:
>
>(1) Downloaded the Xerces source.
>(2) Added the provided project to my workspace (previously, I had only the
>one project associated with my DLL).
>(3) Built the Xerces DLL.  No errors or warnings.
>(4) Changed my DLL's code to use the Xerces DLL.  I want to explicitly state
>here that I just mean C++ code - I didn't do anything to somehow reference
>the Xerces DLL, like change some sort of non-C++ configuration file.
>(5) Tried to build my DLL.  It couldn't find the appropriate Xerces headers.
>(6) Changed my DLL's project to look in the appropriate header include path.
>(7) Tried to build my DLL.  Compiled with no errors or warnings, but
>couldn't find the Xerces DLL to link to it.
>(8) Changed my DLL's project to link to the ".lib" file generated by the
>Xerces project.
>(9) Built my DLL.  No errors or warnings.
>
>Up to here, everything seems fine.  But now things start going wrong:
>
>I started up the VB6 application via the VC++ IDE's debugger.  Started fine,
>seemed to be using my DLL fine.  I then tried functionality that I expected
>would invoke code from Xerces.
>
>The application behaved as it did before I changed my code (i.e. noticably
>differently than I was expecting).
>
>I then set a breakpoint in my DLL, where it should be entered from the
>application.  Invoked that functionality, and the breakpoint was not hit.
>Note that this breakpoint had nothing to do with Xerces.
>
>At this point, I figured that my VB6 executable was set up to use a
>different version of my DLL than I had just compiled - perhaps I had
>previously set up the executable to use the "Release" version of my
>DLL, whereas I had just built the "Debug" version, for example.  So, I fired
>up VB6, went to "References", unchecked my DLL's entry, and then browsed to
>the DLL that I just built.  I selected it, and VB6 did not complain.
>
>I then tried to make the executable.  VB6 complained about a type from my
>DLL, saying it was not defined, as if I hadn't entered my DLL as a
>reference.
>
>So, I went back into "References", and sure enough, my DLL's entry was not
>checked.  So I browsed to it again, and selected it again.  Again, VB6 did
>not complain, but again, doing so did not cause my DLL's entry to become
>checked.
>
>I thought maybe the problem might be that the Xerces project didn't
>automatically register its DLL.  So I tried to do so with Regsvr32.  It told
>me, "xerces-c_2_6D.dll was loaded, but the DllRegisterServer entry point was
>not found.  This file can not be registered."
>
>I also noticed some references on the web to changing StdAfx.h to "#import"
>DLLs, so I changed my DLL's StdAfx.h to "#import "xerces-c_2_6D.dll"".  When
>I then tried to rebuild my project, the linker complained that it couldn't
>find that DLL.  I set up the appropriate library path in the linker's
>"Input" configuration, but it still said it couldn't find the DLL.
>
>Does anyone have any suggestions?
>
>Thanks in advance for any help.
>
>Bob Vesterman.