|
enne87 wrote: which displays for how long my application is running since I compiled it.
A - how long it's been since you compiled it + how long it's been running ?
or
B - only how long it's been running ?
It's confusing.
for A, you can get the time the executable file was created + the time the application is running (B).
for B, when the application starts, keep the current time ( with time ) and at each WM_TIMER trigger, get the current time, and compare with the one you kept earlier; do some simple time math and set the text to the window
|
|
|
|
|
I see, thanks for the great help guys
|
|
|
|
|
See here for a detailed discussion on time in Windows.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
|
Ok, thanks much guys
|
|
|
|
|
Hello,
I'd like to create a simple exe file with evc++, that when run, will Delete a certain folder / file in the ppc root directory. Can someone help me with this?
Would also like for it to work on both 2330 and WM5 devices.
Thank you in advance!
ZapMe1
|
|
|
|
|
use DeleteFile() API or SHFileOperation Function, both are supported under windows ce.
Good Luck,
Mohammad
And ever has it been that love knows not its own depth until the hour of separation
|
|
|
|
|
Thank you for the fast reply, Mohammad. I actually would like to delete a subfolder that will contain 1-3 files.
I'm sorry, I'm very new at this. Can you please give me an example?
Thank you!
ZapMe1
|
|
|
|
|
lets assume that ur subfolder is named '\\MyFolder':
WIN32_FIND_DATA fd;<br />
CString MyFolder =_T("\\MyFolder\\");<br />
HANDLE hFile = FindFirstFile(MyFolder +_T("*.*")), &fd);<br />
while(hFile != INVALID_HANDLE_VALUE)<br />
{<br />
if(!(fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY))
{<br />
DeleteFile(MyFolder + fd.cFileName);<br />
}<br />
<br />
hFile = FindNextFile(hFile, &fd);<br />
<br />
}<br />
<br />
FindClose(hFile);
I did not test the code, but it gives the idea..
Good Luck,
Mohammad
And ever has it been that love knows not its own depth until the hour of separation
|
|
|
|
|
Thank you for that Mohammad, but not having luck getting to compile.
ZapMe1
|
|
|
|
|
Ok I know that there are a couple of ways to convert a unicode string to ascii, however I need to read from UNICODE file necessary info then convert it to ASCII and write it to a normal .log file.
I believe that when i do the following:
while(!file_in.eof()) <br />
{<br />
file_in.getline(str,2000);<br />
file_out << "\n" << str;<br />
}<br />
file_out << endl;
I know i need to do my conversion from UNICODE to ASCII within the while loop... but i believe that will cause an issue since getline() will try to do it's own conversion when reading from UNICODE file...
I believe i need to do is read in UNICODE from UNICODE file and store it within UNICODE variable. Then convert it to ASCII and then write it normally...
|
|
|
|
|
You must load the UNICODE text file into UNICODE strings:
<br />
wchar_t str[2000];
Then you need to load the UNICODE text from the file. I am not sure if the STL libraries handle this correctly...? I know they don't handle unicode filenames, but that's another topic.
After you load it, then you need to convert this to ANSI
<br />
USES_CONVERSION;<br />
file_out << "\n" << W2CA(str);<br />
Unfortunately, you'll run into a snag. The STL libraries are lame at handling unicode text in files. I take it you don't control these files -- I'd write them as UTF-8 format if I could. So much nicer...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
Peter Weyzen<br />
Staff Engineer<br />
<A HREF="http://www.soonr.com">SoonR Inc.</A>
|
|
|
|
|
I wouldn't attempt doing this line by line, those conversion functions can be a real system hog sometimes. In your situation I would read the entire file into a buffer first, the convert it all in one swoop.
|
|
|
|
|
I wrote an article[^] that talks about this kind of thing.
As another poster said, the best thing would probably be to read it as binary data into a buffer and convert it from there.
0 bottles of beer on the wall, 0 bottles of beer, you take 1 down, pass it around, 4294967295 bottles of beer on the wall.
Awasu 2.2.3 [^]: A free RSS/Atom feed reader with support for Code Project.
|
|
|
|
|
|
In every file in my large project, when I attempt to create a Release Version, I get the following error:
fatal error C1853: 'Release/ios.pch' is not a precompiled header file created with this compiler.
Clicking on this error goes back and points to the StdAfx.h (the first header file in every .CPP)
I searched your database but did not find this particular problem. Can anyone tell me what's going on, or tell me where to look to figure this out. BTW, the Debug version has no errors and no warnings (warnings set to level 4).
Thanks for your time.
John P.
|
|
|
|
|
Does your project have any .c files? Have you tried removing the .pch file and doing a Rebuild All?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
No, I don't have any 'C' files. I did a rebuild all and now it's complaining that it can't find include files that it could find in Debug mode? That makes a lot of Microsoft sense!
Thanks for the assistance, David. I'm going to'import' these files into the project just to make sure.
John P.
|
|
|
|
|
|
Main window of my SDI application generates a modless dialog which can be displayed and hide using menu options in parent window. this modeless dialog on certain options also generates a modal dialog, now when the modal dialog is active and i hide its parent ie modeless dialog from main sdi window only the parent modeless dialog hides whereas modal dialog remanis visible and doesnot hides. since it is child of modeless dialog it should also hide but it wont.
|
|
|
|
|
When the modeless dialog is hidden, hide the modal dialog.
There is a message ( WM_SHOWWINDOW ) that tells you a window is shown or hidden.
|
|
|
|
|
|
Hello All,
We are upgrading our server from NT to Windows 2000 or 2003. We have following components running on that server.
1) Citrix Servers.
2) Shared Memory running as Windows service.
3) Our Application.
Application is configured to run as components of Citrix servers. Our application uses IPC calls like OpenFileMapping to Windows Service in order to access shared Memory address. In NT when the Citrix client connects with anyomous user to server which was able to access the windows services which was running with different user id which contain shared memory data. But in windows 2000/2003 application is not working as similar to Windows NT. It clearly indicate it is just permission issue. Can anyone help me to resolve this issue. We are using Windows SDK functions for creating Shared Memory files.
Thanks,
Renga.
|
|
|
|
|
hi,
I want to determine the associated program with a file extension, I am targeting windows ce
I want to do this in two ways:
1. I want to know program name (for mp3: 'Windows Media Player')
2. Program path. (for mp3: 'c:\program files\...\mediaplayer.exe')
I want to use these information to create an 'open with' dialog box for windows ce.
are there any shell functions or should I read directly from the registry??
Mohammad
And ever has it been that love knows not its own depth until the hour of separation
|
|
|
|
|
What about FindExecutable() or AssocQueryString() ?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|