Click here to Skip to main content
15,917,329 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralNeed help with code and header. Thank You Very Much. Pin
shapper14-Feb-05 10:55
shapper14-Feb-05 10:55 
Questiondoes anyone know how to find local group permissions? Pin
jabroney14-Feb-05 10:00
jabroney14-Feb-05 10:00 
AnswerRe: does anyone know how to find local group permissions? Pin
David Crow14-Feb-05 10:10
David Crow14-Feb-05 10:10 
Questionchange hex string ? Pin
includeh1014-Feb-05 9:36
includeh1014-Feb-05 9:36 
AnswerRe: change hex string ? Pin
rocky_pulley14-Feb-05 9:47
rocky_pulley14-Feb-05 9:47 
AnswerRe: change hex string ? Pin
David Crow14-Feb-05 10:01
David Crow14-Feb-05 10:01 
GeneralDirect3D 8.0 question Pin
Bob Ciora14-Feb-05 9:14
Bob Ciora14-Feb-05 9:14 
GeneralATL Dialog in ATL COM with MFC support Pin
peterchen14-Feb-05 8:34
peterchen14-Feb-05 8:34 
GeneralWeird pointer behavior Pin
K. Shaffer14-Feb-05 6:32
K. Shaffer14-Feb-05 6:32 
GeneralRe: Weird pointer behavior Pin
Michael Dunn14-Feb-05 7:06
sitebuilderMichael Dunn14-Feb-05 7:06 
GeneralRe: Weird pointer behavior Pin
Maximilien14-Feb-05 7:06
Maximilien14-Feb-05 7:06 
GeneralRe: Weird pointer behavior Pin
rocky_pulley14-Feb-05 7:06
rocky_pulley14-Feb-05 7:06 
GeneralRe: Weird pointer behavior Pin
K. Shaffer14-Feb-05 7:50
K. Shaffer14-Feb-05 7:50 
GeneralRe: Weird pointer behavior Pin
K. Shaffer14-Feb-05 7:55
K. Shaffer14-Feb-05 7:55 
GeneralRe: Weird pointer behavior Pin
Maximilien14-Feb-05 8:38
Maximilien14-Feb-05 8:38 
GeneralRe: Weird pointer behavior Pin
TFrancis14-Feb-05 8:52
TFrancis14-Feb-05 8:52 
If, GetAddressOfApproachSomePlaceElse() calls new, then yes, this would be a memory leak. If in your function you want to change what object a pointer points to (not the object itself, but what object it points to), then one technique is to pass it a pointer to a pointer.

CApproach* pApproach = NULL;
GetNextApproach(&pApproach)

void GetNextApproach(CApproach** ppApproach)
{
*ppApproach = GetAddressOfApproachSomePlaceElse();
}

If you simply pass it a pointer, then it makes a copy of the pointer (not a copy of the object, but a copy of the pointer to the object). Any changes you make to the pointer (not the object, but the pointer to the object) will not be kept when the function returns, they are thrown away with the copy of the pointer.

Hope this helps,

Tim
GeneralRe: Weird pointer behavior Pin
Christian Graus14-Feb-05 15:02
protectorChristian Graus14-Feb-05 15:02 
GeneralSplitting with the existance of COutlook2Ctrl Pin
Mohammad Tarik14-Feb-05 6:10
Mohammad Tarik14-Feb-05 6:10 
GeneralRe: Splitting with the existance of COutlook2Ctrl Pin
rocky_pulley14-Feb-05 7:35
rocky_pulley14-Feb-05 7:35 
GeneralRe: Splitting with the existance of COutlook2Ctrl Pin
Mohammad Tarik14-Feb-05 12:18
Mohammad Tarik14-Feb-05 12:18 
Generali want to create my own takbar... Pin
14-Feb-05 5:33
suss14-Feb-05 5:33 
GeneralRe: i want to create my own takbar... Pin
rocky_pulley14-Feb-05 7:36
rocky_pulley14-Feb-05 7:36 
GeneralRe: i want to create my own taskbar... Pin
jaisri_g15-Feb-05 4:05
jaisri_g15-Feb-05 4:05 
GeneralSetting up multiple-port TCP/IP printers with TCPMON Xcv Commands Pin
TweakIt14-Feb-05 5:31
TweakIt14-Feb-05 5:31 
QuestionHow can I get ride of the 'X' that closes an application. Pin
mcgahanfl14-Feb-05 4:45
mcgahanfl14-Feb-05 4:45 

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.