|
Please ensure the target is not started, by adding some log in that process. If process terminates as soon as the startup, then TaskManager cant show it.
Please check the values of returned PROCESS_INFORMATION structure. Process ID is avaialable in pi.dwProcessId.
return_code = CreateProcess((LPCSTR) &herc_command[0], // command
(LPCSTR) &herc_parm[0], // paramter
(LPCSTR) &sa,
NULL,
TRUE,
(DWORD) NULL,
NULL,
NULL,
&si,
&pi);
Is third parameter is correct? Conversion to a string is not correct.
|
|
|
|
|
I run the code under the debugger in VS
2010
In the child process
I have a __debugbreak at the beginning of the code
Ill move it up to CWinApp::InitInstance as that would seem close to the first piece of code being executed
Thanks
|
|
|
|
|
Since CreateProcess() returns before the process has been fully initialized (e.g., waiting on some other DLL to load), it would have no way of knowing that. It goes ahead and returns a non-zero value because it did start the process.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|
|
Since CWinApp::CWinApp is the first piece of executable code as far as I am concerned
I would set a breakpoint e.g. (__debugbreak) at that location if it doesn't get there where else would I look ?
Thanks
|
|
|
|
|
I dont't think the target process will be started under the debugger by the host process. There are three possible things I can think of testing.
First, in the project settings of the target app enter the same parameters you would recieve from the host process. Then start debugging and see if the app starts or if it aborts as well.
Second, try starting another process, e.g. cmd.exe, from the host process to check if this works at all.
Third, use as little parameters as possible and possibly log (or check in debugger) the values before passing them to the CreateProcess() call to see if they really are what you expect them to be.
|
|
|
|
|
I tried entering the .exe on cmd.exe and it just returned, next I tried starting it from Task
Manager and it and I saw it pop up for a second , tried to debug it and got invalid handle
as it disappeared
My guess I have a CWinApp to start things off and some how I didn't build it as a MFC project
On my property pages -> Project Default USE of MFC -> USe MFC as Shared DLL
maybe its something else in my project settings
Any Ideas are welcome
|
|
|
|
|
ForNow wrote: I tried entering the .exe on cmd.exe and it just returned... Is it a dialog-based app, or some other app that has a doc/view?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|
|
It has a MainWindow CFrameWnd
Something about the way I build it I think
|
|
|
|
|
ForNow wrote: It has a MainWindow CFrameWnd SDI or MDI?
ForNow wrote: Something about the way I build it I think That's kind of what I was leaning towards. If it was a dialog-based app, I was going to suggest to you to use the DS_NOFAILCREATE style.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|
|
I think SDI as there is only 1 MainWindow and dialogs Modal and non-modal that come
in response to user selection
|
|
|
|
|
I want to get my program to change the database password (MS Access MDB file). I used to be able to do this using CDaoDatabase class, but that is now depreciated. I am in the process of changing my code to use CDatabase class, but can not figure out how to add some of the functionality that I had before.
Anybody know how to do this?
|
|
|
|
|
I am also looking into upgrading the MS Access version we are using and from what I finding is that a lot of things previously done using the DAO library should now be done using an SQL command.
The SQL command for changing the password is ALTER DATABASE PASSWORD[^] and can be executed on the database using the CDatabase::ExecuteSQL[^] function.
I have not tried this myself but it looks like it should work.
0100000101101110011001000111001011101001
|
|
|
|
|
You are right. Your SQL method works. Just one thing though. You have to have the database opened with exclusive access.
|
|
|
|
|
Hi all,
I am setIcon on button,its working fine on vista or windows 7 but on xp the icon on button not displayed only text is displayed.
HICON addIcon = (HICON)LoadImage(AfxGetApp()->m_hInstance, MAKEINTRESOURCE(IDI_ICON_HELP),IMAGE_ICON, 24, 24, LR_DEFAULTCOLOR);
m_btn.SetIcon(addIcon);
how can I display the icon on button in xp.
thanks in advance.
|
|
|
|
|
You can't. Although the documentation suggests otherwise, it does not work in Windows XP.
Use the best guess
|
|
|
|
|
how can I do this with any other method
|
|
|
|
|
|
Can you change the icon to bitmap and try CBitmapButton class to load it on the button?
You talk about Being HUMAN. I have it in my name
AnsHUMAN
|
|
|
|
|
Hi, I have a global variable, in one thread, it be updated with new value, another thread read the variable.
Now I want to synchronized the 2 thread, that means, when it is updating in thread 1, then thread 2 have to wait to read it.
I wonder what synchronization method to use.
|
|
|
|
|
Solved, I use a AutoResetEvent now
|
|
|
|
|
If you do this more than once during the lifetime of your worker thread then this isn't enough.
|
|
|
|
|
You must use a critical section.
|
|
|
|
|
yes, later I turn to critical section, user mode synchronization way
|
|
|
|
|
hey,
i m very new to programming . could u pls help me with this isssue,
i have to read abt 300 files of the format 4 letter word followed by 4 digits "." 2 digits and 1 alphabet
|
|
|
|
|
hmgm wrote: help me with this isssue
You would need to explain exactly how that is an issue to begin with.
|
|
|
|