|
Most welcome...
|
|
|
|
|
Why aren't you using COleDateTime::ParseDateTime() ?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Hi all,
i am working on a application so in that application i have to add a facility for sheduling.
problem: i have to run a exe at the given time such 11pm, weekly,monthly etc.
i am thinkin its not possible with ontimer event but idont know i am right or not.
please tell me how it is possible.
i want some such type of application for study so please help me.
thanks & Regards
Bankey
|
|
|
|
|
Banks K wrote: its not possible with ontimer event
You can of course do it in the OnTimer event but that won't be a good idea. You should use a thread which executes itself evey minute.
Banks K wrote: please tell me how it is possible
When the OnTimer event is fired, you can get the current system time and date using GetSystemTime.
If the values in the structure for GetSystemTime match with what you have, You can execute your exe.
Alternatively you can also use a dedicated thread for this task and check if the system time is according to the values that you need. If values match execute your application.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
actually i don't want to use ontime event,
i want to know how system clock is working because this clock is working also when system shutdown.
i want to make same application which match with system clock.
|
|
|
|
|
It sounds like you need a service instead. Otherwise, your applicaton would only be running when someone was logged in. In it, set a timer for every minute. When the timer event fires, check through the list of scheduled jobs to see if any need to be started.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
hi,
i want to know of how to access the state of a checkbox(whether checked r unchecked)in a dialogbox to another dialogbox.
plz help me out!!!!
zari
|
|
|
|
|
for check a checkbox you can use of GetCheck and its in another dialog you can use of
<br />
CMain *m_Main=(CMain*)GetParent(); <br />
m_Main->yourbutton.GetCheck();<br />
|
|
|
|
|
Do you know how to access member's of one dialog from another.
If yes,
You can assign a variable to the check box and then use GetState() to access the state whether checked/unchecked
If not,
You can pass a pointer of the first dialog in the second dialog and then do GetState();
You can use GetParent() also.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
By using the GetCheck() method. It will return one of three "state" values.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
hi,
can anybody tell how to convert CString to LPCSTR
thanks
cheers
|
|
|
|
|
CString myStr("Anshuman");
LPCTSTR pStr = myStr;
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Hello!
CString mfc_str = "Hello world";
char * c_str = (char *) (LPCTSTR) mfc_str;
LPCSTR c_str1 = (LPCSTR) mfc_str;
modified 8-Mar-17 3:52am.
|
|
|
|
|
Wrong. Please don't suggest casts as the first solution, without knowing what they're doing.
From the question, you can tell that the program is being built for Unicode (otherwise CString would convert to LPCSTR automatically since LPCTSTR == LPCSTR in MBCS builds). In a Unicode build, casting LPCTSTR to char* will be disastrous.
|
|
|
|
|
PasNad wrote: can anybody tell how to convert CString to LPCSTR
If you have UNICODE build environment ( i.e _UNICODE is defined )then you will have to do the following
USES_CONVERSION;
LPCSTR lpcstrNonUnicode = W2A(( LPCTSTR )csStringToConvert ); If you have a non UNICODE ( i.e. _UNICODE not defined ) build environment
Then just a simple assignment is needed...
LPCSTR lpcstrNonUnicodeString = csStringToConvert;
|
|
|
|
|
|
I am trying to write a program to get list of files in a folder sorted by created Date and Time. Is there a function to do the same.
Can anyone reply me on this......
Thanks
|
|
|
|
|
Does WIN32_FIND_DATA suits your needs;
typedef struct _WIN32_FIND_DATA {
DWORD dwFileAttributes;
FILETIME ftCreationTime;
FILETIME ftLastAccessTime;
FILETIME ftLastWriteTime;
DWORD nFileSizeHigh;
DWORD nFileSizeLow;
DWORD dwReserved0;
DWORD dwReserved1;
TCHAR cFileName[MAX_PATH];
TCHAR cAlternateFileName[14];
} WIN32_FIND_DATA, *PWIN32_FIND_DATA;
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Coder8725 wrote: I am trying to write a program to get list of files in a folder sorted by created Date and Time. Is there a function to do the same.
Can anyone reply me on this......
There is an API CompareFileTime . Along with this API you can use GetFileTime API to get the time of the two files.
Take a look at qsort for sorting.
|
|
|
|
|
I get txt files to upload into my system
say
1) 00002.txt 01/11/2006 11:00 AM
2) 00001.txt 01/11/2006 10:00 AM
3) 00003.txt 01/11/2006 11:10 AM
I need to pick files by time and upload in the order 2) then 1) then 3)
Number of files is not limited.
I am currently using FindFirstFile and FindNextFile and the DWORD as mentioned in the other post. But this sorts by FileName.
|
|
|
|
|
Coder8725 wrote: I am currently using FindFirstFile and FindNextFile and the DWORD as mentioned in the other post. But this sorts by FileName.
Not necessary, you can use FindFirstFile and FindNextFile to get file information ( which is better than GetFileTime ). Then sort them based on the file creation time.
Use CompareFileTime .
qsort also helps. You can specify a custom compare function callback and just return the value returned by CompareFileTime from this callback function because that is what qsort expects.
|
|
|
|
|
i am using the IMessenger2 interface, when i try to get my contacts, i see the number returned is 0 (it doesn't happened on every computer , it occured 3 out of 10 i've tested).
why is that? i must add that my messenger is online and i have plenty of contacts...
can any1 help?
thanks
Yaron
Interface basics click here :
http://www.codeproject.com/com/COMBasics.asp
don't forget to vote
|
|
|
|
|
|
Is WM_CTLCOLORBTN helpfuls
|
|
|
|
|
WhiteSky wrote: Is WM_CTLCOLORBTN helpfuls
This won't work for buttons...
|
|
|
|