Click here to Skip to main content
11,647,170 members (70,020 online)

C / C++ / MFC

 
QuestionRe: Read binary File Pin
DavidCrow29-Nov-12 2:37
memberDavidCrow29-Nov-12 2:37 
Questionextracting resources from an exe for translation Pin
chronodekar28-Nov-12 21:28
memberchronodekar28-Nov-12 21:28 
AnswerRe: extracting resources from an exe for translation Pin
Mattias G3-Dec-12 22:24
memberMattias G3-Dec-12 22:24 
Questioncompile code twice,why the two result is differrent Pin
yingkou28-Nov-12 21:10
memberyingkou28-Nov-12 21:10 
AnswerRe: compile code twice,why the two result is differrent Pin
Stefan_Lang28-Nov-12 22:31
memberStefan_Lang28-Nov-12 22:31 
AnswerRe: compile code twice,why the two result is differrent Pin
Stephen Hewitt29-Nov-12 0:42
memberStephen Hewitt29-Nov-12 0:42 
AnswerRe: compile code twice,why the two result is differrent Pin
sajeesh.c30-Nov-12 18:28
membersajeesh.c30-Nov-12 18:28 
AnswerRe: compile code twice,why the two result is differrent Pin
Cristian Amarie3-Dec-12 8:55
memberCristian Amarie3-Dec-12 8:55 
QuestionCListCtrl Pin
sarfaraznawaz28-Nov-12 21:07
membersarfaraznawaz28-Nov-12 21:07 
AnswerRe: CListCtrl Pin
Jochen Arndt28-Nov-12 21:30
memberJochen Arndt28-Nov-12 21:30 
QuestionLong pointer to character C++ Pin
pix_programmer28-Nov-12 4:41
memberpix_programmer28-Nov-12 4:41 
GeneralRe: Long pointer to character C++ Pin
DavidCrow28-Nov-12 5:19
memberDavidCrow28-Nov-12 5:19 
AnswerRe: Long pointer to character C++ Pin
Richard MacCutchan28-Nov-12 5:20
mvpRichard MacCutchan28-Nov-12 5:20 
AnswerRe: Long pointer to character C++ Pin
Stefan_Lang28-Nov-12 6:07
memberStefan_Lang28-Nov-12 6:07 
pix_programmer wrote:
I'm reading some string from a XML file and assigning it to a <code>const char*</code> variable.

That doesn't make sense. A pointer can only be sensibly initialized within the program, at runtime, because only then does the computer know where in memeory every object lies. Therefore it doesn't make sense to either store or restore a pointer to/from a file!

What you need to do instead is:
1. read that string from your file
2. Allocate a char array on the heap that is big enough to contain that string (including the terminating NULL character!)
3. Assign that array to your pointer
4. Store the string in that char array.

