Click here to Skip to main content
15,902,784 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionHow to select Landscape button as a default in PageSetupDialog Pin
pubududilena12-Jul-04 1:52
pubududilena12-Jul-04 1:52 
Generalusb Pin
Ni@m12-Jul-04 1:40
Ni@m12-Jul-04 1:40 
GeneralRe: usb Pin
Claudius Mokler12-Jul-04 2:13
Claudius Mokler12-Jul-04 2:13 
GeneralRe: usb Pin
Ni@m12-Jul-04 2:30
Ni@m12-Jul-04 2:30 
GeneralRe: usb Pin
eggie512-Jul-04 13:30
eggie512-Jul-04 13:30 
Generalsocket Pin
shahrokh nabavi12-Jul-04 1:25
shahrokh nabavi12-Jul-04 1:25 
GeneralRe: socket Pin
ThatsAlok12-Jul-04 3:43
ThatsAlok12-Jul-04 3:43 
GeneralRunning a Batch file Froma a Program Pin
sweep12312-Jul-04 0:48
sweep12312-Jul-04 0:48 
Have I got this scheme right for running a scripting batch file from my program.

The program that is associated with the batch file is CSL.EXE and the following procedure will run when the selected TreeView file is double clicked:-

void CScriptingDlg::OnNMDblclkTree1(NMHDR *pNMHDR, LRESULT *pResult)<br />
{<br />
   BOOL bSuccess = FALSE;<br />
    SHELLEXECUTEINFO sei;<br />
    ZeroMemory(&sei,sizeof(sei));<br />
    sei.cbSize = sizeof(sei);<br />
    sei.hwnd = AfxGetMainWnd()->GetSafeHwnd();<br />
    sei.nShow = SW_SHOW;<br />
    sei.lpFile = m_strPath.GetBuffer(m_strPath.GetLength());<br />
    sei.fMask  = SEE_MASK_INVOKEIDLIST;<br />
    bSuccess = ShellExecuteEx(&sei);<br />
    m_strPath.ReleaseBuffer();<br />
}


m_strPath is the full path name of the batch file; e.g. C:\Work\ABC.CSL.

The reason for this post is, if I double click a CSL batch file (i.e. C:\Work\ABC.CSL) from Window Explorer the CSL program runs OK, but if I do the same from within my program a DOS Window appears for a second then closes. The batch files appears not to have run.
So is this the correct way to do this?

Sweep123
GeneralRe: Running a Batch file Froma a Program Pin
David Crow12-Jul-04 5:58
David Crow12-Jul-04 5:58 
GeneralRe: Running a Batch file Froma a Program Pin
sweep12312-Jul-04 6:49
sweep12312-Jul-04 6:49 
GeneralRe: Running a Batch file Froma a Program Pin
David Crow12-Jul-04 9:07
David Crow12-Jul-04 9:07 
GeneralRe: Running a Batch file Froma a Program Pin
sweep12312-Jul-04 23:12
sweep12312-Jul-04 23:12 
GeneralHighlight a listctrl Item Pin
Zeeshan Bilal12-Jul-04 0:38
Zeeshan Bilal12-Jul-04 0:38 
GeneralRe: Highlight a listctrl Item Pin
David Crow12-Jul-04 2:31
David Crow12-Jul-04 2:31 
GeneralNew Project Ideas Pin
Leyu12-Jul-04 0:29
Leyu12-Jul-04 0:29 
GeneralRe: New Project Ideas Pin
ThatsAlok12-Jul-04 0:56
ThatsAlok12-Jul-04 0:56 
GeneralRe: New Project Ideas Pin
Michael P Butler12-Jul-04 2:33
Michael P Butler12-Jul-04 2:33 
GeneralRe: New Project Ideas Pin
Leyu12-Jul-04 5:12
Leyu12-Jul-04 5:12 
QuestionHow to trap file reading and writing in Shared Folder over Network? Pin
wangdave12-Jul-04 0:15
wangdave12-Jul-04 0:15 
AnswerRe: How to trap file reading and writing in Shared Folder over Network? Pin
David Crow12-Jul-04 2:41
David Crow12-Jul-04 2:41 
GeneralCoCreateInstanceEx Fails Pin
Member 11790412-Jul-04 0:10
Member 11790412-Jul-04 0:10 
GeneralAsynch Serial Comms Pin
louis11-Jul-04 23:59
louis11-Jul-04 23:59 
GeneralRe: Asynch Serial Comms Pin
palbano12-Jul-04 5:00
palbano12-Jul-04 5:00 
GeneralRe: Asynch Serial Comms Pin
louis12-Jul-04 21:42
louis12-Jul-04 21:42 
GeneralFile delete dialog Pin
Anonymous11-Jul-04 23:25
Anonymous11-Jul-04 23:25 

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.