|
Both these projects too large. I need fast & small HTML viewer, not an editor... May be something else?
|
|
|
|
|
Thanks!!!!!!!!!! Scintella is EXACTLY THAT I looking for!!!!
|
|
|
|
|
I'm having a problem adding a node to a XML file. I am able to open the file and read the elements but when i try to add a node is bombs.
MSXML::IXMLDOMElement * node;
node = document->createElement("Test");
document->appendChild(node);
It doesn't like the append to child. What is the correct way to add a new node in a XML docuement?
Thanks
Scott
|
|
|
|
|
try this instead:
<br />
MSXML::IXMLDOMElementPtr node;<br />
node = document->createElement("Test");<br />
document->appendChild(node);<br />
This way you will use the smart pointer classes that make querying and managing interfaces a lot simpler. You will also need to use the #inport statement to load teh MSXML library and provide thses smart pointers for you.
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
What do i need to import i currently have
#import "msxml.dll" named_guids
Scott
|
|
|
|
|
That's what you need.
Try the smart pointer implementation that I mentioned.
If that does not work then make sure that you have a valid document created.
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
|
Have you tried reading the error response codes to see why it bombs?
It would also be useful to see the code that you are using starting with where your Document is created.
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
Heres the code
String strPathName;
strPathName = "C:\\My Documents\\C_Projects\\XML\\books.xml";
CString csString;
HRESULT hr;
hr = CoInitialize(NULL);
if (FAILED(hr)) {
return;
}
hr = CoCreateInstance(MSXML::CLSID_DOMDocument, NULL,
CLSCTX_INPROC_SERVER | CLSCTX_LOCAL_SERVER,
MSXML::IID_IXMLDOMDocument, (LPVOID*)&document);
if (!document)
{
return;
}
BSTR bstr = NULL;
document->put_async(VARIANT_FALSE);
bstr = strPathName.AllocSysString();
VARIANT_BOOL varOkay = document->load(bstr);
SysFreeString(bstr);
BSTR nodeName;
if (varOkay)
{
hr = document->get_documentElement(&element);
if (FAILED(hr) || element == NULL)
{
MessageBox(_T("Empty document!"), _T("Error Loading XML"), MB_ICONWARNING);
return ;
}
element->get_nodeName(&nodeName);
m_List.AddString(CString(nodeName));
if(element->hasChildNodes())
{
MSXML::IXMLDOMNode* firstChild = NULL;
HRESULT hr;
hr = element->get_firstChild(&firstChild);
if (SUCCEEDED(hr) && firstChild != NULL)
{
((MSXML::IXMLDOMElement*)firstChild)->get_nodeName(&nodeName);
m_List.AddString(CString(nodeName));
}
}
MSXML::IXMLDOMElementPtr node;
node = document->createElement("Test");
document->appendChild(node);
}
else
{
long line, linePos;
BSTR reason = NULL;
document->get_parseError(&parseError);
parseError->get_errorCode(&hr);
parseError->get_line(&line);
parseError->get_linepos(&linePos);
parseError->get_reason(&reason);
CString strMsg;
strMsg.Format(_T("Error 0x%.8X on line %d, position %d\r\nReason: %s"),
hr, line, linePos, CString(reason));
MessageBox(strMsg, _T("Error Loading XML"), MB_ICONWARNING);
SysFreeString(reason);
return;
}
on the line -- document->appendChild(node);
is gives the error
Unhandled exception in XML.exe(kernal32.dll); 0xEO6D7363; Microsoft C++ Exception
Scott
|
|
|
|
|
Try appending your newly created node to the "element" or root nod eof your document rather than your document. I beleive your problem is that there is already a root element in the document and that is why there is a problem. However appending your new node ot the root element of the document seems to work fine.
If you have any other questions feel free to ask.
Good Luck
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
Might not solve the issue, but the API says the child must be a IXMLDOMNode* , not a IXMLDOMElement* .
MS quote (http://www.microsoft.com/ddk) : As of September 30, 2002, the Microsoft® Windows® 2000 DDK, the Microsoft Windows 98 DDK, and the Microsoft Windows NT® 4.0 DDK will no longer be available for purchase or download on this site.
|
|
|
|
|
I have class derivative from CView and I want to put it in
CPropertyPage class.
How can I do it?
Is any example program in the Internet?
Mithrandir
|
|
|
|
|
look at http://www.codeproject.com/docview/dfv.asp here at CodeProject. it helped me to place my doc/view architecture in dialog.
maybe it will help you too.
Dmitry Timin
|
|
|
|
|
I am trying to overload the stream insertion operator, I have defined my class like this:
#ifndef Time_h
#define Time_h
class Time
{
protected:
int hour;
int minute;
bool night;
public:
Time()
{
hour = 12;
minute = 0;
night = false;
}
Time(int H, int M, bool N)
{
hour = H;
minute = M;
night = N;
}
void Set(int, int, bool);
int GetHour();
int GetMin();
bool GetNight();
void Increment();
<font color="red">friend ostream &operator<<(ostream &, Time &);</font>
};
#endif
However I get a slew of errors, but the first one points to the line I highlighted in red saying:
<br />
c:\documents and settings\user\desktop\hw3\time.h(36) : error C2143: syntax error : missing ';' before '&'<br />
Does something look wrong with this declaration? Thanks in advance.
Nick Parker
So like children pointers should be left to grown ups. - Norm Alomond
|
|
|
|
|
My first guess is you didn't #include <iostream> since the error occurs right after the "ostream" token.
--Mike--
Just released - RightClick-Encrypt v1.4 - Adds fast & easy file encryption to Explorer
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
Michael Dunn wrote:
My first guess is you didn't #include <iostream> since the error occurs right after the "ostream" token.
Thanks, that was it , I think I need to step away from the computer again.
I hate missing those little things.
Nick Parker
So like children pointers should be left to grown ups. - Norm Alomond
|
|
|
|
|
if i want to get HWND the currently active window (on which user is working).how to get it ?
if i want to get active window (on which user is working)
component say Button HWND.how to get it?
may i know process id from a HWND?
may i know who many window AND sub window HWND'S are open by a process?if yes how?
r00d0034@yahoo.com
|
|
|
|
|
GetForegroundWindow will return the handle to the window that the user is working in.
If you want to get the handle to a particular button, it would be helpful to have the parent HWND and you can enumerate through the child windows of the parent window. Or you can use Find window and search for your button.
As far as getting the process of an HWND I think that you will first have to get teh thread ID that owns the window, then determine the process from that method.
As far as getting the number of windows for a particular process I cannot think of anyway except for enumerating all of the windows in the system, determining the process that it belongs to, and keep a running count. However there may be a simpler way with an API that I am not aware of.
Good LUck
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
Q.
how to get process id from hwnd?
Ans.
As far as getting the process of an HWND I think that you will first have to get teh thread ID that owns the window, then determine the process from that method.
can u explain it more briefly?plz give an code example?
r00d0034@yahoo.com
|
|
|
|
|
may i transfer an object from one computer to another on the network ?
if yes how?
r00d0034@yahoo.com
|
|
|
|
|
By object, you mean an instance of a C++ class? Yes, it is possible, by some mean of serialization. It can be an implementation of yours, or you could use some already available mechanism.
You need to be more specific.
Michel
It is a lovely language, but it takes a very long time to say anything in it, because we do not say anything in it, unless it is worth taking a very long time to say, and to listen to.
- TreeBeard
|
|
|
|
|
let say i want to transfer an object of CFile
how to transfer an object of it?
there is one way i know and that is tranfer the file bit by bit or using string transfer the file and again construct it on remote location.
BUT i want to tranfer the file object if it is possible writ the syntex of it ?plz?
r00d0034@yahoo.com
|
|
|
|
|
Yes,
if you simply have the code to handle the object on both machines, you can copy the data from the object to a flat stream of memory, then send that memory to the other machine and reconsitute the object.
If you do not have the code to run the object on the other machine, it is still possible to run the object on the other machine, but it is a lot of work, and opens up security holes.
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
is it possible when my application is running no other application could recive any type of keboard message and mouse messages.
while my running application recive it ?
r00d0034@yahoo.com
|
|
|
|
|
yes, try message hooks
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|