|
Dear All,
Programmatically I want to find the actual physical path of running process.
With Regards
Manoj Kumar Batra
|
|
|
|
|
Really easy. CreateToolhelp32Snapshot is your friend. Pass TH32CS_SNAPPROCESS, and use szExeFile of PROCESSENTRY32 structure.
|
|
|
|
|
Thanks you a lot for the Help.
can I find the running process is COM, DCOM? through CreateToolhelp32Snapshot?
With Regards
Manoj Kumar Batra
|
|
|
|
|
manojk_batra wrote: can I find the running process is COM, DCOM? through CreateToolhelp32Snapshot?
AFAIK, Nope that Not Possible...
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
or use
EnumProcesses();
OpenProcess();
EnumProcessModules()
GetModuleFileName()
gabby
|
|
|
|
|
Dear One,
I am working in MFC Dialog application.I jump from Parent dialog to child dialogs.But when I close any child Dialog.I NEED TO KNOW THAT WHICH EVENT OF PARENT DIALOG IS CALLED SO I MAY DO SOME MANIPULATION OVER THERE.
Thanx in anticipation
asifrogers
|
|
|
|
|
Are the child dialogs modal or modeless?
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
Child dialogs are modal.
asifrogers
|
|
|
|
|
asifrogers wrote: Child dialogs are modal.
if your child dialog are Modal.. then you must be calling like this..
CChildDlg chdDlg;
chdDlg.DoModal();
As the DoModal call is Blocking Function.. thats mean your Parent dialog will be blocked till you childDialog is Visible/running.. so if you want to perfrom task after closing of Child dialog you can write after the DoModal call
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
"Child dialog" is nearly always used in a general sense, hence the question.
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
Hi ,
when the child gets destroyed it send a wm_destroy trap it and do what you want to do their ,or post a message to the parent with the help of sendmessage( or a user message), trap it at parent .
Regards
farpointer
|
|
|
|
|
I can't do that in WM_Destroy as it sends assert failure as the parent dialog is about to be closed because i need to do some manipulations on class member of Parent Dialog.
I make an object in the OnDestroy event of child to modify Parent's label control.But when destructors are called child destructor is called first and in that destructor (Parent object was created so it causes assertion failure).
If any other method to solve this please send some code snippet for that
Thanx alot
Asif Rogers
asifrogers
|
|
|
|
|
Thanx i have managed to make my self defined event.
So nice of you n God Bless You
asifrogers
|
|
|
|
|
Hi
Any pointers to set BMP/GIF image as a background image.
Regards
Anniyan
|
|
|
|
|
Hi..
I want to write one program search 10 numbers element. we are 100 numberal
Example number: 193493049139458195314951935................
Thanks.
|
|
|
|
|
I have two questions really bothers me.
1. Is it possible to have .Net assembly with global functions so that I can add reference and use them in my application by ::globalfunctions?
2. I have one small solution with two projects: one to create the dll and the other is to consume it. In the application, I can see the intellisense recognize the member in the namespace. But when I compile, I got error 2039 "something" is not a member of "namespace".
Any help will be greatly appreciated.
|
|
|
|
|
i'm just getting into programming and for one of my projects involves opening a file, but if it doesn't exist it is not supposed to create one, but rather output an error message. in some cases, if i give it a file location that doesn't exist, it outputs the message and doesn't create a file, but most of the time it creates the file and doesn't output the message. why is this?
any help would be much appreciated
thanks
-james
jnerv
|
|
|
|
|
jnerv wrote: most of the time it creates the file and doesn't output the message.
What function are you using?
You may try PathFileExists()
Regards,
Rajesh R. Subramanian
You have an apple and me too. We exchange those and We have an apple each.
You have an idea and me too. We exchange those and We have two ideas each.
|
|
|
|
|
If you're using MFC CFile class if you will pass only CFile::modeRead it won't create it if it doesn't exist (Open function).
If you're using fopen pass only 'r' to mode parameter and the function will fail if the file does not exist.
|
|
|
|
|
right on, thanks for the help guys. saved me another day of tearing my hair out, haha.
muchas gracias
later
-james
|
|
|
|
|
if u use CreateFile()
Specifiy the create dispozition paramater: OPEN_EXISTING;
if the function return INVALID_HANDLE_VALUE then it does not exist or u can use GetLastError() and FormatMessage() to see the exact error returned hope this helps
gabby
|
|
|
|
|
Another way for you knowledge:-
You can also use
CFile::GetFileStatus(CString filename,CFileStatus status) a static function
returns false if it doesnt exist and then return from your function.
Regards
farPointer
|
|
|
|
|
jnerv wrote: if i give it a file location that doesn't exist, it outputs the message and doesn't create a file, but most of the time it creates the file and doesn't output the message. why is this?
Which Api/Class are you using to read/write File.. as these api contain flags... which can return ERRROR is no file Exist by that name on the specified path.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
I all [[]]
Is this ok?
<br />
class errorMemoryShortage;<br />
<br />
int Func( void )<br />
{<br />
SomeType* SomeVar;<br />
<br />
SomeVar = new SomeType;<br />
if ( !SomeVar ) throw new errorMemoryShortage;<br />
}<br />
If there is no memory how can i throw an exception?
Thx!
Peace [[]]
hint_54@hotmail.com
|
|
|
|
|
If there is not enough memory, new will throw bad_alloc exception for you anyway and you will never even get to your NULL test.
My programming blahblahblah blog. If you ever find anything useful here, please let me know to remove it.
|
|
|
|