Of course, if you use std::string, that would save you some of that efort.
GeneralRe: Long pointer to character C++ Pin
DavidCrow28-Nov-12 7:56
memberDavidCrow28-Nov-12 7:56 
GeneralRe: Long pointer to character C++ Pin
Stefan_Lang28-Nov-12 22:03
memberStefan_Lang28-Nov-12 22:03 
AnswerRe: Long pointer to character C++ Pin
CPallini28-Nov-12 7:48
mvpCPallini28-Nov-12 7:48 
AnswerRe: Long pointer to character C++ Pin
sajeesh.c30-Nov-12 18:35
membersajeesh.c30-Nov-12 18:35 
AnswerRe: Long pointer to character C++ Pin
April Fans13-Dec-12 18:06
memberApril Fans13-Dec-12 18:06 
Questionproblem in c with linux Pin
a1_shay28-Nov-12 2:23
membera1_shay28-Nov-12 2:23 
AnswerRe: problem in c with linux Pin
CPallini28-Nov-12 3:07
mvpCPallini28-Nov-12 3:07 
SuggestionRe: problem in c with linux Pin
Richard MacCutchan28-Nov-12 3:11
mvpRichard MacCutchan28-Nov-12 3:11 
GeneralRe: problem in c with linux Pin
a1_shay28-Nov-12 21:35
membera1_shay28-Nov-12 21:35 
GeneralRe: problem in c with linux Pin
Richard MacCutchan28-Nov-12 23:04
mvpRichard MacCutchan28-Nov-12 23:04 
AnswerRe: problem in c with linux Pin
sajeesh.c30-Nov-12 18:40
membersajeesh.c30-Nov-12 18:40 
QuestionMerging Arrays Pin
pix_programmer27-Nov-12 21:57
memberpix_programmer27-Nov-12 21:57 
AnswerRe: Merging Arrays Pin
Andy41127-Nov-12 22:48
memberAndy41127-Nov-12 22:48 
AnswerRe: Merging Arrays Pin
CPallini27-Nov-12 23:09
mvpCPallini27-Nov-12 23:09 
JokeRe: Merging Arrays Pin
Richard MacCutchan27-Nov-12 23:45
mvpRichard MacCutchan27-Nov-12 23:45 
JokeRe: Merging Arrays Pin
CPallini27-Nov-12 23:58
mvpCPallini27-Nov-12 23:58 
GeneralRe: Merging Arrays Pin
DavidCrow28-Nov-12 5:36
memberDavidCrow28-Nov-12 5:36 
AnswerRe: Merging Arrays Pin
Stefan_Lang28-Nov-12 2:45
memberStefan_Lang28-Nov-12 2:45 
AnswerRe: Merging Arrays Pin
sajeesh.c30-Nov-12 18:47
membersajeesh.c30-Nov-12 18:47 
QuestionHow to use ribbon in MFC Activex control Pin
Lamourou27-Nov-12 20:23
memberLamourou27-Nov-12 20:23 
AnswerRe: How to use ribbon in MFC Activex control Pin
Richard MacCutchan27-Nov-12 23:44
mvpRichard MacCutchan27-Nov-12 23:44 
GeneralMessage Removed Pin
Lamourou28-Nov-12 0:26
memberLamourou28-Nov-12 0:26 
GeneralRe: How to use ribbon in MFC Activex control Pin
Richard MacCutchan28-Nov-12 1:10
mvpRichard MacCutchan28-Nov-12 1:10 
Questionhow to use more than one rc file in vc6 project at the same time when compiling project Pin
yingkou27-Nov-12 19:59
memberyingkou27-Nov-12 19:59 
AnswerRe: how to use more than one rc file in vc6 project at the same time when compiling project Pin
Richard MacCutchan27-Nov-12 23:42
mvpRichard MacCutchan27-Nov-12 23:42 
GeneralRe: how to use more than one rc file in vc6 project at the same time when compiling project Pin
yingkou28-Nov-12 14:35
memberyingkou28-Nov-12 14:35 
AnswerRe: how to use more than one rc file in vc6 project at the same time when compiling project Pin
DavidCrow28-Nov-12 17:33
memberDavidCrow28-Nov-12 17:33 
AnswerRe: how to use more than one rc file in vc6 project at the same time when compiling project Pin
Freak3028-Nov-12 23:33
memberFreak3028-Nov-12 23:33 
Questiontransparency in 32bit bmp in vs2010 Pin
yogeshs27-Nov-12 19:21
memberyogeshs27-Nov-12 19:21 
AnswerRe: transparency in 32bit bmp in vs2010 Pin
Hadi Dayvary27-Nov-12 21:42
memberHadi Dayvary27-Nov-12 21:42 
GeneralRe: transparency in 32bit bmp in vs2010 Pin
yogeshs27-Nov-12 23:11
memberyogeshs27-Nov-12 23:11 
GeneralRe: transparency in 32bit bmp in vs2010 Pin
Hadi Dayvary28-Nov-12 0:00
memberHadi Dayvary28-Nov-12 0:00 
QuestionHow To Use Macro In dsp file(VC6.0 *.dsp file) Pin
yingkou27-Nov-12 14:59
memberyingkou27-Nov-12 14:59 
SuggestionRe: How To Use Macro In dsp file(VC6.0 *.dsp file) Pin
Albert Holguin27-Nov-12 16:30
memberAlbert Holguin27-Nov-12 16:30 
GeneralRe: How To Use Macro In dsp file(VC6.0 *.dsp file) Pin
yingkou28-Nov-12 21:50
memberyingkou28-Nov-12 21:50 
GeneralRe: How To Use Macro In dsp file(VC6.0 *.dsp file) Pin
Albert Holguin29-Nov-12 4:55
memberAlbert Holguin29-Nov-12 4:55 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Advertise | Privacy | Mobile
Web01 | 2.8.150804.2 | Last Updated 4 Aug 2015
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid