|
what's your program's name? (i'll make sure i never let it near my PC).
-c
There ain't no second chance
Against the thing with the forty eyes, girl
|
|
|
|
|
The name of the program is "VirusKiller.exe" XD :-P
I need it, because I will have some com EXE server that can hang, and I have not control over them ( the will be developed by third parties...), so if they crash, I want to detect it, and kill'em, and then restart the EXE server.
he he, but is not a bad idea for a Virus...
so long
Braulio
|
|
|
|
|
My main goal is to kill non-responding exe's apps ( well EXE com servers).
Then be aware there are occasions you actually can't kill them. :-<
If there's an RPC call (synchronous) that's waiting for a response, the process you want to kill is actually "hanging" inside the kernel and can't be killed. This is one of the resons COM on Windows is hated by some of us: You can't kill a hung process!
Another way to display this would be to (disregarding what the documentation states, the docs lie) create a new file, SetFilePointer to some large value (like 2GB-1), and then SetEndOfFile.
Now do this on a disk that's not using DMA to see how a user-mode process chews away almost all available CPU. Try to kill it using e.g. TaskManager. :-<
But back to your problem: this is depending on what OS you are running under (no one can ever accuse Microsoft of "stable API's" when it comes to this).
If you're using an NT kernel OS you could use the PSAPI to EnumProcesses. Then iterate that set and OpenProcess, then EnumProcessModules and finally GetModuleBaseName to get the name of the process.
If that name fits what you want to kill you then OpenProcess(PROCESS_TERMINATE, FALSE, pid), terminate that process, and finally CloseHandle on the process handle you got from OpenProcess.
Simple, wasn't it. :-/
|
|
|
|
|
Thanks for the help !
Then to control possible unstable COM EXE server what could I do ?, Should I for another solution better ?
My idea was to have a tool that would check the COM EXE servers of my system ( If I said any third party could add his owns exe servers... so I could be in trouble).
Then would be a better idea to use something like MTS or MSMQ, or some other big words technologies ? ( I wouldn´t like to say to the user... "please we have f***ed up, restart your system" ).
Thanks for you help, so long
Braulio
|
|
|
|
|
i am getting a bunch of these warning messages after my OnInitDialog() exits:
First-chance exception in 8028c.exe (KERNEL32.DLL): 0xC0000005: Access Violation.
and i have absolutely no idea why ... i traced it down into the depths of wincore.cpp and its friends but god only knows what they get up to when they're bored ... thing is my app doesn't go squiff even in release mode so i'm a wondering if its something i can ignore or should i be afraid ... very afraid
"... and so i said to him ... if it can't dance and you can't eat it either f**k it or throw it away" 8028finder.com
|
|
|
|
|
What does your code look like. It sounds like an initialization problem.
|
|
|
|
|
Do you have an ActiveX control on your dialog? I get these when I have an in-house ActiveX control in use. I think the windows system is trying to access a default function that is not present or some such. Doesn't seem to affect how my program works.
Roger Allen
Sonork 100.10016
If I had a quote, it would be a very good one.
|
|
|
|
|
I found this article in the MSDN:
INFO: First and Second Chance Exception Handling Q105675
It explains what you are seeing. There are many DLLs (and other code) that throw exceptions on purpose to see if things are valid. I have used this technique to check if memory-mapped files have real memory allocated for them. From the article, the debugger sees these exceptions before the application does. It creates a warning before a handler is able to catch the exception. Note that they must be getting handled or your application would crash.
I see them also in most of my applications and they are safe. I have written hundreds of applications and never seen these messages to be a problem.
Hope this helps...
Jonathan Craig
www.mcw-tech.com
|
|
|
|
|
awesome
thanks for the info
i wondered why my release build wasnt dying at the very least
"... and so i said to him ... if it can't dance and you can't eat it either f**k it or throw it away" 8028finder.com
|
|
|
|
|
Hi
I have created a SDI application ( with COM server option ) using the new appwizard supplied with the WTL 7.0 toolkit. After adding a ATL simple object, I tried to access the interface from VB 6 to no avail?? Has anyone played around with these options?
The code generated by VS registers the object on the ROT, but using ye old ROT/COM viewer, I cannot see my object registered on the ROT when an instance of my SDI application is running. Any ideas?
Frans
|
|
|
|
|
Hi,
I want to change the Dialog size of a CFormView, ( make it varable ).
Also I want to position the Dialog( CFormView ) at a
particular postion , when the Dialog( CFormView ) size is
greater than the MainFrame
Also the Mainframes size is kept constant.
Can someone please suggest towards this.
Thanks,
Sanksy
|
|
|
|
|
sanskypotov wrote:
God is Good, all the Time.
All the Time, God is Good.
no offence meant but...
is this some kind of trick question?
"... and so i said to him ... if it can't dance and you can't eat it either f**k it or throw it away" 8028finder.com
|
|
|
|
|
No Sir,
I hope that I have made it more precise and clear.
Thanks,
Sansky
John 3:16
For God so loved the world,
that he gave his only begotten Son ( Jesus Christ ) ,
that whosoever believeth in him should not perish, but have everlasting life.
|
|
|
|
|
errrrr ... thanks for clearing that up
"... and so i said to him ... if it can't dance and you can't eat it either f**k it or throw it away" 8028finder.com
|
|
|
|
|
My customer in China is having problems with running my program on his computer. He is using Win NT Chinese version, and his symptoms is that the mouse and keyboard does not work.
Below I attached the question from China:
Could you help the Qinghuangdao customer to use their 3710 software? They can't use it as usual. I mean the software always stop the screen, The people find it because they can't use the mouse and key to control the computer. They run the 3710 in Win NT 4.0 Chinese version.
Can anyone tell me if there could be problems when running MFC programs on this version?
Thanks for helping me out
Einar
|
|
|
|
|
My Windows2K is Chinese version, and I code MFC applications.
Never have such problem... And never happened on my ex-operating systems (WinNT4, Win95, Win98).
And what's 3710 software? I personally think that's because the 3710 software hang ( or crashed ) so the screen got freezed...
Maxwell Chen
People say "No news is good news". Then, no code is good code!?
|
|
|
|
|
Maxwell Chen wrote:
And what's 3710 software?
it looks like some mainframe terminal emulator from its name
"... and so i said to him ... if it can't dance and you can't eat it either f**k it or throw it away" 8028finder.com
|
|
|
|
|
I know from personal experience that you can run English (or Chinese, of course...) MFC applications on a Chinese machine. The fonts are different, but otherwise it's likely something else going on.
Do you have a Debug version of the app that you could run on the Chinese system? Perhaps something that can create a log of all its actions? At least then you might be able to see what the problem is.
No generalization is 100% true.
Not even this one.
|
|
|
|
|
How to open a col-file on the necessary topic???
|
|
|
|
|
I have explorer like application (CTreeView at Left and CListView at right). I also have function in CListView whith select element in CListCtrl by it number.
SelectDocument(int i)
{
GetListCtrl().SetItemState( j,LVIS_SELECTED|LVIS_FOCUSED,LVIS_SELECTED|LVIS_FOCUSED );
}
When I trying I call this function from CListView all work fine, but if I call it from another class it do nothing.
Pleese tell me what is wrong and what should I do.
|
|
|
|
|
I have a drawing application and am trying to implement a print scaling feature much like Excel's "page setup" so the resulting print-out can be scaled accordingly.
For example, I have tried the below code to print a bar graph, but see no effect on neither the print-out nor the print preview result.
What am I doing wrong? Any help would be greatly appreciated.
OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo)
{
HDC temphd = CreateCompatibleDC( pDC->m_hDC );
StretchBlt( pDC->m_hDC, 0, 0, 32, 32, temphd, 0, 0, 100, 100, SRCCOPY );
DeleteDC( temphd );
}
Best regards,
tak shichiku
|
|
|
|
|
I have scaled stuff 3 different ways:
1.) Acually recalculate the sizes of rects and other objects before display or printing them.
2.) Draw to a memory DC and StretchBlt to the display or printer. (This looks like what your where hoping to do.)
3.) Use the windows mapping functions.
Option 1 works if everything you are displaying can be put in rectangles. You have to multiply all the coordinates by a scale factor before displaying them.
Option 2 works, but you are stretching a bitmap so you get poor results if stretching too big or too small. To make this work you have to; create a memory DC, create a Bitmap, select the Bitmap into the memory DC, draw on the memory DC, then StretchBlt or BitBlt to the display DC or printer DC.
Option 3 works well also. You have to use the CDC::SetMapMode, CDC::SetWindowExt, and CDC::SetViewportExt methods. I can't tell you how to use these because you have to understand the WindowExtent and Viewport consecpts. But this information can be fould in the MSDN. This may be your best bet, because you can get scaling without changing all your drawing code.
Hope this helps...
Jonathan Craig
www.mcw-tech.com
|
|
|
|
|
Hi,
I have a handle to a bitmap(not a resource bitmap) file and can display it in my app window. Now I need to search all pixel RGB values if necessary change them with another RGB value and display it again.
I know a BITMAP structure have bmBits pointer but do not know how to use it.
karanba
|
|
|
|
|
I don't believe the bmBits is valid if it's not a DIBSection, but depending on the bit depth, they are stored as BGR, BGRA, or 5 bits each of BGR plus one bit for padding. They are stored in rows that are a multiple of 4.
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
And you don't spend much time with the opposite sex working day and night, unless the pizza delivery person happens to be young, cute, single and female. I can assure you, I've consumed more than a programmer's allotment of pizza, and these conditions have never aligned. - Christopher Duncan - 18/04/2002
|
|
|
|
|
what is DIBSection, I hear much about?
karanba
|
|
|
|