|
In control timer is organised as following.
according MSDN ATLButton:
Contol need be killed (UNLOAD) as fast as possible,
but timer usualy waits until last period finished:
parallel thread is slept for timer period and that called need method:
[code]
//interface must marchalled between threads
if (m_pStream)
hRes = CoGetInterfaceAndReleaseStream(m_pStream, *piid, (void**)&m_spT);
while(m_bTimerOn)
{
Sleep(m_dwTimerInterval);
if (!m_bTimerOn)
break;
//timing call
m_spT->_OnTimer();
}
[code]
Is there more fast or asyncronious methods of killing timer?
in that case if I call terminateThread - error happens.
Why so?
|
|
|
|
|
dont use sleep for your time... use SetTimer and KillTimer
Don't try it, just do it!
|
|
|
|
|
|
My ATL ActiveX is windowless(!),
no window with timer - except need to create additional for that.
(made on the base MSDN ATlButton)
I will read artilce -thanks you.
But have any timer code for not Window?
|
|
|
|
|
With what event to syncronize SuspendThread();?
How to set time interval ?
|
|
|
|
|
I have a dialog box which has several buttons and when I click one he button the following code is executed:
void CtimDlg::OnOk2()
{
RunUtility("tricrrx.rtss"); // runs my program called tricrrx.rtss
}
Works perfectly ok....
But,
When I close the dialog box, by clicking the [x] in the dialog box, the dialog box doesnt close, but instead works as if the above button (Ok2) is clicked i.e., runs my program once again..
what should do to overcome this?
Thanks,
Deepak Samuel
|
|
|
|
|
You've got your ::OnOk2() function mapped to the IDCANCEL dialog id.
This gets called when the user clicks the default Cancel button, or the Close Icon in the top right corner of your dialog.
The quickest solution I can see is to remove this function (using classwizard), then try again.
"..Even my comments have bugs!"
Inspired by Toni78
|
|
|
|
|
Hi,
I have a set of ranges, and individual values.
e.g. [0,100], 202, 203, 205, 230, [235, 10000] ...
I need a container to store them, with as-quick-as-possible test if a certain value is contained in the list (e.g. 42 would be in, 203 would be in, 206 would be out)
any ideas which I could (ab)use?
"Der Geist des Kriegers ist erwacht / Ich hab die Macht" StS
sighist | Agile Programming | doxygen
|
|
|
|
|
why not using a STL list?
Don't try it, just do it!
|
|
|
|
|
How can I get the main window of a process when I have get the process's handle or process ID in windows 2000?
Leon
|
|
|
|
|
Take a look at Paul DiLascia's CMainWindowIterator class.
HPS HwndSpy - GUI developer's aid to visually
locate and inspect windows. For the month of August
only, use coupon code CP-81239 for 30% off.
|
|
|
|
|
EnumWindows - It give you all the windows for the process
"It was when I found out I could make mistakes that I knew I was on to something."
-Ornette Coleman
|
|
|
|
|
hi all can anybosy throw some light in %ws formatting option in printf.
TIA
tarun
Blue Pill or Red Pill........??
|
|
|
|
|
There is no such thing, AFAIK neither %w nor %ws are standard replacement markers. Are you thinking maybe of %ls ? That inserts a Unicode string, zero terminated.
--Mike--
Ericahist | Homepage | RightClick-Encrypt | 1ClickPicGrabber
Latest art~!@#2rDFA#@(#*%$Rfa39f3fqwf--=
NO CARRIER
|
|
|
|
|
hi,
i went across this printf formatting options and on some googling i came across that it is ANSI C formatting options which specifies the width of string also.
i have seen some MS samples which are displaying this output format.
even i was able to do this using sprintf();
but the probelm is i do not know the details of this thing.
regards
tarun
Blue Pill or Red Pill........??
|
|
|
|
|
|
Dear All,
I am developing an application in MFC VC++ Version 6.0 for Windows 2000.
I want to check existence of a file in my application eg. i want to check whether c:\rohit\abc.txt exists of not
Can any body please tell me the API for this ?
Feel free to ask any further queries in this regards,
Thanks
Rohit Dhamija
|
|
|
|
|
You can do it via FindFirstFile
Specify in the first parameter file name you need to verify
You will get as result INVALID_HANDLE_VALUE if file does not exist
Otherwise, you will get a valid handle & you must close it with FindClose function
|
|
|
|
|
Thanks max,
That was very useful. i got the following sample code from msdn . And it solved my problem too!
define _WIN32_WINNT 0x0400
#include "windows.h"
int
main(int argc, char *argv[])
{
WIN32_FIND_DATA FindFileData;
HANDLE hFind;
printf ("Target file is %s.\n", argv[1]);
hFind = FindFirstFile(argv[1], &FindFileData);
if (hFind == INVALID_HANDLE_VALUE) {
printf ("Invalid File Handle. Get Last Error reports %d\n", GetLastError ());
} else {
printf ("The first file found is %s\n", FindFileData.cFileName);
FindClose(hFind);
}
return (0);
}
|
|
|
|
|
if(0xFFFFFFFF !=GetFileAttributes(filename))
/*file exists*/
else
/*does not*/
Hari Krishnan
|
|
|
|
|
if (_access("c:\\rohit\\abc.txt", 00) == 0)
{
// file exists
}
HPS HwndSpy - GUI developer's aid to visually
locate and inspect windows. For the month of August
only, use coupon code CP-81239 for 30% off.
|
|
|
|
|
You can use PathFileExists(...) from the shell api
if( PathFileExists( strPath ) )
{
}
|
|
|
|
|
_access()
GetFileAttributes()
CFile::GetStatus()
|
|
|
|
|
hi,
i would like to learn about data recovery / undelete.
can anyone please give me links or source code ?
Thanx.
Hari Krishnan
|
|
|
|
|