Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsVB SyntaxEnterprise DevelopmentDatabase AccessControlsCOMWin APICrystal ReportDeploymentGeneralGeneral 2
Related Topics
VB.NET / ASP.NETMS SQL ServerMS AccessOther Database ProductsMore Topics ...

VB Forum / COM / September 2004



Tip: Looking for answers? Try searching our database.

Load fails of a XML file in Resource DLL

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Leo - 25 Sep 2004 13:45 GMT
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
Tony Proctor - 25 Sep 2004 14:00 GMT
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
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.