|
I've a third-party console application 'MyTestConsole.exe' that I launch by CreateProcess.
STARTUPINFO StartUpInfo;
PROCESS_INFORMATION ProcInfo;
memset(&StartUpInfo, 0, sizeof(StartUpInfo));
memset(&ProcInfo, 0, sizeof(ProcInfo));
StartUpInfo.dwFlags = STARTF_USESHOWWINDOW;
StartUpInfo.wShowWindow = SW_SHOWNORMAL;
CreateProcess( "D:\\MyTestConsole.exe", NULL, NULL, NULL, NULL, CREATE_NEW_CONSOLE, NULL, NULL, &StartUpInfo, &ProcInfo);
The console application launches successfully, but displays a standard windows error message, say for instance
'Error : could not open file'
Now, how do I get the error string 'Error : could not open file' in a CString object.
May be I'll have to use AttachConsole() and other console functions but not sure how.
Pleae give your suggestions.
Thanks in advance.
|
|
|
|
|
This example[^] shows how to use a pipe to capture output from a child process - that's what you're wanting to do.
To summarise what the example does:
- Create a pipe to capture the child processes standard output and error streams (that's the console output).
- Make sure the current processes standard handles aren't inheritable
- Use the
lpStartupInfo parameter to CreateProcess to specify the pipe as the child processes standard stream handles - Keep reading the pipe attached to the child's standard output until it's closed
HTH!
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
|
Hey everybody
How can a get an hToken (or CAccessToken) for a cached (saved) network user name?
If you run "rundll32.exe keymgr.dll,KRShowKeyMgr" you will get a dialog with cached usernames/passwords (can be found in control panel->User Accounts).
Is there a way to get a token to these usernames? (like explorer.exe is doing).
I need that when I want to access a remote file on a shared folder that can be accessed only using one of these cached usernames.
Thanks!
|
|
|
|
|
i have created a combobox in my dialog based application. and added items in it by clicking its propesties's data tab....added items saperated by semicolons...but these are invisiable to me.... how can i see them so that i can then use them..........reply me urgently...plzzzz
|
|
|
|
|
What do you mean by invisible ? They are not added to the combo box ? How do you add the items ?
Are you sure they are not added to your combo box but outside the range ? You can increase the visible range of your combo in the resource editor: if you click on the combo box arrow, you can set the size of the drop down rectangle instead of the size of the combo.
|
|
|
|
|
Instead of putting semicolon, why don't you use Ctrl+Enter to enter the data?
|
|
|
|
|
i hav tried both the things semicolon and Ctrl+enter but could view the items is there any other setting also????
|
|
|
|
|
Normally if u enter the items in the combo box using Ctrl+Enter and run the application, what ever you have entered will be displayed in the combo box.
by the way, can u see the combo box in the screen??
|
|
|
|
|
1/ As already mentioned, you need to use Ctrl-Enter to separate the lines of data.
2/ You need to make sure you call CDialog::OnInitDialog in your OnInitDialog routine, or MFC won't do the clever things it needs to to load in your data.
BOOL CMyDialog::OnInitDialog ()
{
return CDialog::OnInitDialog ();
}
I hope that helped,
Iain.
Codeproject MVP for C++, I can't believe it's for my lounge posts...
|
|
|
|
|
Hey thanks for that... that was a good piece of information!!!!
|
|
|
|
|
Hi,
I have a propreitary API which accepts char as a parameter. But I have a WCHAR variable. I need to typecast WCHAR variable to char.
Thanks
|
|
|
|
|
Use WideCharToMultiByte API.
|
|
|
|
|
Use WideCharToMultiByte .
«_Superman_»
|
|
|
|
|
Nope. You need instead a better understanding, see, for instance [^], [^].
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Hello friends
I got these errors when i compile my project.. i need ur suggestions..
include\winsock2.h(112) : error C2011: 'fd_set' : 'struct' type redefinition
include\winsock.h(54) : see declaration of 'fd_set'
include\winsock2.h(156) : error C2011: 'timeval' : 'struct' type redefinition
include\winsock.h(97) : see declaration of 'timeval'
include\winsock2.h(212) : error C2011: 'hostent' : 'struct' type redefinition
Thankx
|
|
|
|
|
Are you including both winsock.h and winsock2.h?
Or what files are you including and in which files?
«_Superman_»
|
|
|
|
|
Hi,
I am getting problem in joining 2 ITEMIDLIST that is ITEMIDLIST of Desktop and My Computer,
The size of Dektop ITEMIDLIST is zero so when I join them in a single IDIDLIST it comes the size of My Computer and having a null string. That create a big problem for me.....
How to solve it?
|
|
|
|
|
hi
#pragma error stops compiling further lines of the source code to be compiled and skips it to the next source file.
i need a pragma to stop compiling ever.
|
|
|
|
|
Try the #error directive.
«_Superman_»
|
|
|
|
|
I think he need #pragma take_my_compiler_away_please
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
yeah, something like this
my nephew! listen to me! i remember that when i was a child!, something which called Borland C++ v3.1, when there was no Windows and we had to work in an OS called DOS provided by Microsoft, had an option to stop errors and/or warning at a specified number of them. we could tell the compiler not to proceed compiling after m warnings and n errors. after a couple of years, Microsoft has not provided such an option for it's newest compiler, Visual Studio 2050!!!
i don't know why MS treats like this!!!
anyway, again, what i need is a way to command the compiler not to proceed compiling of ANY source and stop compilation like when it has compiled all of them!!!
this is eg. when i know the same error will occur when the other sources being compiled because they've included the same header file.
|
|
|
|
|
oh! sorry! i meant #error by #pragma error! :P that's exactly what which does not act as i like...
|
|
|
|
|
|
See here[^]
You need to google first, if you have "It's urgent please" mentioned in your question.
_AnShUmAn_
|
|
|
|