Click here to Skip to main content
15,901,035 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Generalopening files from a program Pin
HackerBoy6-Jan-04 3:19
HackerBoy6-Jan-04 3:19 
GeneralRe: opening files from a program Pin
keegan6-Jan-04 3:57
keegan6-Jan-04 3:57 
GeneralRe: opening files from a program Pin
Michael Gunlock6-Jan-04 4:04
Michael Gunlock6-Jan-04 4:04 
GeneralRe: opening files from a program Pin
HackerBoy6-Jan-04 4:17
HackerBoy6-Jan-04 4:17 
GeneralRe: opening files from a program Pin
David Crow6-Jan-04 4:22
David Crow6-Jan-04 4:22 
GeneralWhich tool to use for detecting heap fragmentation Pin
Anonymous6-Jan-04 3:18
Anonymous6-Jan-04 3:18 
GeneralRe: Which tool to use for detecting heap fragmentation Pin
2249176-Jan-04 3:41
2249176-Jan-04 3:41 
GeneralRe: Difference of Floating Point Optimization in Fortran & C++ Pin
Patje6-Jan-04 2:53
Patje6-Jan-04 2:53 
GeneralCFileDialog & OLE DB template problem Pin
kjarzabek6-Jan-04 2:44
kjarzabek6-Jan-04 2:44 
GeneralRe: CFileDialog & OLE DB template problem Pin
godzooky6-Jan-04 7:05
godzooky6-Jan-04 7:05 
GeneralRe: CFileDialog & OLE DB template problem Pin
kjarzabek6-Jan-04 9:11
kjarzabek6-Jan-04 9:11 
GeneralRe: CFileDialog & OLE DB template problem Pin
kjarzabek6-Jan-04 10:27
kjarzabek6-Jan-04 10:27 
QuestionHow to hide DOS prompt?? Pin
Danny Chan6-Jan-04 2:42
Danny Chan6-Jan-04 2:42 
AnswerRe: How to hide DOS prompt?? Pin
David Crow6-Jan-04 2:44
David Crow6-Jan-04 2:44 
AnswerRe: How to hide DOS prompt?? Pin
Selvam R6-Jan-04 2:58
professionalSelvam R6-Jan-04 2:58 
GeneralRe: How to hide DOS prompt?? Pin
Hauptman(n)6-Jan-04 4:04
Hauptman(n)6-Jan-04 4:04 
AnswerRe: How to hide DOS prompt?? Pin
valikac6-Jan-04 6:33
valikac6-Jan-04 6:33 
AnswerRe: How to hide DOS prompt?? Pin
shultas6-Jan-04 15:30
shultas6-Jan-04 15:30 
GeneralRe: How to hide DOS prompt?? Pin
Danny Chan6-Jan-04 16:49
Danny Chan6-Jan-04 16:49 
GeneralRe: How to hide DOS prompt?? Pin
shultas6-Jan-04 17:52
shultas6-Jan-04 17:52 
GeneralRe: How to hide DOS prompt?? Pin
Danny Chan7-Jan-04 2:45
Danny Chan7-Jan-04 2:45 
Hi shultas

Thank you so much for your help. But i still got a small problem to trouble u again. Hope u dont mind. Cause after inserting what you had given to me, I got this error on the <shellexecuteinfo shexecinfo="{0};"> line. This is because the shellexecute is carried out in a few case function and i think this is why it give me these errors. Hence, is it possible for u to guide me for the one last time to solve this problem. Below is the portion of my program tat I insert the codes. Thank you so much for you help. Really appreciated.Smile | :)

switch(*selection)
{

case'1':

//AfxMessageBox(_T("Executing Case 1"));

SHELLEXECUTEINFO ShExecInfo = {0};
ShExecInfo.cbSize = sizeof(SHELLEXECUTEINFO);
ShExecInfo.fMask = SEE_MASK_NOCLOSEPROCESS;
ShExecInfo.hwnd = NULL;
ShExecInfo.lpVerb = NULL;
ShExecInfo.lpFile = "c:\\jpegtran.exe";
ShExecInfo.lpParameters = "-greyscale JPEG.jpg greyscale.jpg"; // --- THIS IS YOUR PARAMS!
ShExecInfo.lpDirectory = NULL;
ShExecInfo.nShow = SW_HIDE;
ShExecInfo.hInstApp = NULL;
ShellExecuteEx(&ShExecInfo);
WaitForSingleObject(ShExecInfo.hProcess,INFINITE);

//AfxMessageBox(_T("Opening greyscale images"));
imageFile2.Open( _T("C:\\FYP Test Folder\\best.jpg"), CFile::modeRead|CFile::typeBinary);
imageFile2.Read(image1, size.uintVal);
imageFile2.Close();

//AfxMessageBox(_T("Sending greyscale images"));
send(clientsock, (const char*) image1, size.uintVal, 0);
break;

The error message
error C2360: initialization of 'ShExecInfo' is skipped by 'case' label

cheers
Danny Chan
GeneralRe: How to hide DOS prompt?? Pin
shultas7-Jan-04 6:09
shultas7-Jan-04 6:09 
GeneralRe: How to hide DOS prompt?? Pin
Danny Chan7-Jan-04 15:22
Danny Chan7-Jan-04 15:22 
GeneralRe: How to hide DOS prompt?? Pin
Danny Chan7-Jan-04 16:42
Danny Chan7-Jan-04 16:42 
GeneralRe: How to hide DOS prompt?? Pin
shultas7-Jan-04 21:30
shultas7-Jan-04 21:30 

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.