Click here to Skip to main content
15,915,082 members
Home / Discussions / COM
   

COM

 
GeneralRe: Multiple import Pin
Joao Vaz18-Mar-02 0:51
Joao Vaz18-Mar-02 0:51 
GeneralActiveX Pin
Leesen16-Mar-02 3:43
Leesen16-Mar-02 3:43 
GeneralRe: ActiveX Pin
Mazdak16-Mar-02 4:10
Mazdak16-Mar-02 4:10 
Generalerror C2501: 'MIDL_INTERFACE' Pin
drewtenn15-Mar-02 19:05
drewtenn15-Mar-02 19:05 
GeneralRe: error C2501: 'MIDL_INTERFACE' Pin
Joao Vaz18-Mar-02 1:28
Joao Vaz18-Mar-02 1:28 
GeneralRe: error C2501: 'MIDL_INTERFACE' Pin
18-Mar-02 5:59
suss18-Mar-02 5:59 
Generalone problem about vbscript.dll Pin
Davidlou15-Mar-02 16:07
Davidlou15-Mar-02 16:07 
GeneralTrouble with MSXML 4 Pin
MightyM15-Mar-02 10:26
MightyM15-Mar-02 10:26 
Help!

I'm a experienced VB/junior C++ developer and I'm starting to play a little with ATL. I'm having tons of trouble working with MSXML 4 even though I'm doing some pretty simple stuff. Perhaps somebody can spot something that I'm doing wrong.

The code I'm trying to run is in an ATL DLL project and belongs to a COM object called CBuilder. It's extremely simple since I'm just experimenting. Here's the code I'm trying to run:

#import "C:\Winnt\System32\msxml4.dll"
using namespace MSXML2;

STDMETHODIMP CBuilder::InitDocument()
{
IXMLDOMDocumentPtr doc;
HRESULT hr = doc.CreateInstance("Msxml2.DOMDocument.4.0");

if(FAILED(hr))
return hr;

hr = doc->loadXML("<customer><first_name>Joe<last_name>Smith");

if(SUCCEEDED(hr))
return S_OK;
else
return hr;
}

This seems about at simple as it gets. The trouble is, whenever I call this method from either a VB or C++ exe, the doc->loadXML() call returns a -1 (E_FAIL, I believe?). I can't figure out why. I can load up a DOMDocument from VB6 just fine using this same XML string. Why can't I do it in VC++?

Any input is really appreciated. This is getting frustrating! Cry | :((

Thanks!
GeneralRe: Trouble with MSXML 4 Pin
pba_15-Mar-02 11:29
pba_15-Mar-02 11:29 
GeneralRe: Trouble with MSXML 4 Pin
MightyM15-Mar-02 11:34
MightyM15-Mar-02 11:34 
GeneralRe: Trouble with MSXML 4 Pin
pba_15-Mar-02 11:55
pba_15-Mar-02 11:55 
GeneralRe: Trouble with MSXML 4 Pin
15-Mar-02 12:22
suss15-Mar-02 12:22 
GeneralRe: Trouble with MSXML 4 Pin
MightyM18-Mar-02 5:19
MightyM18-Mar-02 5:19 
GeneralActiveX control doesn't paint at design-time Pin
15-Mar-02 10:27
suss15-Mar-02 10:27 
GeneralDCOM with Visual C++ Pin
15-Mar-02 8:24
suss15-Mar-02 8:24 
GeneralRe: DCOM with Visual C++ Pin
Anand Amirineni15-Mar-02 9:14
Anand Amirineni15-Mar-02 9:14 
Generalreceiving a Boolean type in VB Pin
Jerome Conus15-Mar-02 5:28
Jerome Conus15-Mar-02 5:28 
GeneralRe: receiving a Boolean type in VB Pin
pba_15-Mar-02 8:14
pba_15-Mar-02 8:14 
GeneralRe: receiving a Boolean type in VB Pin
Anand Amirineni15-Mar-02 9:54
Anand Amirineni15-Mar-02 9:54 
GeneralImplement onIdle Pin
dejan.n15-Mar-02 3:12
dejan.n15-Mar-02 3:12 
GeneralRe: Implement onIdle Pin
Prem Kumar15-Mar-02 8:13
Prem Kumar15-Mar-02 8:13 
GeneralPassing a BSTR to VB Pin
Jerome Conus14-Mar-02 21:37
Jerome Conus14-Mar-02 21:37 
GeneralRe: Passing a BSTR to VB Pin
Mazdak14-Mar-02 22:04
Mazdak14-Mar-02 22:04 
GeneralRe: Passing a BSTR to VB Pin
Joao Vaz14-Mar-02 23:45
Joao Vaz14-Mar-02 23:45 
GeneralRe: Passing a BSTR to VB Pin
Jerome Conus15-Mar-02 5:27
Jerome Conus15-Mar-02 5:27 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.