Click here to Skip to main content
15,891,674 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Hello i hooked readprocessmemory and have some problems logging its lpBuffer Pin
Richard MacCutchan1-Jan-11 21:40
mveRichard MacCutchan1-Jan-11 21:40 
GeneralRe: Hello i hooked readprocessmemory and have some problems logging its lpBuffer Pin
nah13371-Jan-11 21:46
nah13371-Jan-11 21:46 
GeneralRe: Hello i hooked readprocessmemory and have some problems logging its lpBuffer Pin
Richard MacCutchan1-Jan-11 22:05
mveRichard MacCutchan1-Jan-11 22:05 
GeneralRe: Hello i hooked readprocessmemory and have some problems logging its lpBuffer Pin
nah13371-Jan-11 22:16
nah13371-Jan-11 22:16 
GeneralRe: Hello i hooked readprocessmemory and have some problems logging its lpBuffer Pin
Richard MacCutchan2-Jan-11 1:10
mveRichard MacCutchan2-Jan-11 1:10 
QuestionLPCWSTR Problem.? Pin
goldenrose91-Jan-11 19:24
goldenrose91-Jan-11 19:24 
AnswerRe: LPCWSTR Problem.? Pin
Richard MacCutchan2-Jan-11 1:14
mveRichard MacCutchan2-Jan-11 1:14 
AnswerRe: LPCWSTR Problem.? Pin
User 74293382-Jan-11 3:47
professionalUser 74293382-Jan-11 3:47 
The hello string is a local variable within the DisplayInfo() function; so when you return, the memory is freed. You return a pointer to the string, but the string's memory got overwritten.

To fix this this particular problem, you could make hello a static variable; this will keep its address valid after returning.

Another, more generally usable way would be to pass a string variable to DisplayInfo() and copy hello's content to it inside the function.

modified 13-Sep-18 21:01pm.

GeneralRe: LPCWSTR Problem.? Pin
CPallini2-Jan-11 5:03
mveCPallini2-Jan-11 5:03 
GeneralRe: LPCWSTR Problem.? Pin
Stefan_Lang9-Jan-11 23:54
Stefan_Lang9-Jan-11 23:54 
GeneralRe: LPCWSTR Problem.? Pin
CPallini10-Jan-11 0:21
mveCPallini10-Jan-11 0:21 
GeneralRe: LPCWSTR Problem.? Pin
Stefan_Lang10-Jan-11 0:45
Stefan_Lang10-Jan-11 0:45 
GeneralRe: LPCWSTR Problem.? Pin
CPallini10-Jan-11 0:58
mveCPallini10-Jan-11 0:58 
GeneralRe: LPCWSTR Problem.? [modified] Pin
Stefan_Lang10-Jan-11 2:44
Stefan_Lang10-Jan-11 2:44 
AnswerRe: LPCWSTR Problem.? [updated] Pin
CPallini2-Jan-11 5:12
mveCPallini2-Jan-11 5:12 
GeneralRe: LPCWSTR Problem.? Pin
Sauro Viti2-Jan-11 5:39
professionalSauro Viti2-Jan-11 5:39 
GeneralRe: LPCWSTR Problem.? Pin
CPallini2-Jan-11 5:59
mveCPallini2-Jan-11 5:59 
GeneralRe: LPCWSTR Problem.? Pin
Sauro Viti2-Jan-11 6:03
professionalSauro Viti2-Jan-11 6:03 
GeneralRe: LPCWSTR Problem.? Pin
CPallini2-Jan-11 6:33
mveCPallini2-Jan-11 6:33 
GeneralRe: LPCWSTR Problem.? Pin
goldenrose94-Jan-11 0:11
goldenrose94-Jan-11 0:11 
GeneralRe: LPCWSTR Problem.? Pin
CPallini4-Jan-11 0:27
mveCPallini4-Jan-11 0:27 
AnswerRe: LPCWSTR Problem.? [modified] Pin
Stefan_Lang10-Jan-11 0:21
Stefan_Lang10-Jan-11 0:21 
QuestionAdding a reference to MFC Project.... Pin
AmbiguousName1-Jan-11 8:09
AmbiguousName1-Jan-11 8:09 
QuestionHow can I initialize an CListBox& null reference ? Pin
mesajflaviu1-Jan-11 4:57
mesajflaviu1-Jan-11 4:57 
AnswerRe: How can I initialize an CListBox& null reference ? Pin
BicycleTheif1-Jan-11 5:28
BicycleTheif1-Jan-11 5:28 

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.