Click here to Skip to main content
15,887,434 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Socket creatinon in debug mode Pin
Mark Salsbery27-Jun-07 6:41
Mark Salsbery27-Jun-07 6:41 
GeneralRe: Socket creatinon in debug mode Pin
Zoltan Balazs27-Jun-07 7:05
Zoltan Balazs27-Jun-07 7:05 
QuestionHow to save System Log In & Log Off Times Pin
Nagaraju_Focus25-Jun-07 22:00
Nagaraju_Focus25-Jun-07 22:00 
AnswerRe: How to save System Log In & Log Off Times Pin
Hamed Musavi25-Jun-07 22:25
Hamed Musavi25-Jun-07 22:25 
QuestionClass derived from CDialog Pin
prithaa25-Jun-07 21:44
prithaa25-Jun-07 21:44 
AnswerRe: Class derived from CDialog Pin
Hamid_RT25-Jun-07 22:30
Hamid_RT25-Jun-07 22:30 
AnswerRe: Class derived from CDialog Pin
Mark Salsbery26-Jun-07 6:56
Mark Salsbery26-Jun-07 6:56 
QuestionTotally confused with memory alocation for '_get_pgmptr' function [modified] Pin
Hamed Musavi25-Jun-07 21:30
Hamed Musavi25-Jun-07 21:30 
Problem solved. Thanks.Rose | [Rose]

I need to use this function in c++ console app, and the documentation says:
errno_t <code>_get_pgmptr</code>( char **pValue );

pValue
A pointer to a string to be filled with ...

So I did this:
	char *path = new char[MAX_PATH+1];
	memset(path, NULL, MAX_PATH + 1);

	<code>_get_pgmptr</code>(&path);
...
        delete[] path;

But the call to the function, changes the address of the pointer(path) and calling the delete will fail.
I thought first that perhaps, I don't need to allocate any memory and the function (oddly) allocates it automatically and sends me the address but this is not the case either. Can anyone tell me what's wrong with this?

-- modified at 8:18 Tuesday 26th June, 2007
AnswerRe: Totally confused with memory alocation for '_get_pgmptr' function Pin
Rajkumar R25-Jun-07 21:58
Rajkumar R25-Jun-07 21:58 
GeneralRe: Totally confused with memory alocation for '_get_pgmptr' function Pin
Hamed Musavi25-Jun-07 22:16
Hamed Musavi25-Jun-07 22:16 
AnswerRe: Totally confused with memory alocation for '_get_pgmptr' function Pin
KaЯl25-Jun-07 22:48
KaЯl25-Jun-07 22:48 
GeneralRe: Totally confused with memory alocation for '_get_pgmptr' function Pin
Hamed Musavi26-Jun-07 2:19
Hamed Musavi26-Jun-07 2:19 
GeneralRe: Totally confused with memory alocation for '_get_pgmptr' function Pin
KaЯl26-Jun-07 2:39
KaЯl26-Jun-07 2:39 
QuestionWhat is the error in this code fragment Pin
xbiju25-Jun-07 21:16
xbiju25-Jun-07 21:16 
AnswerRe: What is the error in this code fragment Pin
Hamed Musavi25-Jun-07 21:33
Hamed Musavi25-Jun-07 21:33 
AnswerRe: What is the error in this code fragment Pin
Hamid_RT25-Jun-07 22:28
Hamid_RT25-Jun-07 22:28 
AnswerRe: What is the error in this code fragment Pin
Mark Salsbery26-Jun-07 7:08
Mark Salsbery26-Jun-07 7:08 
QuestionTab Order Pin
_anil_25-Jun-07 20:37
_anil_25-Jun-07 20:37 
AnswerRe: Tab Order Pin
Hamed Musavi25-Jun-07 21:54
Hamed Musavi25-Jun-07 21:54 
GeneralRe: Tab Order Pin
Hamid_RT25-Jun-07 22:32
Hamid_RT25-Jun-07 22:32 
GeneralRe: Tab Order Pin
Hamed Musavi25-Jun-07 22:41
Hamed Musavi25-Jun-07 22:41 
AnswerRe: Tab Order Pin
Hamid_RT25-Jun-07 22:21
Hamid_RT25-Jun-07 22:21 
GeneralRe: Tab Order Pin
_anil_25-Jun-07 23:19
_anil_25-Jun-07 23:19 
QuestionResizing list control with splitter and window Pin
neha.agarwal2725-Jun-07 20:20
neha.agarwal2725-Jun-07 20:20 
AnswerRe: Resizing list control with splitter and window Pin
_anil_25-Jun-07 20:42
_anil_25-Jun-07 20:42 

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.