You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by "Williamson, Siehnai" <sw...@docucorp.com> on 2001/11/07 16:38:08 UTC

RE: Win32MsgLoader does not load error message when alternate exe cutable is used

I found that even setting the GetModuleHandle(NULL) does not work because
the statically linked lib will still not be able to locate the Xerces
resource which contains the error messages.  After several attempts, I ended
up merging the Xerces resource file containing the error messages with a
resource file already in my application that links fine.  Now I have one
resource file with both my application values and Xerces resource values.  I
hope this helps.


> -----Original Message-----
> From:	Armistead, Peter [SMTP:Peter.Armistead@softwareag.com]
> Sent:	Wednesday, November 07, 2001 7:50 AM
> To:	'xerces-c-dev@xml.apache.org'
> Subject:	RE: Win32MsgLoader does not load error message when
> alternate exe cutable  is used
> 
> 
> Have you tried setting the load address of the .exe as the resource
> handle?
> This will normally be 0x04000000 on Win32, or you can call
> GetModuleHandle(NULL);
> 
> Apologies if you have already tried this,
> 
> Peter
> 
> > -----Original Message-----
> > From: Douglas Turner [mailto:douglast@redflex.com.au]
> > Sent: Mittwoch, 7. November 2001 05:35
> > To: xerces-c-dev@xml.apache.org
> > Subject: RE: Win32MsgLoader does not load error message when alternate
> > executable is used
> > 
> > 
> > Hi,
> > 
> > I'm also trying to statically link Xerces under Win32 using MSVC++.  I
> > am getting the same problem, that: the error messages are not being
> > loaded.  If anyone knows a way around this, I would be interested to
> > know it.
> > 
> > I want my application to be statically linked because of these
> > advantages:
> > 1) you only need to distribute a single file,
> > 2) you don't need to worry about the path on the installed machine,
> > 3) there are no DLL version mismatch problems.
> > (this size of my executable is not important)
> > 
> > Thanks Douglas
> > 
> > Williamson, Siehnai wrote:
> > >
> > > My application uses statically linked libs so I'm using libs for the
> > sake of consistency.
> > >
> > 
> > Jerry Carter wrote:
> > ]
> > ] Is there a reason that you need to statically link to Xerces?
> > ]
> > 
> > Williamson, Siehnai wrote:
> > >
> > > What handle am I supposed to pass to get the appropriate resource
> > > when my execuable is a static lib?
> > >
> > 
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
> > For additional commands, e-mail: xerces-c-dev-help@xml.apache.org
> > 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-c-dev-help@xml.apache.org

Thanks: Win32MsgLoader does not load error message when alternate executable is used

Posted by Douglas Turner <do...@redflex.com.au>.
Thanks to Siehnai and Peter for your help,

I am happy to say that I am statically linking to the XercesC library
and also have the correct text in the XercesC error messages.  This was
achieved by adding the Xerces resource file (Version.rc in XercesC
1.5.1) to my MSVC++ project.  I had not been using a resources file, so
merging was not required.

Regards,
Douglas


"Williamson, Siehnai" wrote:

>
> I found that even setting the GetModuleHandle(NULL) does not work
> because the statically linked lib will still not be able to locate the
> Xerces resource which contains the error messages.  After several
> attempts, I ended up merging the Xerces resource file containing the
> error messages with a resource file already in my application that
> links fine.  Now I have one resource file with both my application
> values and Xerces resource values.  I hope this helps.
>
>      From:  Armistead, Peter [SMTP:Peter.Armistead@softwareag.com]
>
>      Have you tried setting the load address of the .exe as the
>      resource handle?
>      This will normally be 0x04000000 on Win32, or you can call
>      GetModuleHandle(NULL);
>
>      > From: Douglas Turner [mailto:douglast@redflex.com.au]
>      >
>      > I'm also trying to statically link Xerces under Win32 using
>      MSVC++.  I
>      > am getting the same problem, that: the error messages are not
>      being
>      > loaded.  If anyone knows a way around this, I would be
>      interested to
>      > know it.
>      >
>