Re: IXMLDOMDocument is NULL when passed from DLL to EXE

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Alexander Nickolov (agnickolov_at_mvps.org)
Date: 03/25/04


Date: Thu, 25 Mar 2004 09:50:42 -0800

Did you pass the pointer, or the address of the pointer?

-- 
=====================================
Alexander Nickolov
Microsoft MVP [VC], MCSD
email: agnickolov@mvps.org
MVP VC FAQ: http://www.mvps.org/vcfaq
=====================================
"AS" <a@aa.com> wrote in message news:%2319z1XlEEHA.2884@TK2MSFTNGP12.phx.gbl...
> Hello
> 
> Firstly, i realise this seems like a question on the MSXML SDK - but i think
> the error im getting is COM related.
> 
> I have a thread which calls a function inside a DLL (which i also wrote -
> just a normal Win32 DLL). In the thread i declare a pointer to an XML
> Document i.e. IXMLDOMDocument *paXMLDoc = NULL;
> 
> I pass this pointer to my DLL which calls CoCreateInstance to create an XML
> document - the DLL function then proceeds to load an XML document.
> 
> However, the problem is that when the DLL function returns, the created XML
> document is always NULL. I have no idea why as I have debugged inside the
> DLL and it gets created ok. Its just not getting returned properly.
> 
> I have called CoInitializeEx in the main thread with the multithreaded flag.
> Could the problem be caused by the fact that i am trying to pass and object
> between my DLL and my EXE?
> 
> Any advice would be appreciates.
> 
> Thanks
> 
> Andy
> 
> 
> 
> 
> 
> 
> 
> 


Relevant Pages

  • Re: Problems calling function in an external DLL from a COM service
    ... Microsoft MVP, MCSD ... > service, the dll appears to load correctly, ... > the GetProcAddress calls complete successfully(valid callback pointer) ... > * \param RecorderName string reference containing the recorder name. ...
    (microsoft.public.vc.atl)
  • Re: IXMLDOMDocument is NULL when passed from DLL to EXE
    ... That was my problem - i now pass the address of the pointer and it works ... > just a normal Win32 DLL). ... In the thread i declare a pointer to an XML ... > document - the DLL function then proceeds to load an XML document. ...
    (microsoft.public.win32.programmer.ole)
  • IXMLDOMDocument is NULL when passed from DLL to EXE
    ... I have a thread which calls a function inside a DLL (which i also wrote - ... I pass this pointer to my DLL which calls CoCreateInstance to create an XML ... However, the problem is that when the DLL function returns, the created XML ...
    (microsoft.public.win32.programmer.ole)
  • Re: mfc to .NET
    ... Yes, our IDL system, and its precursor, the LG system, took pointer rebuilding as a key ... There are both "standard" extensions to XML, and ad hoc extensions to XML, that allow this ... The nested-vs.-flat notation was a boolean parameter of the writer; ... When I looked at MFC serialization, I saw it had all of the ...
    (microsoft.public.vc.mfc)
  • Re: Starting up application from dll.
    ... The config file gets its name from the .EXE, ... It is often the case that the DLL provides services ... how does the dll find it's XML file? ... This is convenient when transferring your app from dev to test to ...
    (microsoft.public.dotnet.framework)