Click here to Skip to main content
15,897,718 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: c++ win32, Trouble getting CreateThread and CreateProcess running together Pin
jkirkerx25-Jan-12 9:56
professionaljkirkerx25-Jan-12 9:56 
GeneralRe: c++ win32, Trouble getting CreateThread and CreateProcess running together Pin
Richard Andrew x6425-Jan-12 9:59
professionalRichard Andrew x6425-Jan-12 9:59 
GeneralRe: c++ win32, Trouble getting CreateThread and CreateProcess running together Pin
jkirkerx25-Jan-12 10:04
professionaljkirkerx25-Jan-12 10:04 
QuestionRe: c++ win32, Trouble getting CreateThread and CreateProcess running together Pin
CPallini25-Jan-12 10:12
mveCPallini25-Jan-12 10:12 
AnswerRe: c++ win32, Trouble getting CreateThread and CreateProcess running together Pin
jkirkerx25-Jan-12 10:47
professionaljkirkerx25-Jan-12 10:47 
GeneralDone Pin
jkirkerx25-Jan-12 11:28
professionaljkirkerx25-Jan-12 11:28 
QuestionSHFileOperation with SHFILEOPSTRUCT fails when used with vars but works with string literals Pin
bcb_guy25-Jan-12 1:06
bcb_guy25-Jan-12 1:06 
AnswerRe: SHFileOperation with SHFILEOPSTRUCT fails when used with vars but works with string literals Pin
Jochen Arndt25-Jan-12 1:55
professionalJochen Arndt25-Jan-12 1:55 
1. You are adding additional NULL chars to your char source strings, but the converted wide char strings have no NULL terminators (passing false as second parameter to CharArrayToWideCharArray). So these are not strings, but arrays without NULL terminators. Therefore, wcslen can't be used with these strings.

2. You are passing wcslen(wcDest) to MultiByteToWideChar, but wcDest has just been allocated and is not initialized!

So remove the Nullify parameter and always create a null terminated string:
C++
wchar_t *CharArrayToWideCharArray(const char *cSource)
{
    size_t nSize = strlen(cSource) + 1;
    // You may also calculate the length of the wide char string:
//  int nWideSize = MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, cSource, nSize, NULL, 0);
    wchar_t *wcDest = new wchar_t[nSize];
    MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, cSource, nSize, wcDest, nSize);
    return wcDest;
}

AnswerRe: SHFileOperation with SHFILEOPSTRUCT fails when used with vars but works with string literals Pin
Richard Andrew x6425-Jan-12 2:06
professionalRichard Andrew x6425-Jan-12 2:06 
AnswerIssue Resolved! (Of Course User Error) Pin
bcb_guy25-Jan-12 17:41
bcb_guy25-Jan-12 17:41 
GeneralRe: Issue Resolved! (Of Course User Error) Pin
Jochen Arndt25-Jan-12 21:20
professionalJochen Arndt25-Jan-12 21:20 
GeneralRe: Issue Resolved! (Of Course User Error) Pin
bcb_guy25-Jan-12 23:29
bcb_guy25-Jan-12 23:29 
GeneralRe: Issue Resolved! (Of Course User Error) Pin
David Crow26-Jan-12 3:06
David Crow26-Jan-12 3:06 
QuestionGet the local drives, scan and retrieve files using visual c++ Pin
amabi25-Jan-12 0:43
amabi25-Jan-12 0:43 
AnswerRe: Get the local drives, scan and retrieve files using visual c++ Pin
David Crow25-Jan-12 3:01
David Crow25-Jan-12 3:01 
QuestionXML Data To C++ Objects Pin
002comp24-Jan-12 22:24
002comp24-Jan-12 22:24 
AnswerRe: XML Data To C++ Objects Pin
Rolf Kristensen26-Jan-12 20:20
Rolf Kristensen26-Jan-12 20:20 
QuestionHow to check if an internet connection exist ? Pin
_Flaviu24-Jan-12 1:13
_Flaviu24-Jan-12 1:13 
AnswerRe: How to check if an internet connection exist ? Pin
Rajesh R Subramanian24-Jan-12 2:07
professionalRajesh R Subramanian24-Jan-12 2:07 
Questionusing extern in C Pin
Sakhalean23-Jan-12 22:53
Sakhalean23-Jan-12 22:53 
AnswerRe: using extern in C Pin
Jochen Arndt23-Jan-12 23:09
professionalJochen Arndt23-Jan-12 23:09 
GeneralRe: using extern in C Pin
Sakhalean23-Jan-12 23:32
Sakhalean23-Jan-12 23:32 
GeneralRe: using extern in C Pin
Jochen Arndt23-Jan-12 23:41
professionalJochen Arndt23-Jan-12 23:41 
AnswerRe: using extern in C Pin
Erudite_Eric24-Jan-12 5:33
Erudite_Eric24-Jan-12 5:33 
AnswerRe: using extern in C Pin
Stefan_Lang24-Jan-12 5:50
Stefan_Lang24-Jan-12 5:50 

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.