|
Thank you, it's work fine
|
|
|
|
|
|
|
Hello i just want to create an xml using msxml3.0
but each and every time i am getting either a syntax error (in node creation) or a runtime error in (processing instruction).
the code is
IXMLDOMDocumentPtr document1=NULL;
IXMLDOMElementPtr elem1;
IXMLDOMNodePtr node;
IXMLDOMProcessingInstruction *IXMLDOMProcessingInstruction = NULL;
HRESULT hr;
BSTR bstrValue ;
node=document1->createNode(NODE_ELEMENT,"xml","version");
pIXMLDOMProcessingInstruction=document1->createProcessingInstruction ((BSTR)"xml",(BSTR)"version");
hr=document1->raw_createProcessingInstruction ((BSTR)"xml",(BSTR)"version",&pIXMLDOMProcessingInstruction);
the errors occured are:
in creating the node is :
error C2440: 'type cast' : enum MSXML::tagDOMNodeType' to 'const class _variant_t'
error in processing instruction are RUNTIME
the codes are correct, i don't wnat to use any wrapper class 4 the purpose.
msdn help is not very useful ,
ANy suggestion wld be helpful
Thx
Rahul Agarwal
|
|
|
|
|
Hello i just want to create an xml using msxml3.0
but each and every time i am getting either a syntax error (in node creation) or a runtime error in (processing instruction).
the code is
IXMLDOMDocumentPtr document1=NULL;
IXMLDOMElementPtr elem1;
IXMLDOMNodePtr node;
IXMLDOMProcessingInstruction *IXMLDOMProcessingInstruction = NULL;
HRESULT hr;
BSTR bstrValue ;
node=document1->createNode(NODE_ELEMENT,"xml","version");
pIXMLDOMProcessingInstruction=document1->createProcessingInstruction ((BSTR)"xml",(BSTR)"version");
hr=document1->raw_createProcessingInstruction ((BSTR)"xml",(BSTR)"version",&pIXMLDOMProcessingInstruction);
the errors occured are:
in creating the node is :
error C2440: 'type cast' : enum MSXML::tagDOMNodeType' to 'const class _variant_t'
error in processing instruction are RUNTIME
the codes are correct, i don't wnat to use any wrapper class 4 the purpose.
msdn help is not very useful ,
ANy suggestion wld be helpful
Thx
Rahul Agarwal
|
|
|
|
|
Hello Rahul!,
here is working code for IXMLDomDocument,i have taken this from MSDN but partly modified to run it on your compiler.Hope,it will work well for you
IXMLDOMDocument *pIXMLDOMDocument=NULL;
IXMLDOMElement *pIXMLDOMElement=NULL;
IXMLDOMProcessingInstruction *pIXMLDOMProcessingInstruction=NULL;
IXMLDOMNode *pIXMLDOMNode = NULL;
HRESULT hr ;
BSTR bstrValue ;
try
{
hr=CoCreateInstance(CLSID_DOMDocument,
NULL, CLSCTX_SERVER,
IID_IXMLDOMDocument,
(LPVOID*)(&pIXMLDOMDocument));
SUCCEEDED(hr) ? 0 : throw hr;
if(pIXMLDOMDocument)
{
hr=pIXMLDOMDocument->createElement(L"Node1", &pIXMLDOMElement);
if(SUCCEEDED(hr) && pIXMLDOMElement)
{
hr=pIXMLDOMElement->put_text(L"test");
if(SUCCEEDED(hr))
{
hr=pIXMLDOMDocument->createProcessingInstruction(L"xml",
L"version='1.0'", &pIXMLDOMProcessingInstruction);
if(SUCCEEDED(hr) && pIXMLDOMProcessingInstruction)
{
pIXMLDOMDocument->appendChild(pIXMLDOMProcessingInstruction,
&pIXMLDOMNode);
pIXMLDOMDocument->putref_documentElement(pIXMLDOMElement);
hr=pIXMLDOMDocument->get_xml(&bstrValue);
if(SUCCEEDED(hr))
{
::MessageBoxW(NULL, bstrValue, L"Loaded Doc", MB_OK);
bResult=TRUE;
}
if(pIXMLDOMNode)
pIXMLDOMNode->Release();
if(pIXMLDOMProcessingInstruction)
pIXMLDOMProcessingInstruction->Release();
}
}
if(pIXMLDOMElement)
pIXMLDOMElement->Release();
}
if(pIXMLDOMDocument)
pIXMLDOMDocument->Release() ;
}
}
catch(...)
{
if(pIXMLDOMElement)
pIXMLDOMElement->Release();
if(pIXMLDOMDocument)
pIXMLDOMDocument->Release();
if(pIXMLDOMNode)
pIXMLDOMNode->Release();
if(pIXMLDOMProcessingInstruction)
pIXMLDOMProcessingInstruction->Release();
}
Note: Please Post your COM related Query In it Specialized Forum.
"I Think this Will Help"
[Vote One Here,.....]
<h5
alok gupta="" <br=""> visit me at http://www.thisisalok.tk
|
|
|
|
|
I've to develop an simple SNTP server (no time performance are required).
Can someone give me some advices to develop it ?
I've created a RAW socket in order to receive any
message sent to my pc, to separate NTP messages
and to know the sender IP address and port. But it doesn't work !!
Is this the right way ?
Can someone help me ? Thanks a lot !!
|
|
|
|
|
I tried doing some stuff in windows with RAW sockets a while back and none of it would work (outside of simple PING stuff). I came to find out that windows didn't fully support RAW sockets. I don't know if this is still true with XP, but you may want to check into that.
-- Rocky Dean Pulley
|
|
|
|
|
Don't use RAW sockets, (S)NTP uses normal UDP. Create an UDP socket that listens on port 123.
|
|
|
|
|
Hi,
I have one application which will use CDialog::Create function to create one dialog at run time.
In normal cases it will be displayed correctly. But in some case (After abnormal crashing of application or Forcefull termination by killing the processs) it will displayed as full screen. But I am usng the same function both the cases.
Will anybody help me
|
|
|
|
|
|
I have a base class A. I have derived two classes B & C from A virtually. After that I have derived Class D from B and C. Class have a function fun().
I have created One object of D say obj and when I call obj.fun() it will call fun() of A.
Till now everything is fine.
But what is wondering me is how compiler knows weather fun() is coming to D through B or C as both have one copy of fun() and D also will have only one.
|
|
|
|
|
If I understand, your classes are like this?
class A { public: fun() { } };
class B : virtual public A { };
class C : virtual public A { };
class D : public B, public C { };
D obj;
obj.fun(); There is no ambiguity there because there is only one method called fun() . When you write obj.fun() , the compiler searches the inheritance tree for something called fun() and finds it in class A . Classes don't have "copies" of functions, the search for non-virtual methods is done at compile time.
--Mike--
LINKS~! Ericahist updated! | 1ClickPicGrabber | CP SearchBar v2.0.2 | C++ Forum FAQ
Strange things are afoot at the U+004B U+20DD
|
|
|
|
|
Is there any way to prevent MDI application from creating the initial child window?
|
|
|
|
|
Yes. See MSDN article Q141725.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
That really help!!!
Actual code is
BOOL CMyWinApp::InitInstance()<br />
{<br />
...<br />
<br />
CCommandLineInfo cmdInfo;<br />
ParseCommandLine(cmdInfo);<br />
<br />
if (cmdInfo.m_nShellCommand == CCommandLineInfo::FileNew)<br />
cmdInfo.m_nShellCommand = CCommandLineInfo::FileNothing;<br />
<br />
if (!ProcessShellCommand(cmdInfo))<br />
return FALSE;<br />
<br />
...<br />
}
|
|
|
|
|
Hi,
I have created an application which combines 3 bmp files and sends the raw data to the printer for printing. In a 600 dpi printer the data send from the application is large. I am using BitBlt() function to send the data to the printer. Can anyone help me in this?
How to reduce the printer buffer size? Is there any other format to send data to the printer.
Kindly help.
Thanks..
Vini
|
|
|
|
|
Just a note. BitBlt may not be supported by all printer drivers, so you may find that your code works for one and not another printer. You should converts any bitmap to a DIB and use StretchDIBits() to output pictures in theis way. Take a look at my "Printing tips and tricks" artile in the printing section. It gives example code to do the conversion.
To your question: Does it really matter what output size the printer file is before sending it to the printer?
If you vote me down, my score will only get lower
|
|
|
|
|
Thanks.
Roger Allen wrote:
To your question: Does it really matter what output size the printer file is before sending it to the printer?
I see that the amount of print data send to my printer is over 163MB. And when I try to print a 'pdf' file, around 400MB data is send. How can we reduce this? Kindly help
~Thanks
Vini
|
|
|
|
|
I have to convert a command to be sent to a piece of hardware from hex to char... i've done this in the following way and it works in vc++6 but not in vc++7 ?? it compiles fine in both but the command is different... anyone got any ideas why ??
CString csTrigger
csTrigger.Format("%c%c%c%c%c%c",0xFC,0x06,0xC3,0x00,0x04,0xD6);<br />
any ideas would be appreciated..
Regards
|
|
|
|
|
If I understood you correctly, you want to display the given hex digits as a string representation. If this is the case then you need to use the %X format.
<code>csTrigger.Format("%X%X%X%X%X%X",0xFC,0x06,0xC3,0x00,0x04,0xD6);
</code>
Why your sample code would change behaviour on VC6/7 I haven't got a clue!
I Dream of Absolute Zero
|
|
|
|
|
Thanks for responding... i need to use the %c to build up a string of characters from the hex values. like i say it builds in both but the conversion is different... i have tried checking the char sets etc but cannot find what is wrong. if you build a very basic project in both and put the line of code in both and step thru it, if you check the contents of the string you will see the differnce ?????
|
|
|
|
|
I'm puzzled because I have tried it (on VC6 and VC7.1) and they both behave as expected (displays 'üÃ').
Remember that the character string you are trying to build consist of these ASCII value: 0xFC,0x06,0xC3,0x00,0x04,0xD6. This equates to:
ASCII: 252, 6, 195, 0, 4, 214
First off, all of these ascii values does not map to 'regular' characters. 0x6 and 0x4 are non printable characters, and 0 is the null terminating character, so your string will stop at 0x00, resulting in the three letter output I gave above.
Unless you've done something else in your code, this is how it should execute. What is the output on your VC6 compilation?
I Dream of Absolute Zero
|
|
|
|
|
Hi all
I am using cr 10 for showing some reports saved as rpt files. I change the database connection at runtime.
Everything works fine.
But when the report window is opened (this is another window, a modelless) and if the export button is selected, my application remains running on the task manager.
And this happens only on widnows 2000.
All the Crystal report objects are made inside a function and shown on the OnInitDialog of the report window.
I included the craxdrt.h and created
FunctionCalledFromOnInitDailog()
{
IApplication app;
app.CreateDispatch(_T("CrystalRuntime.Application"),NULL)
//I do the rest of the things here, set the datasource of the viewer
//control etc
m_cysApp.DetachDispatch();
}
Any idea whats going on ?
Please help me.
Regards
Shiraz
The Best Relligion is Science.
Once you understand it, you will know God.
|
|
|
|
|
Hello
I wonder if there is tutorial/faq/info about how to downgrade a VC++7.0 solution to a VC++6.0 project?
thank you in advance
/Lucian
|
|
|
|