Click here to Skip to main content
15,940,173 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionMemory allocation problem !!! Pin
Game-point3-Nov-09 1:13
Game-point3-Nov-09 1:13 
AnswerRe: Memory allocation problem !!! Pin
PrafullaShirke273-Nov-09 1:21
professionalPrafullaShirke273-Nov-09 1:21 
GeneralRe: Memory allocation problem !!! Pin
Game-point3-Nov-09 1:28
Game-point3-Nov-09 1:28 
GeneralRe: Memory allocation problem !!! Pin
PrafullaShirke273-Nov-09 1:38
professionalPrafullaShirke273-Nov-09 1:38 
QuestionRe: Memory allocation problem !!! Pin
CPallini3-Nov-09 1:54
mveCPallini3-Nov-09 1:54 
AnswerRe: Memory allocation problem !!! Pin
PrafullaShirke273-Nov-09 2:02
professionalPrafullaShirke273-Nov-09 2:02 
GeneralRe: Memory allocation problem !!! Pin
CPallini3-Nov-09 2:04
mveCPallini3-Nov-09 2:04 
GeneralRe: Memory allocation problem !!! Pin
CPallini3-Nov-09 2:03
mveCPallini3-Nov-09 2:03 
raju_Code wrote:
char **argv = NULL;
argv = (char**)malloc(3*sizeof(char*));
argv[0] = argv1[0];
argv[1] = (char*)malloc((20)*sizeof(char));
argv[1] = "D:\\Input.jpg";
::MessageBox(0,(LPWSTR)argv[1],(LPWSTR)"test",0);


What a mess! Try:

TCHAR * argv[3];
// here you may need a conversion if argv1 is an ANSI string 
argv[1] = _T("D:\\Input.jpg");
::MessageBox(0, argv[1],_T("test"),MB_OK);

Smile | :)

If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.

This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke

[My articles]

QuestionRe: Memory allocation problem !!! Pin
David Crow3-Nov-09 3:08
David Crow3-Nov-09 3:08 
Questionhow to insert data in sqlserver 2005 using vc++6.0 Pin
eswar pothula2-Nov-09 22:56
eswar pothula2-Nov-09 22:56 
AnswerRe: how to insert data in sqlserver 2005 using vc++6.0 [modified] Pin
super2-Nov-09 23:08
professionalsuper2-Nov-09 23:08 
AnswerRe: how to insert data in sqlserver 2005 using vc++6.0 Pin
CPallini2-Nov-09 23:15
mveCPallini2-Nov-09 23:15 
QuestionMaking an Application Hang. Pin
Hari_162-Nov-09 22:52
Hari_162-Nov-09 22:52 
AnswerRe: Making an Application Hang. Pin
CPallini2-Nov-09 22:57
mveCPallini2-Nov-09 22:57 
GeneralRe: Making an Application Hang. Pin
Hari_162-Nov-09 23:01
Hari_162-Nov-09 23:01 
GeneralRe: Making an Application Hang. Pin
Adam Roderick J2-Nov-09 23:06
Adam Roderick J2-Nov-09 23:06 
GeneralRe: Making an Application Hang. Pin
Hari_162-Nov-09 23:12
Hari_162-Nov-09 23:12 
GeneralRe: Making an Application Hang. Pin
Adam Roderick J2-Nov-09 23:47
Adam Roderick J2-Nov-09 23:47 
GeneralRe: Making an Application Hang. Pin
Rajesh R Subramanian2-Nov-09 23:58
professionalRajesh R Subramanian2-Nov-09 23:58 
GeneralRe: Making an Application Hang. [modified] Pin
CPallini2-Nov-09 23:17
mveCPallini2-Nov-09 23:17 
GeneralRe: Making an Application Hang. Pin
Hari_162-Nov-09 23:56
Hari_162-Nov-09 23:56 
JokeRe: Making an Application Hang. Pin
PrafullaShirke272-Nov-09 22:57
professionalPrafullaShirke272-Nov-09 22:57 
GeneralRe: Making an Application Hang. Pin
Hari_162-Nov-09 22:59
Hari_162-Nov-09 22:59 
AnswerRe: Making an Application Hang. Pin
Rajesh R Subramanian2-Nov-09 23:47
professionalRajesh R Subramanian2-Nov-09 23:47 
GeneralRe: Making an Application Hang. Pin
Hari_162-Nov-09 23:58
Hari_162-Nov-09 23:58 

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.