|
|
Hi,
Thank u.
The answer is, I should use Appwizard DLL instead of Win32 DLL. and one more thing, manually add header file and app file to create a new class instead of using pop menu.
Extreme programming. Do the No.1
|
|
|
|
|
Hi! I have a question about the mfc programming on a PocketPC with only 256 colors!
I have to make a application on a PocketPC, the application should draw some things in his view! So I use the GDI functions with the RGB(r,g,b) macro, it works fine in the x86 emulator. But does it run on a PocketPC with only 256 colors? (I found a very cheap PocketPC - HP Jornada 525
- with WinCE 3.0, but only with 256 colors) Does the System (WinCE) convert (reduce) the colors (RGB) to 256 colors? Have anyone experience with PocketPC's and 256 colors?
--
Nice greets, Daniel.
|
|
|
|
|
It is not working for me.how to make my window background as blue color.i used
window.hbrbackground=(HBRUSH)RGB(0,0,255);
|
|
|
|
|
When casting to a (HBRUSH) you must either pass a handle to an actual HBRUSH, or mandatorily pass one of the known system COLOR_ symbols, such like COLOR_WINDOW.
In your case, you need a user color, so you must create a HBRUSH.
window.hbrbackground=(HBRUSH) ::CreateSolidBrush( RGB(0,0,255) );
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.
|
|
|
|
|
Somebody help me!
I need to implement HTML Syntax hilighting in application, which written in pure API. Are there exist the ready solutions?
Thanks!
|
|
|
|
|
Hi,
you might try out www.scintilla.org[^] or the codemax [^] editor. Both very good text editors. The development for codemax has actually stopped but the source is still available i believe.
Wenn ist das Nunstück git und Slotermeyer? Ja! Beierhund das oder die Flipperwaldt gersput!
|
|
|
|
|
|
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
|
|
|
|