|
SetWindowText("Your window text here");
-Dominik
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
|
|
|
|
|
Hi,
I use ShellExecute to run some dos commnds from by application.
Everything works fine but I have to sit in a tight loop to wait for the command to finish like that
<br />
do<br />
{<br />
retval=WaitForSingleObject (sei.hProcess, 0);<br />
} while (retval ==WAIT_TIMEOUT);<br />
This makes my application hang the PC for a long time.
Any elegant way to do it ?
Shay
|
|
|
|
|
Do exactely the same code in a separate thread.
~RaGE();
|
|
|
|
|
Use CreateProcess(), then you'll get a handle you can wait for with WaitForSingleObject()
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
AFAIK, this hangs the app as well, no ?
~RaGE();
|
|
|
|
|
Yup. But using a kernel wait instead of a busy wait would be much nicer for your CPU.
If you want your application to continue to respond to input, then you should use MsgWaitForMultipleObjects() with a message pump. This lets your application respond to input and paint messages while waiting for an event to become signaled.
Ryan
"Everybody has a right to be stupid, but
some people abuse the privilege."
Uncle Joe Stalin
|
|
|
|
|
Ryan S Roberts wrote:
MsgWaitForMultipleObjects() with a message pump
Could you post a tiny code snippet ? I'm interested in this (already tried something like that, but kept having my app crash, probably because of the message queue ...)
~RaGE();
|
|
|
|
|
That's because the time-out interval is 0, which means test the object's state and return immediately. Supply a reasonable time-out interval such as 2000.
|
|
|
|
|
if it's possible to receive events fired by HTML controls that are placed in an HTML file that is displayed in a CHtmlView ???
If is possible, how can I do it ??
|
|
|
|
|
|
I paint something on a window, and wanna save the drawing as a bitmap file? What can I do? Please help me!
stanley
|
|
|
|
|
I am reading a binary file in c++ (reading every 1024 bytes) but get an error when I do this:
do
{
nBytesRead = infile.read( BytePtr,1024 ); // fails on this line
cout << BytePtr << endl;
}
while( nBytesRead > 0 );
The error line says there is no acceptable conversion. I can do this in mfc but it doesn't allow me to do it in c++.
How can I do this in c++??
|
|
|
|
|
How is BytePtr declared? What is read() supposed to return?
|
|
|
|
|
|
Thanks have tried that.
BytePtr is declared as:
ifstream infile;
char *BytePtr = new char[1025];
thanks.
|
|
|
|
|
.NET doesn't have Classwizard, How can I add mouse buttons (OnLButtonDown,..), or OnPaint ???
Ehsan Behboudi
|
|
|
|
|
Hi,
you will have a good tutorial here:
http://www.codeguru.com/columns/Kate/KG061902.html
Everything's beautiful if you look at it long enough...
|
|
|
|
|
Select the resource (dialog) where you want to add the mouse buttons to, in your resource view. Right click on the resource in the right document view. Select properties from the pop-up menu.
A new window appears, click on Control Events in the toolbar. This shows all events for all the controls in your resource.
|
|
|
|
|
Hi guys
What's the method to control a key pressed when we are working with a CFormView?
I've tried OnChar but when the key is pressed the method is not called.
Best Regards
Dr.Pi
|
|
|
|
|
|
I have the same result as with OnChar
Maybe I'm doing something wrong, and it's a silly mistake.
Thanks anyway
Dr.Pi
|
|
|
|
|
Your best chance is probably PreTranslateMessage checking for pMsg->message == WM_KEYDOWN and pMsg->wParam == VK_key_of_interest
You can also make use of GetFocus() to check which control the input would have been aimed at.
Roger Allen
Sonork 100.10016
Were you different as a kid? Did you ever say "Ooohhh, shiny red" even once? - Paul Watson 11-February-2003
|
|
|
|
|
Hey guys... i'm developing a C++ application, and a delphi application. they'll both run on separate machines and talk across a network via tcp/ip. Now, does anyone have any suggestions for where to start?
Thanks.
-Az.
|
|
|
|
|
Does anyone know where I can find more detailed information with examples on using IDiscMaster and related APIs, than they give in MSDN.
Happy programming!!
|
|
|
|
|
Maybe you can find some infomation from some books about Windows API function.
LeonOrient
|
|
|
|