Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: LoadXMLDocument failed in Dll with No selected DOM provider



Permlink Replies: 2 - Last Post: Oct 16, 2015 12:47 AM Last Post By: Vincent Dupuis
Vincent Dupuis

Posts: 11
Registered: 3/3/05
LoadXMLDocument failed in Dll with No selected DOM provider
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 15, 2015 2:17 AM
Hello,

I create an application that can export / import XML to / from a file.
This application is running correctly with standard VCL.
I want to include the import part to a dll which is call by another programm.
When I call the import code, I got the following message 'No selected DOM provider' on this line:

function LoadTFullChart(const FileName: string): IXMLTFullChartType;
begin
   Result := LoadXMLDocument(FileName).GetDocBinding('TFullChart', TXMLTFullChartType, TargetNamespace) as IXMLTFullChartType;
end;


This code is autogenerated using XML databinding.

I check the DefaultDOMVendor before and after calling this function, it is defined to MSXML.

Any idea will be great, because after a lot of tries , I have no more one.
Thank you for helping.

regards,
Vincent
Peter Below

Posts: 1,227
Registered: 12/16/99
Re: LoadXMLDocument failed in Dll with No selected DOM provider
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 15, 2015 11:43 AM   in response to: Vincent Dupuis in response to: Vincent Dupuis
Vincent Dupuis wrote:

Hello,

I create an application that can export / import XML to / from a file.
This application is running correctly with standard VCL.
I want to include the import part to a dll which is call by another
programm. When I call the import code, I got the following message
'No selected DOM provider' on this line:

function LoadTFullChart(const FileName: string): IXMLTFullChartType;
begin
   Result := LoadXMLDocument(FileName).GetDocBinding('TFullChart',
TXMLTFullChartType, TargetNamespace) as IXMLTFullChartType; end;


This code is autogenerated using XML databinding.

I check the DefaultDOMVendor before and after calling this function,
it is defined to MSXML.

Any idea will be great, because after a lot of tries , I have no more
one. Thank you for helping.

Are you trying to call the DLL function from a secondary thread? If yes
remember to initialize the COM libraries (CoInitialize) in the thread's
Execute method.

Also check the Uses clauses in the DLL DPR file and the unit your code
is in. Do you have XML.XmlDOM in the Uses clause?

There is also a possibility that you try to create your XML document
before the initialization code of xml.win.msxmldom.pas has been
executed. But that should only be a problem if you try to create the
document in a unit initialization section or the DLL dpr file main
block.

--
Peter Below
TeamB

Vincent Dupuis

Posts: 11
Registered: 3/3/05
Re: LoadXMLDocument failed in Dll with No selected DOM provider
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 16, 2015 12:47 AM   in response to: Peter Below in response to: Peter Below
Hello,

thank you Peter for your suggestions.
I just find the mistake or rather how to solve it.
My Delphi project is an old one from Delphi 2006, I upgrade it to 2009, 2010, XE5 then XE7.
I think some properties in this project was not set correctly during this upgrade or missing.
To solve my issue, I create a new dll library project and add all my unit, I compile it and it works now.

thank you for your help.

regards,
Vincent
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02