Click here to Skip to main content
15,911,139 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Dialog help needed Pin
BlitzPackage12-Nov-06 15:01
BlitzPackage12-Nov-06 15:01 
GeneralRe: Dialog help needed [modified] Pin
locoone12-Nov-06 16:41
locoone12-Nov-06 16:41 
GeneralRe: Dialog help needed Pin
BlitzPackage12-Nov-06 17:55
BlitzPackage12-Nov-06 17:55 
GeneralRe: Dialog help needed Pin
locoone12-Nov-06 17:57
locoone12-Nov-06 17:57 
AnswerRe: Dialog help needed Pin
BlitzPackage12-Nov-06 15:04
BlitzPackage12-Nov-06 15:04 
Questionmshflexgrid problem Pin
Tarek Jabri12-Nov-06 3:22
Tarek Jabri12-Nov-06 3:22 
AnswerRe: mshflexgrid problem Pin
S Douglas13-Nov-06 21:59
professionalS Douglas13-Nov-06 21:59 
QuestionMalloc fails...why? Pin
damir_tk12-Nov-06 2:30
damir_tk12-Nov-06 2:30 
I don't understand why this fails:

LPTSTR FileHelper::GetFileFullPath( LPWSTR lpwName )
{
LPTSTR lptFileFullPath;

DWORD len = GetCurrentDirectory( 0, NULL );

LPWSTR lpwFolder;
lpwFolder = (LPWSTR) malloc( len );

if ( lpwFolder == NULL )
{
free ( lpwFolder );
return NULL;
}

if ( GetCurrentDirectory( len, lpwFolder ) != 0 )
{
len = (DWORD) ( wcslen( lpwFolder ) + wcslen( lpwName ) + 6 );

lptFileFullPath = (LPTSTR) malloc( len );

// Here lptFileFullPath simply evaluates to NULL, showing the <bad ptr=""> ?!
if ( lptFileFullPath == NULL )
{
free ( lptFileFullPath );
return NULL;
}

// ...the rest of the code stripped off...
}

return lptFileFullPath;
}

This is under Visual Studio 2005, UNICODE defined by default.

Thanks.


AnswerRe: Malloc fails...why? Pin
Taka Muraoka12-Nov-06 2:36
Taka Muraoka12-Nov-06 2:36 
AnswerRe: Malloc fails...why? Pin
Waldermort12-Nov-06 4:22
Waldermort12-Nov-06 4:22 
GeneralRe: Malloc fails...why? Pin
damir_tk12-Nov-06 9:50
damir_tk12-Nov-06 9:50 
AnswerRe: Malloc fails...why? Pin
Mark Salsbery12-Nov-06 8:33
Mark Salsbery12-Nov-06 8:33 
GeneralRe: Malloc fails...why? Pin
damir_tk12-Nov-06 9:55
damir_tk12-Nov-06 9:55 
GeneralRe: Malloc fails...why? Pin
Mark Salsbery12-Nov-06 10:27
Mark Salsbery12-Nov-06 10:27 
GeneralRe: Malloc fails...why? Pin
damir_tk12-Nov-06 10:42
damir_tk12-Nov-06 10:42 
Questionproblem with colour the radio &amp; check box in property page [modified] Pin
vikas amin12-Nov-06 0:54
vikas amin12-Nov-06 0:54 
AnswerRe: problem with colour the radio &amp; check box in property page Pin
Rajesh R Subramanian12-Nov-06 19:39
professionalRajesh R Subramanian12-Nov-06 19:39 
GeneralRe: problem with colour the radio &amp; check box in property page Pin
vikas amin12-Nov-06 20:21
vikas amin12-Nov-06 20:21 
GeneralRe: problem with colour the radio &amp; check box in property page Pin
Rajesh R Subramanian12-Nov-06 20:43
professionalRajesh R Subramanian12-Nov-06 20:43 
GeneralRe: problem with colour the radio &amp; check box in property page Pin
vikas amin12-Nov-06 21:14
vikas amin12-Nov-06 21:14 
Question"How can I pass jbyte * from C++ to VB" Pin
Orchid8512-Nov-06 0:46
Orchid8512-Nov-06 0:46 
Questioninterface in background Pin
Johpoke12-Nov-06 0:42
Johpoke12-Nov-06 0:42 
AnswerRe: interface in background Pin
Sceptic Mole12-Nov-06 6:16
Sceptic Mole12-Nov-06 6:16 
AnswerRe: interface in background Pin
Mike_V12-Nov-06 15:10
Mike_V12-Nov-06 15:10 
GeneralRe: interface in background Pin
Johpoke13-Nov-06 8:17
Johpoke13-Nov-06 8:17 

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.