Click here to Skip to main content
15,921,941 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Generalget filenames from folder Pin
Anonymous11-Apr-05 0:18
Anonymous11-Apr-05 0:18 
GeneralRe: get filenames from folder Pin
ThatsAlok11-Apr-05 0:32
ThatsAlok11-Apr-05 0:32 
GeneralRe: get filenames from folder Pin
ddmcr11-Apr-05 0:32
ddmcr11-Apr-05 0:32 
GeneralRe: get filenames from folder Pin
Anonymous11-Apr-05 0:58
Anonymous11-Apr-05 0:58 
GeneralCAsyncSocket connect time Pin
GDavy11-Apr-05 0:11
GDavy11-Apr-05 0:11 
GeneralRe: CAsyncSocket connect time Pin
ThatsAlok11-Apr-05 0:17
ThatsAlok11-Apr-05 0:17 
GeneralFormatMessage FORMAT_MESSAGE_FROM_STRING Pin
asdf175311-Apr-05 0:07
asdf175311-Apr-05 0:07 
GeneralRe: FormatMessage FORMAT_MESSAGE_FROM_STRING Pin
Joel Holdsworth11-Apr-05 2:50
Joel Holdsworth11-Apr-05 2:50 
GeneralA question on visual studio Pin
PrashantJ10-Apr-05 23:45
PrashantJ10-Apr-05 23:45 
GeneralRe: A question on visual studio Pin
toxcct11-Apr-05 0:02
toxcct11-Apr-05 0:02 
GeneralRe: A question on visual studio Pin
PrashantJ11-Apr-05 0:04
PrashantJ11-Apr-05 0:04 
GeneralRe: A question on visual studio Pin
toxcct11-Apr-05 0:10
toxcct11-Apr-05 0:10 
GeneralRe: A question on visual studio Pin
PrashantJ11-Apr-05 0:37
PrashantJ11-Apr-05 0:37 
GeneralRe: A question on visual studio Pin
toxcct11-Apr-05 1:05
toxcct11-Apr-05 1:05 
GeneralRe: A question on visual studio Pin
ThatsAlok11-Apr-05 0:14
ThatsAlok11-Apr-05 0:14 
GeneralRe: A question on visual studio Pin
PrashantJ11-Apr-05 0:41
PrashantJ11-Apr-05 0:41 
GeneralRe: A question on visual studio Pin
ThatsAlok11-Apr-05 1:12
ThatsAlok11-Apr-05 1:12 
GeneralRe: A question on visual studio Pin
RChin11-Apr-05 1:52
RChin11-Apr-05 1:52 
GeneralRe: A question on visual studio Pin
PrashantJ11-Apr-05 1:59
PrashantJ11-Apr-05 1:59 
GeneralRe: A question on visual studio Pin
toxcct11-Apr-05 2:32
toxcct11-Apr-05 2:32 
GeneralGetting video info Pin
smack_2k210-Apr-05 23:09
smack_2k210-Apr-05 23:09 
QuestionHow do I record sound using DirectSound? Pin
mpallavi10-Apr-05 22:34
mpallavi10-Apr-05 22:34 
AnswerRe: How do I record sound using DirectSound? Pin
Tareq Ahmed Siraj10-Apr-05 23:22
Tareq Ahmed Siraj10-Apr-05 23:22 
GeneralInstaller Pin
topeakinniyi10-Apr-05 22:20
topeakinniyi10-Apr-05 22:20 
QuestionXML file traversal ???? Pin
Ritu Kwatra10-Apr-05 21:27
Ritu Kwatra10-Apr-05 21:27 
Hi all,

I am developing a Win32 Console application that reads XML file and displays the data. I am importing msxml4.dll and then usiing the following code to create the instance of the DomDocument class

HRESULT hr;
IXMLDOMDocumentPtr pDocument = NULL;
IXMLDOMParseErrorPtr pParseError = NULL;
BSTR bstr = NULL;
VARIANT_BOOL status = NULL;
VARIANT vsrc;

CoInitialize(NULL);

hr = CoCreateInstance(CLSID_XMLDocument,NULL,_ CLSCTX_INPROC_SERVER,IID_IXMLDocument,(void**)&pDocument);

VariantInit(&vsrc);
V_BSTR(&vsrc) = SysAllocString(L"try.xml");
V_VT(&vsrc) = VT_BSTR;

hr = pDocument->load(vsrc,&status);
hr = pDocument->Getxml(&bstr);
cout << "Try.xml comtents: " << bstr;

if(bstr)
SysFreeString(bstr);
if(&vsrc)
VariantClear(&vsrc);
if(pParseError)
pParseError->Release();
if(pDocument)
pDocument->Release();

CoUninitialize();

when I compiled the program it gives error
'Getxml' : is not a member of 'IXMLDOMDocument'

when I run the application without calling getXML function it gives me run time error that unhandled exception in the application.exe 0xC0000005: Access Violation.
Can anyone tell me where I am wrong.
I ahve the following files in system folder
msxml2.dll,msxml2r.dll,msxml3a.dll,msxml3.dll.msxml3r.dll.msxml4.dll,msxml4r.dll.msxmlr.dll

One point where I suspect error could be as to crete instance using CLSID_DOMDocument40, IXMLDOMDocument4 but in my project it gives me error when I call the CoCreateInstance with the above mentioned parameters.

Thanks in advance.

Ritu Kwatra

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.