Click here to Skip to main content
16,012,316 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: binary contents in a CString Pin
Andrew Quinn AUS21-May-04 22:57
Andrew Quinn AUS21-May-04 22:57 
GeneralRe: binary contents in a CString Pin
Prakash Nadar22-May-04 2:10
Prakash Nadar22-May-04 2:10 
GeneralRe: binary contents in a CString Pin
Gary R. Wheeler23-May-04 12:35
Gary R. Wheeler23-May-04 12:35 
GeneralRe: binary contents in a CString Pin
(Steven Hicks)n+123-May-04 13:06
(Steven Hicks)n+123-May-04 13:06 
General32 bpp images w/ controls Pin
alex.barylski21-May-04 16:39
alex.barylski21-May-04 16:39 
GeneralRe: 32 bpp images w/ controls Pin
Prakash Nadar21-May-04 16:43
Prakash Nadar21-May-04 16:43 
GeneralRe: 32 bpp images w/ controls Pin
John R. Shaw22-May-04 17:14
John R. Shaw22-May-04 17:14 
GeneralExecute program QU Pin
DNFSB21-May-04 15:47
DNFSB21-May-04 15:47 
Hey,

Im working on a menu-type dialog-based program. Basically, the user can select a button and it'll run a program. The user can define what program to run by clicking Browse for each button.

What I have is a dialog box with 2 buttons, Run "CFloatDlg::OnRun()", and App1 "CFloatDlg::OnApp1()". Here is my code:

void CFloatDlg::OnApp1()
{
CFileDialog fd(TRUE,"exe",NULL,OFN_HIDEREADONLY,
"Programs (*.exe)|*.exe|All Files (*.*)|*.*||",this);

if (fd.DoModal() == IDOK)
{
m_sFilename = fd.GetPathName();
UpdateData(FALSE);
}
}

void CFloatDlg::OnRun()
{
_execlp(m_sFilename, NULL);
}


When the user clicks the App1 button, the open commondialog opens and the user can select an .exe. Then the user clicks run, and the program is executed. The program itself also closes.

How can I make the program save, (internal or external), what the user has selected so that the program selected will be there each and everytime until the user changes it? Also, how can I make it so that the dialog does not close when another program is executed from it?

P.S.: I just wanted to thank everyone for all their work and time here. I've been quiet here, but I love all the code. Everyone is doing awesome work. I do plan on providing back to the community with my own code soon. Thanks to all.

DNFSB
GeneralRe: Execute program QU Pin
Prakash Nadar21-May-04 16:41
Prakash Nadar21-May-04 16:41 
GeneralRe: Execute program QU Pin
DNFSB22-May-04 14:26
DNFSB22-May-04 14:26 
GeneralUser created menu, using New Selection. Pin
Eversman21-May-04 14:19
Eversman21-May-04 14:19 
QuestionCapturing keyboard input from inside a background WMP9 COM plugin? Pin
IGx8921-May-04 13:47
IGx8921-May-04 13:47 
AnswerRe: Capturing keyboard input from inside a background WMP9 COM plugin? Pin
Michael Dunn21-May-04 14:06
sitebuilderMichael Dunn21-May-04 14:06 
GeneralRe: Capturing keyboard input from inside a background WMP9 COM plugin? Pin
IGx8921-May-04 15:45
IGx8921-May-04 15:45 
AnswerRe: Capturing keyboard input from inside a background WMP9 COM plugin? Pin
Blake Miller25-May-04 15:42
Blake Miller25-May-04 15:42 
GeneralRe: Capturing keyboard input from inside a background WMP9 COM plugin? Pin
IGx8925-May-04 16:05
IGx8925-May-04 16:05 
Generalraw data to bitmap Pin
Snillet2k21-May-04 12:17
Snillet2k21-May-04 12:17 
GeneralRe: raw data to bitmap Pin
John R. Shaw22-May-04 17:51
John R. Shaw22-May-04 17:51 
GeneralUnknown Usr Breakpoint causes program halting!?!?! Pin
Wheatbread21-May-04 10:57
Wheatbread21-May-04 10:57 
GeneralRe: Unknown Usr Breakpoint causes program halting!?!?! Pin
Alexander M.,23-May-04 9:50
Alexander M.,23-May-04 9:50 
GeneralKeyboard Accelerators for CFormView Pin
brdavid21-May-04 9:54
brdavid21-May-04 9:54 
General_inp and _outp Pin
eggie521-May-04 9:35
eggie521-May-04 9:35 
GeneralRe: _inp and _outp Pin
21-May-04 10:54
suss21-May-04 10:54 
GeneralRe: _inp and _outp Pin
eggie521-May-04 11:01
eggie521-May-04 11:01 
GeneralRe: _inp and _outp Pin
21-May-04 12:29
suss21-May-04 12:29 

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.