I try to load a xml file from a resource dll, but the load fails.
I try the following example which works:
Set objXML = CreateObject("Msxml2.DOMDocument.3.0")
ObjXML.async=true
objXML.load "res://msxml3.dll/DEFAULTSS.XSL"
objXML.save "defaultss.xsl"
When I try to compile a new DLL with the XSL file that is saved in the
previous example, than I get a error "specified resource type cannot be
found in the image file". Probaly I 'm doing something wrong with the
compilation of the resource file. I decalere the xls file of the type
RCDATA.
Does anybody know how to compile a resource dll with a xml and xsl file in
it?
TIA
Leo
Not sure what that specific problem is Leo. However, I do know that your
code will not work reliably because you have set ObjXML.async=True, and not
waited for the .Load method to complete before executing the .Save method.
Unless you have some synchronisation code for waiting until the asynchronous
load has completed then I'd suggest setting async=False.
NB: this is a very common XML error because .async=True happens to be the
default. On a fast machine you may not even notice that you have a problem.
However, on a heavily used system, or when accessing a slow source (resource
file?) then it can show up in random ways.
Tony Proctor
> I try to load a xml file from a resource dll, but the load fails.
>
[quoted text clipped - 16 lines]
>
> Leo
Leo - 25 Sep 2004 14:09 GMT
The MSDN manual write that if you want to load a XML out of a resource dll,
the ObjXML.async must be TRUE.
I'll think that the problems is with compiling the resource dll with the
correct data.
Thanks for your respond.
Leo
> Not sure what that specific problem is Leo. However, I do know that your
> code will not work reliably because you have set ObjXML.async=True, and not
[quoted text clipped - 30 lines]
> >
> > Leo
Tony Proctor - 25 Sep 2004 14:47 GMT
I hadn't seen that MSDN reference before Leo. It doesn't make a lot of
sense. However, if you're going to set it to True, try putting that
synchronisation code in between.
Either wait for the .ReadyState property to become READYSTATE_COMPLETE (=4),
or move your .Save to an onreadystatechange event handler
Tony Proctor
> The MSDN manual write that if you want to load a XML out of a resource dll,
> the ObjXML.async must be TRUE.
[quoted text clipped - 43 lines]
> > >
> > > Leo
Leo - 25 Sep 2004 15:58 GMT
I don't think that is the problem because the example works fine, but not
with my own compiled dll.
/Leo
> I hadn't seen that MSDN reference before Leo. It doesn't make a lot of
> sense. However, if you're going to set it to True, try putting that
[quoted text clipped - 60 lines]
> > > >
> > > > Leo
Leo - 26 Sep 2004 10:47 GMT
I have found the problem, the names of the xml and xsl files contains
numbers and that is not possible in resource files.
/Leo
> I don't think that is the problem because the example works fine, but not
> with my own compiled dll.
[quoted text clipped - 70 lines]
> > > > >
> > > > > Leo