Click here to Skip to main content
15,922,512 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionHow to say a pointer has pointed to NULL in an application rather than just crashing? Pin
wilche9-Oct-02 18:19
wilche9-Oct-02 18:19 
AnswerRe: How to say a pointer has pointed to NULL in an application rather than just crashing? Pin
Todd Smith9-Oct-02 18:58
Todd Smith9-Oct-02 18:58 
Questionbest DB method? Pin
bryce9-Oct-02 16:12
bryce9-Oct-02 16:12 
AnswerRe: best DB method? Pin
Christian Graus9-Oct-02 16:52
protectorChristian Graus9-Oct-02 16:52 
GeneralRe: best DB method? Pin
bryce9-Oct-02 17:21
bryce9-Oct-02 17:21 
GeneralBYTE to CString Pin
stevenson9-Oct-02 15:11
stevenson9-Oct-02 15:11 
GeneralRe: BYTE to CString Pin
Chris Losinger9-Oct-02 15:43
professionalChris Losinger9-Oct-02 15:43 
GeneralCStrings in MFC/ATL/Whatever 7.0 Pin
me9-Oct-02 15:01
me9-Oct-02 15:01 
I was looking at converting a project from VC6 to VC7.
Deep in the code something like this happens:


LPCTSTR szDesc; is passed into a function,

CString *pstrDesc = new CString();
...
...
(*pstrDesc) = szDesc;

This runs fine in VC6, but the memory management class in VC7 passes null pointers, which promptly crash.

I can find lots of info about how the CString class has changed, but nothing about how/whether code should be rewriiten/changed to deal with th new implementation.

Can anyone help with a fix/workaround? There are an awful lot of CStrings to convert to TCHARS before we can justify an upgrade to .net!!!!

Hugh
GeneralRe: CStrings in MFC/ATL/Whatever 7.0 Pin
Chris Losinger9-Oct-02 15:44
professionalChris Losinger9-Oct-02 15:44 
GeneralRe: CStrings in MFC/ATL/Whatever 7.0 Pin
me9-Oct-02 15:57
me9-Oct-02 15:57 
GeneralRe: CStrings in MFC/ATL/Whatever 7.0 Pin
Joe Woodbury9-Oct-02 20:04
professionalJoe Woodbury9-Oct-02 20:04 
GeneralRe: CStrings in MFC/ATL/Whatever 7.0 Pin
me9-Oct-02 21:22
me9-Oct-02 21:22 
GeneralRe: CStrings in MFC/ATL/Whatever 7.0 Pin
Joe Woodbury9-Oct-02 22:01
professionalJoe Woodbury9-Oct-02 22:01 
GeneralMultidimensional array Pin
Todd Smith9-Oct-02 12:52
Todd Smith9-Oct-02 12:52 
GeneralRe: Multidimensional array Pin
Jörgen Sigvardsson9-Oct-02 13:50
Jörgen Sigvardsson9-Oct-02 13:50 
GeneralRe: Multidimensional array Pin
Michael Dunn9-Oct-02 13:51
sitebuilderMichael Dunn9-Oct-02 13:51 
GeneralTemplate Q Pin
Todd Smith9-Oct-02 12:24
Todd Smith9-Oct-02 12:24 
GeneralRe: Template Q Pin
Paul M Watt9-Oct-02 12:58
mentorPaul M Watt9-Oct-02 12:58 
GeneralRe: Template Q Pin
Jörgen Sigvardsson9-Oct-02 13:56
Jörgen Sigvardsson9-Oct-02 13:56 
Generalaccesing the registry Pin
Loin Chiviki9-Oct-02 11:15
sussLoin Chiviki9-Oct-02 11:15 
GeneralRe: accesing the registry Pin
Ranjan Banerji9-Oct-02 11:21
Ranjan Banerji9-Oct-02 11:21 
GeneralRe: accesing the registry Pin
Carlos Antollini9-Oct-02 11:43
Carlos Antollini9-Oct-02 11:43 
GeneralThis is wierd regarding MSFlexgrid licensing... Pin
JohnnyG9-Oct-02 11:08
JohnnyG9-Oct-02 11:08 
GeneralBoehm framework Pin
S van Leent9-Oct-02 11:05
S van Leent9-Oct-02 11:05 
GeneralRe: Boehm framework Pin
Joaquín M López Muñoz9-Oct-02 11:26
Joaquín M López Muñoz9-Oct-02 11:26 

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.