Click here to Skip to main content
15,908,776 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: BIG trouble with 64-bit Shell_NotifyIcon() - can anyone help? Pin
Frankie-C16-Mar-15 13:00
Frankie-C16-Mar-15 13:00 
GeneralRe: BIG trouble with 64-bit Shell_NotifyIcon() - can anyone help? Pin
Tacitonitus16-Mar-15 15:36
Tacitonitus16-Mar-15 15:36 
GeneralRe: BIG trouble with 64-bit Shell_NotifyIcon() - can anyone help? Pin
Frankie-C16-Mar-15 22:39
Frankie-C16-Mar-15 22:39 
GeneralRe: BIG trouble with 64-bit Shell_NotifyIcon() - can anyone help? Pin
Tacitonitus17-Mar-15 3:34
Tacitonitus17-Mar-15 3:34 
GeneralRe: BIG trouble with 64-bit Shell_NotifyIcon() - can anyone help? Pin
Frankie-C17-Mar-15 4:11
Frankie-C17-Mar-15 4:11 
GeneralRe: BIG trouble with 64-bit Shell_NotifyIcon() - can anyone help? Pin
Tacitonitus17-Mar-15 7:21
Tacitonitus17-Mar-15 7:21 
GeneralRe: BIG trouble with 64-bit Shell_NotifyIcon() - can anyone help? Pin
Frankie-C17-Mar-15 7:29
Frankie-C17-Mar-15 7:29 
GeneralRe: BIG trouble with 64-bit Shell_NotifyIcon() - can anyone help? Pin
Frankie-C17-Mar-15 22:48
Frankie-C17-Mar-15 22:48 
QuestionVC++ DLL throws error when call it from C#[EntryPointNotFound] Pin
Member 988367216-Mar-15 1:38
Member 988367216-Mar-15 1:38 
AnswerRe: VC++ DLL throws error when call it from C#[EntryPointNotFound] Pin
Richard Andrew x6416-Mar-15 5:48
professionalRichard Andrew x6416-Mar-15 5:48 
QuestionIAccessible - get word under mouse pointer in IE Pin
Fourblack15-Mar-15 22:01
Fourblack15-Mar-15 22:01 
QuestionC++ to C problem Pin
alexx00614-Mar-15 10:03
alexx00614-Mar-15 10:03 
AnswerRe: C++ to C problem Pin
Richard Andrew x6414-Mar-15 13:15
professionalRichard Andrew x6414-Mar-15 13:15 
AnswerRe: C++ to C problem Pin
Frankie-C15-Mar-15 5:49
Frankie-C15-Mar-15 5:49 
GeneralRe: C++ to C problem Pin
David Crow16-Mar-15 2:54
David Crow16-Mar-15 2:54 
QuestionUI widget Pin
Member 1152499814-Mar-15 7:01
Member 1152499814-Mar-15 7:01 
AnswerRe: UI widget Pin
Albert Holguin15-Mar-15 17:19
professionalAlbert Holguin15-Mar-15 17:19 
QuestionUI widget Pin
Member 1152499814-Mar-15 6:52
Member 1152499814-Mar-15 6:52 
QuestionFeatures and rich documentation of MFC vs Small Executable of WTL Pin
Member 1120327711-Mar-15 4:21
Member 1120327711-Mar-15 4:21 
AnswerRe: Features and rich documentation of MFC vs Small Executable of WTL Pin
jeron111-Mar-15 5:53
jeron111-Mar-15 5:53 
AnswerRe: Features and rich documentation of MFC vs Small Executable of WTL Pin
Eddy Vluggen11-Mar-15 6:28
professionalEddy Vluggen11-Mar-15 6:28 
AnswerRe: Features and rich documentation of MFC vs Small Executable of WTL Pin
Albert Holguin15-Mar-15 17:29
professionalAlbert Holguin15-Mar-15 17:29 
QuestionSftTree.dll, v4.0.0.0 performance issue With C# Winform Pin
vipin kumar sharma10-Mar-15 1:43
vipin kumar sharma10-Mar-15 1:43 
SuggestionWrong Forum Pin
Richard Deeming10-Mar-15 2:04
mveRichard Deeming10-Mar-15 2:04 
QuestionEjecting USB memory sticks problem Pin
Still learning how to code10-Mar-15 1:07
Still learning how to code10-Mar-15 1:07 
I am developing an application to copy USB memory sticks. As part of this app, I want to be able to eject the memory sticks when copying is complete. (I DO wonder whether this is necessary as I do a file flush before closing the file) I found a nice little utility (deveject) to implement this and am calling it using WinExec() - I do realise that this is very old and I should be moving on to CreateProcess(), but it has worked well for me in the past and I'm in a bit of a hurry !! Although WinExec() returns 33 (which indicates success), the drives are still accessable aftyerwards and so deveject presumably has not executed properly As a test for the command line used, I placed it in a batch file (deveject -EjectName:"USB Mass Storage Device") in the same directory as deveject.exe, and it executes perfectly, releasing all USB sticks. However, if I use WinExec() to call this batch file, then it doesn't work (but good return code from WinExec() )
So my question is - what am I doing wrong when using WinExec() ? Should I be doing something (permission-wise)to allow the WinExec command line to execute ? My code is as follows:-

C++
CString szCmdLine;
const CString quote = "\""; // This is actually the character '"'

szCmdLine = "D:\\StickCopier\\deveject -EjectName:" + quote + "USB Mass Storage Device" + quote;
UINT uiRC;
uiRC = WinExec(szCmdLine,SW_HIDE);


(The command line formed is exactly what I used in the batch file)

Would greatly appreciate any help on this daft (but perplexing) problem !!

modified 10-Mar-15 7:44am.

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.