|
Can you please tell more on how you close the app while it's in minimized state? (sending a message from somewhere else?)
Generally speaking, there are a few SDK functions that are used to terminate Win32 apps explicitly.
(1) ::TerminateProcess(HANDLE hProc);
(2) ::PostQuitMessage(WM_QUIT);
See MSDN documentation to find more..
// Fazlul
Get RadVC today! Play RAD in VC++
http://www.capitolsoft.com
|
|
|
|
|
The system tray icon will hang around until you remove/destroy it. When your app exits, you should remove/destroy the systray icon.
/ravi
"There is always one more bug..."
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
When I close the app the icon is still visible until I pass the mouse over it,
That's because you're not calling Shell_NotifyIcon() to remove the tray icon before your app exits.
--Mike--
http://home.inreach.com/mdunn/
"The Earth is doomed." -- Rupert Giles
your with and
|
|
|
|
|
I feel dumb ... that worked like a charm.
Thanks!
Rob
|
|
|
|
|
I was wondering, is there a way to wait for a single process to complete with out using treads? I am reading data from a serial port at a low baud rate, and before the read is complete my program cuts it off and starts processing the data. Any help is appreciated.
Thanks.
|
|
|
|
|
I'm not sure what do you mean by 'process' in your post. Is that just some activity of your program, like reading from serial port, or OS object created with a call to CreateProcess?
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
What I mean by process is the read... When I do my read call, before the read has finished reading all the data it is supposed to, my program is already trying to use that data... this results in data being lost or corrupted. Is there anyway to wait for the read to finish and then when it is done, continue the program?
|
|
|
|
|
Is there anyway to wait for the read to finish and then when it is done, continue the program?
How do you read the bytes from the serial port?
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
I connected to the serial port like this...
hCommPort = CreateFile( "COM1",GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0);
then I read like this...
ReadFile (hCommPort, buffer, 8, &dwBytesTransferred, NULL);
|
|
|
|
|
So ReadFile returns an error and exits prematurely? You're not using overlapped I/O - there's no FILE_FLAG_OVERLAPPED flag in the call to CreateFile.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
No, there is not an error... It just reads and continues, but the read is not finished when it goes on... I have put a Sleep(500) after the read, and it then works correctly, but I know that this is not a good approach.
|
|
|
|
|
|
Yes, that is correct. It is sometimes 8, and sometimes less. Also when it is less than 8 there is sometimes garbage symbols there as well.
|
|
|
|
|
|
That's ok, thanks for your time.
|
|
|
|
|
I think I understand the problem...
You are getting all the bytes available at the time of the call, up to the requested MAXIMUM. Put the read in a loop, with a Sleep. It doesn't have to be long... Keep looping until you have read all the bytes you want.
Bill
|
|
|
|
|
is the superclass (base class) destructor "virtual" ?
-c
------------------------------
Smaller Animals Software, Inc.
http://www.smalleranimals.com
|
|
|
|
|
figured it out
thx
Regards
Ray
"Je Suis Mort De Rire"
|
|
|
|
|
Is Winsock 2.0 included in Windows 95 and 98?
I cannot find it anywhere in MSDN
If not, is it possible to install Winsock 2.0 on Windows 95/98?
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
Hello, the codegurus around the world.;)
Windows 95 doesn't have WinSock2.0, but Windows 98 have WinSock2.0.
WS2_32.dll is a key DLL in the system directory if WinSock2 exists.
We can install WinSock2.0 to Windows 95, but there are some bugs like
FrontPage TCP/IP configuration.
You will find some ws2setup.exe in MSFT home page to install WinSock2.0.
Have a nice day!
-Masaaki Onishi-
|
|
|
|
|
Hi ,
I have an application that can send mail to some recipients.Is there any system limit on the maximum number of the recipients that i can send mail to(probably yes)
if yes,How to learn the number of recipients exceeding the limit ?
thanks for help
greetings from germany
Özgür
|
|
|
|
|
How do you send the mail. Do you use MAPI, or du you "talk" SMTP directly to the mailserver?
Do you just send one mails where all the recipients are BCC, or...?
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
Hi,
I am sending mail with MAPI. using MAPISendMail function of the library.
I have a method to add a recipient to MapiMessage structure.
Özgür
|
|
|
|
|
hi folks,
i have a simple question (hope so ): how do i execute an external program? i know the _spawn and _exec funtions, the problem is that the path to the .exe-file or whatever is stored in a CString class and the functions expect char. i tried some things to convert a CString to char - without success. is there any other way to execute programs, where i can use a parameter in CString format? or how do i a conversion from CString to char?
thaks for any solutions, greetz,
McEck
|
|
|
|
|
Hi McEck;
You can use the ShellExecute command to lauch external programs.
You can also use the strcpy command to convert CString to char. I don't know if there
is a better way, but this way does work.
Cheer
Justin Somerville
|
|
|
|