Click here to Skip to main content
15,888,521 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: CDC::DrawText Pin
xeonboy12-Oct-02 16:25
xeonboy12-Oct-02 16:25 
GeneralDev Studio AddIn - Getting OnIdle() to work. Pin
John Clayton12-Oct-02 5:27
John Clayton12-Oct-02 5:27 
GeneralLocating *my* icon in the system tray Pin
Taka Muraoka12-Oct-02 3:20
Taka Muraoka12-Oct-02 3:20 
QuestionIs Winsock XP different?? Pin
zbyrat12-Oct-02 2:44
zbyrat12-Oct-02 2:44 
AnswerRe: Is Winsock XP different?? Pin
Mike Nordell12-Oct-02 5:56
Mike Nordell12-Oct-02 5:56 
GeneralRe: Is Winsock XP different?? Pin
zbyrat12-Oct-02 6:22
zbyrat12-Oct-02 6:22 
GeneralMemory leak Pin
suresh_sathya12-Oct-02 2:23
suresh_sathya12-Oct-02 2:23 
GeneralRe: Memory leak Pin
MaximE12-Oct-02 11:29
MaximE12-Oct-02 11:29 
Jesus!!! Does this code work???

<br />
(_bstr_t)"DATABASE/TABLE[@Left]"<br />

What is this? Never, never do like this. Do:
<br />
_bstr_t(OLESTR("DATABASE/TABLE[@Left]"))<br />


<br />
pIXMLDOMNode->Release();<br />
pIXMLDOMNode=NULL;<br />

It's not bad, but pIXMLDOMNode = 0 is enough.

<br />
(LPARAM)(char *)(_bstr_t)Tablename<br />

Should be:
<br />
reinterpret_cast<LPARAM>(static_cast<TCHAR*>(_bstr_t(Tablename)))<br />

Such a bad cast should be explicit.

<br />
pIXMLDOMNode->get_attributes(&pIXMLDOMNamedNodeMap1);<br />

You are working with very smart pointer. Instead, do like this:
<br />
pIXMLDOMNamedNodeMap1 = pIXMLDOMNode->attributes;<br />


What is:
<br />
CHECK_AND_RELEASE(pIXMLDOMDocument2);<br />

May be it a:
<br />
#define CHECK_AND_RELEASE(x) x->AddRef()<br />

I don't know.

Summary.
1. Never, never use c-casts (like (_bstr_t)x, (LPARAM)y, etc). They are the worst evil, unless you damn sure that you do. It's very hard to find a bug in a such code.
2. Read about _com_ptr_t. Learn how it's intended to use.
3. Avoid macros.
4. Optional, but strongly recommended. Get a Stroustrup.
QuestionHow can i simple add a JPG image to my Dialog based application Pin
whofmans12-Oct-02 1:54
whofmans12-Oct-02 1:54 
AnswerRe: How can i simple add a JPG image to my Dialog based application Pin
Michael P Butler12-Oct-02 2:00
Michael P Butler12-Oct-02 2:00 
AnswerRe: How can i simple add a JPG image to my Dialog based application Pin
Nish Nishant12-Oct-02 2:06
sitebuilderNish Nishant12-Oct-02 2:06 
GeneralCopy - rename Pin
Brakanjan12-Oct-02 1:49
Brakanjan12-Oct-02 1:49 
GeneralRe: Copy - rename Pin
Nish Nishant12-Oct-02 2:09
sitebuilderNish Nishant12-Oct-02 2:09 
GeneralRe: Copy - rename Pin
Brakanjan12-Oct-02 2:25
Brakanjan12-Oct-02 2:25 
GeneralRe: Copy - rename Pin
Nish Nishant12-Oct-02 3:50
sitebuilderNish Nishant12-Oct-02 3:50 
GeneralRe: Copy - rename Pin
Maximilien12-Oct-02 5:31
Maximilien12-Oct-02 5:31 
Questionhow to develop web stress test software? Pin
ricklau12-Oct-02 1:02
ricklau12-Oct-02 1:02 
AnswerRe: how to develop web stress test software? Pin
Nish Nishant12-Oct-02 1:06
sitebuilderNish Nishant12-Oct-02 1:06 
AnswerRe: how to develop web stress test software? Pin
Daniel Turini12-Oct-02 7:08
Daniel Turini12-Oct-02 7:08 
Generalcapture keystoke and screenshot in DOS mode Pin
shitij12-Oct-02 1:00
shitij12-Oct-02 1:00 
GeneralCapture fields in active window Pin
shitij12-Oct-02 0:58
shitij12-Oct-02 0:58 
GeneralRe: Capture fields in active window Pin
Nish Nishant12-Oct-02 1:02
sitebuilderNish Nishant12-Oct-02 1:02 
GeneralRe: how to develop web stress test software? Pin
Stephane Rodriguez.12-Oct-02 0:20
Stephane Rodriguez.12-Oct-02 0:20 
GeneralIncrease in Memory size Pin
suresh_sathya11-Oct-02 23:54
suresh_sathya11-Oct-02 23:54 
GeneralRe: Increase in Memory size Pin
Stephane Rodriguez.12-Oct-02 0:11
Stephane Rodriguez.12-Oct-02 0:11 

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.