|
void EndProcess(string PID)<br />
{<br />
HANDLE ps;<br />
int id=atoi(PID.c_str());<br />
ps = OpenProcess(1,false,id);<br />
if(ps)<br />
{<br />
if(!TerminateProcess(ps,-9))<br />
{<br />
ShowMessage("Could not end process specified!");<br />
}<br />
else<br />
{<br />
ShowMessage("Process successfully terminated!");<br />
}<br />
}<br />
}
Is that what you want?
|
|
|
|
|
Hi,
I wrote a dll ,currently i was assigned to write a UNIT TEST CASE DOCUMENT,i don`t have a prior experince of writing unit test case document.what does unit test case document means..?i have around 20 functions in the dll. Does any one has the format of the unit test case document, sample document or related URL,kindly help me..i don`t know whether this is the correct forum to post...
Thanks in before
James
|
|
|
|
|
If you have around 20 functions in your DLL, then unit testing simply would mean testing each and every one of those functions individually for functionality, performance, or whatever you are intending to test it for. Unit Testing, in Wikipedia[^]
I am not ashamed to confess that I am ignorant of what I do not know.
- Marcus Tullius Cicero
|
|
|
|
|
I need mstcpip.h file to compile my program.
Who can help me?
Please send it to me(contact to me via email: theoceanman246@yahoo.com).
-- modified at 0:25 Saturday 24th February, 2007
|
|
|
|
|
|
I got it.
Thanks u so much!
|
|
|
|
|
You're welcome
|
|
|
|
|
skyline2 wrote: Please send it to me(contact to me via email: theoceanman246@yahoo.com).
No, we won't. If you won't read the forum, why would we reply to you ?
Way to attract spam, BTW.
I'd be very surprised if your program compiles as a result of adding this header, a #include for a header almost always also requires a lib file, and probably other header and/or cpp files. A header can represent the hook into a library, it rarely represents a library.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
OK,I'll try it more.
Thanks anyway!
|
|
|
|
|
Or you could get it where you're supposed to:
Microsoft ® Windows Server® 2003 R2 Platform SDK[^]
"Do you know what it's like to fall in the mud and get kicked... in the head... with an iron boot?
Of course you don't, no one does. It never happens. It's a dumb question... skip it."
(Rex Kramer "Airplane!")
|
|
|
|
|
I got it.
Thanks u so much!
|
|
|
|
|
hi,
i have a dialog based application, on pressing Escape key my application closes, i want to detect the escape key press and need to retain my apps how to do it?
zari
|
|
|
|
|
Override the virtual function OnCancel() and do nothing there. Handle the event WM_CLOSE and call CDialog::OnCancel() there. Or override PreTranslateMessage() and eat the Esc key press there!
A friend is, as it were, a second self.
- Marcus Tullius Cicero
|
|
|
|
|
|
And maybe you need to same work for Enter(IDOK) with brahmma answers
|
|
|
|
|
|
I am supporting French for my project (MFC).
I have to use "String Tables" instead of creating a new set of Dialogs for each supported language. String Tables are to support multiple languages.
Could you tell me more about this, please.
Please send me an example
Thanks a lot!
Papais
|
|
|
|
|
Start by reading:
1) Internationalization and Multiple Language Support[^]
2) Tips on internationalization of software[^]
Another approach to 1 above would be to have string resource table only DLLs and manually loading strings from resource instead of recreating each dialog, menu, and etc. for each language. This would require more coding, but a non-programmer could be taught to edit the string tables.
There is also a good book offered by Microsoft Press on the subject, version one of that book was in the VC6.0 MSDN help.
INTP
"Program testing can be used to show the presence of bugs, but never to show their absence."Edsger Dijkstra
|
|
|
|
|
What version of Visual C++ are you using? If you are using VS 2003 or above, the IDE supports Unicode.
Let us not listen to those who think we ought to be angry with our enemies, and who believe this to be great and manly. Nothing is so praiseworthy, nothing so clearly shows a great and noble soul, as clemency and readiness to forgive.
- Marcus Tullius Cicero
|
|
|
|
|
|
I've created my dialog based application in 1600 x 1200 resolution.. It's a pretty large dialog with lots of conrols..
My problem is when the screen is set in lower resolutions, The program will not load the full dialog. Some of the right and bottom gets cut off. I've made it so you can scroll vertically and horizontally, but it still cuts off some of the dialog.
Any Ideas?
http://www.aquawicket.com/edrummonitor
|
|
|
|
|
aquawicket wrote: Any Ideas?
Create various-sized templates and load the appropriate one at runtime.
Program to the smallest common denominator.
Use a property sheet.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
The dialog open fine in 1600x resolution and the I can change the resolution to a lower one while the app is open and still see it all by scrolling.. I've put alot of work into this dialog and just want it to not get cut off in lower resolutions..
I'm not really understanding what is ment by "Program to the smallest common denominator. and Use a property sheet"..
My program is done with visual studio 2005 using MFC.. It works like a charm.. all except this one bug.
|
|
|
|
|
aquawicket wrote: I'm not really understanding what is ment by "Program to the smallest common denominator.
You could have designed your dialog with your screen resolution set to 1024x768.
aquawicket wrote: I'm not really understanding what is ment by Use a property sheet"
Property Sheet[^]
All pain is either severe or slight, if slight, it is easily endured; if severe, it will without doubt be brief.
- Marcus Tullius Cicero
|
|
|
|
|
Hello!
I'm currently teaching myself writing Windows32 applications with C/C++ without MFC.
Currently I'm trying to apply XP visual styles for controls. I tried to learn from the MS Platform SDK documentation how it is done, but unfortunaltely it left me and quite clueless. Please give me some hints!
Let's assume I have a simple Windows application with one window containing a simple button (a real parent window, not a dialogue - hope I'm using the right terminology here):
#include <windows.h><br />
#include "commctrl.h"<br />
<br />
LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM) ;<br />
<br />
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR szCmdLine, int iCmdShow) {<br />
MSG msg;<br />
WNDCLASS wndclass;<br />
<br />
wndclass.style = CS_HREDRAW | CS_VREDRAW ;<br />
wndclass.lpfnWndProc = WndProc ;<br />
wndclass.cbClsExtra = 0 ;<br />
wndclass.cbWndExtra = 0 ;<br />
wndclass.hInstance = hInstance ;<br />
wndclass.hIcon = LoadIcon (NULL, IDI_APPLICATION) ;<br />
wndclass.hCursor = LoadCursor (NULL, IDC_ARROW) ;<br />
wndclass.hbrBackground = (HBRUSH) GetStockObject (WHITE_BRUSH) ;<br />
wndclass.lpszMenuName = NULL ;<br />
wndclass.lpszClassName = TEXT("App");<br />
<br />
if(!RegisterClass(&wndclass)) {<br />
MessageBox (NULL, TEXT("This program requires Windows NT!"), TEXT("App"), MB_ICONERROR);<br />
return 0;<br />
}<br />
<br />
HWND hwnd = CreateWindow(TEXT("App"), TEXT("Just an application"), <br />
WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, <br />
NULL, NULL, hInstance, NULL);<br />
ShowWindow(hwnd, iCmdShow);<br />
UpdateWindow(hwnd) ;<br />
<br />
while(GetMessage(&msg, NULL, 0, 0)) {<br />
TranslateMessage(&msg);<br />
DispatchMessage(&msg);<br />
}<br />
return msg.wParam ;<br />
}<br />
<br />
LRESULT CALLBACK WndProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)<br />
{<br />
static HWND hwndButton;<br />
HDC hdc ;<br />
PAINTSTRUCT ps ;<br />
<br />
switch (message)<br />
{<br />
case WM_CREATE :<br />
hwndButton = CreateWindow ( TEXT("button"), <br />
TEXT("Just a button"),<br />
WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON,<br />
20, 20,<br />
130, 50,<br />
hwnd, (HMENU) 0,<br />
((LPCREATESTRUCT) lParam)->hInstance, NULL) ;<br />
return 0 ;<br />
<br />
case WM_PAINT : <br />
hdc = BeginPaint (hwnd, &ps) ;<br />
<br />
EndPaint (hwnd, &ps) ;<br />
return 0 ;<br />
<br />
case WM_DESTROY :<br />
PostQuitMessage (0) ;<br />
return 0 ;<br />
}<br />
return DefWindowProc (hwnd, message, wParam, lParam) ;<br />
}
I have added a manifest to the project ressources as told.
All I want now is to enable this button to use visual styles. Please show me how!
Greetings,
Lamgi-Mari
|
|
|
|
|