Click here to Skip to main content
15,909,530 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: How do i do Unit testing for C programming in visual studio Pin
mohant$.net8-Sep-09 20:56
mohant$.net8-Sep-09 20:56 
GeneralRe: How do i do Unit testing for C programming in visual studio Pin
CPallini8-Sep-09 21:00
mveCPallini8-Sep-09 21:00 
AnswerRe: How do i do Unit testing for C programming in visual studio Pin
David Crow9-Sep-09 3:27
David Crow9-Sep-09 3:27 
AnswerRe: How do i do Unit testing for C programming in visual studio Pin
Rick York9-Sep-09 11:28
mveRick York9-Sep-09 11:28 
Questiontrying to access functions in a dll created in VB Pin
BigCTD8-Sep-09 10:14
BigCTD8-Sep-09 10:14 
AnswerRe: trying to access functions in a dll created in VB Pin
CPallini8-Sep-09 11:23
mveCPallini8-Sep-09 11:23 
AnswerRe: trying to access functions in a dll created in VB Pin
ThatsAlok8-Sep-09 21:14
ThatsAlok8-Sep-09 21:14 
Questionsql: insert into ... mixed with english and unicode fields Pin
includeh108-Sep-09 8:01
includeh108-Sep-09 8:01 
NewsUnit testing framework cfix 1.5 released; adds support for EXE targets and kernel mode multithreading Pin
J. Passing8-Sep-09 7:26
J. Passing8-Sep-09 7:26 
GeneralPublish an RTMP stream to FMS using Microrosft Visual C Pin
mseureka8-Sep-09 6:47
mseureka8-Sep-09 6:47 
GeneralRe: Publish an RTMP stream to FMS using Microrosft Visual C Pin
farnhamj12-Sep-09 14:32
farnhamj12-Sep-09 14:32 
GeneralRe: Publish an RTMP stream to FMS using Microrosft Visual C Pin
Sumit_Ghosh16-Sep-09 8:34
Sumit_Ghosh16-Sep-09 8:34 
GeneralRe: Publish an RTMP stream to FMS using Microrosft Visual C Pin
Jon68z16-Oct-09 8:36
Jon68z16-Oct-09 8:36 
GeneralRe: Publish an RTMP stream to FMS using Microrosft Visual C Pin
Gavriloaie Andrei7-Nov-09 2:21
Gavriloaie Andrei7-Nov-09 2:21 
GeneralRe: Publish an RTMP stream to FMS using Microrosft Visual C Pin
Jon68z7-Nov-09 16:15
Jon68z7-Nov-09 16:15 
GeneralRe: Publish an RTMP stream to FMS using Microrosft Visual C Pin
Gavriloaie Andrei7-Nov-09 16:30
Gavriloaie Andrei7-Nov-09 16:30 
GeneralRe: Publish an RTMP stream to FMS using Microrosft Visual C Pin
Jon68z7-Nov-09 16:50
Jon68z7-Nov-09 16:50 
QuestionImplicit conversion from char * to string: g++ vs VS Pin
dplong8-Sep-09 6:40
dplong8-Sep-09 6:40 
AnswerRe: Implicit conversion from char * to string: g++ vs VS Pin
Stuart Dootson8-Sep-09 10:24
professionalStuart Dootson8-Sep-09 10:24 
QuestionVC++ MFC Strlen [modified] Pin
GC1048-Sep-09 4:09
GC1048-Sep-09 4:09 
QuestionRe: VC++ MFC Strlen Pin
David Crow8-Sep-09 4:39
David Crow8-Sep-09 4:39 
AnswerRe: VC++ MFC Strlen Pin
GC1048-Sep-09 4:52
GC1048-Sep-09 4:52 
AnswerRe: VC++ MFC Strlen Pin
Stuart Dootson8-Sep-09 4:51
professionalStuart Dootson8-Sep-09 4:51 
GeneralRe: VC++ MFC Strlen Pin
GC1048-Sep-09 4:59
GC1048-Sep-09 4:59 
GeneralRe: VC++ MFC Strlen Pin
Stuart Dootson8-Sep-09 5:17
professionalStuart Dootson8-Sep-09 5:17 
Easy one first:

GC104 wrote:
Sprintf(BasicString, "ABCDDEF") : Bad because I haven't initialised it as soon as I declared it? or the fact that I'm using sprintf to load the string?


Bad because it wasn't char BasicString[100]; when I answered the question - it was (IIRC) char* BasicString Smile | :)

Also - sprintf is less than optimal for assigning a string to another string - strcpy is better, I guess.

GC104 wrote:
Any suggestions for an alternative to CW2A macro?


CW2A isn't a macro. It's a class. There are a few alternatives:

  1. Make sure that pOutputString has storage associated with it and strcpy the CW2A into it:
    char pOutputString[1024];
    strcpy(pOutputString, CW2A(TxString));
    
  2. Declare pOutputString to be of type CW2A and assign TXString to it. THat way the storage is associated with the lifetime of pOutputString, which is what you want:
    CW2A pOutputString = TxString;
  3. Declare pOutputString to be of some other ASCII string type and assign CW2A(TXString) to it. That way there is storage associated with the lifetime of pOutputString, which is what you want:
    std::string pOutputString = CW2A(TxString);


I'd go for option 2, personally.

Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p

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.