|
Best place I feel, you can handle is in CWinApp::OnFileNew .
Your code could look like this,
void CMDIApp::OnFileNew()
{
if (success)
{
CWinApp::OnFileNew();
}
else
{
}
}
|
|
|
|
|
Thank you very much for great help!!
Best Regards,
Suman
|
|
|
|
|
Hi
I want my application to convert to unicode support so for this is it necessary to convert all char data type to TCHAR and after conversion my application will it support ASCII characters?
Thanks and Regards
M.Atul
M.Atul
|
|
|
|
|
|
You should define both UNICODE and _UNICODE . The former is for the Windows include files and the latter for the CRT. See here[^].
Steve
|
|
|
|
|
To add to Leah_Garrett's reply...
If you use TCHAR types and the associated string functions (_tcscpy(), _tcscmp(), etc.) you'll
be able to use the same code for both unicode and non-unicode builds.
You can still use single-byte ASCII ("char" type) in a unicode build but you'll need to use the
type explicitly.
Mark
|
|
|
|
|
Hi to all,
i'm new of that forum, it's my first post!
well, i have an array (of integer) with only 8 elements: i need to use merge sort on this array, to find merge sort order time! Sure it's very very small..! I try to use this code:
#include "time.h";
clock_t start, end; double time;
...
start = clock();
mergesort(...);
end = clock();
time = end - start /CLOCKS_PER_SEC;
on VC++ 2005 but the vaue of var. time is 0 (can merge sort be too fast to find order time by this code??).
I can't enlarge array (to have a bigger order time), so how i can do to find order time?
Thanks a lot,
Luca
|
|
|
|
|
I think it is better to use the Win32 function GetTickCount() .
--------------------------------
"All that is necessary for the forces of evil to win in the world is for enough good men to do nothing" -- Edmund Burke
|
|
|
|
|
I think GetTickCount() has the same resolution as clock(). Alot of sorting can get done in
1 millisecond.
|
|
|
|
|
My apologies. I'll go slink back into my hole.
--------------------------------
"All that is necessary for the forces of evil to win in the world is for enough good men to do nothing" -- Edmund Burke
|
|
|
|
|
Richie308 wrote: I'll go slink back into my hole.
Nah....just pokin fun
I wish I knew how to do this actually. I suppose you'd need to be able to get the CPU clock rate
for the machine, which processor type, how many cycles each machine code instruction used takes,
and how many iterations of those codes for the given sort. My head hurts thinking about it!
Cheers,
Mark
|
|
|
|
|
It's tough to measure that small of a time span on a PC.
If your platform is Windows, you could check out GetThreadTimes() API. This will be more accurate
because time spent on other threads isn't included. I'm not sure what the true accuracy is though.
I'm pretty sure there are no clocks on a PC with enough accuracy to measure your sort time.
10ms to 55ms is about the best precision, and that's a mighty long time in CPU cycles these days.
Mark
|
|
|
|
|
Also
QueryPerformanceFrequency() and QueryPerformanceCounter() if your machine supports it.
-- modified at 20:07 Wednesday 6th December, 2006
*Edit* QueryPerformanceFrequency() returns 3192270000 counts/sec on my machine. That sounds
pretty accurate
|
|
|
|
|
thanks to all, but i don't know where to find functions in yours answers ( as GetThreadTimes() API )! I'm using C++ but i know only C... How i have to set VC++ to use them??
p.s.: my OS is win XP
|
|
|
|
|
I guess you never said you were using Windows.
clock() is in the C runtime (time.h) so doesn't need Windows.
The others are part of Windows:
QueryPerformance functions and GetTickCount() are in windows.h/Kernel32.lib.
Mark
p.s. Thanks to whoever posted the QueryPerformance function link here a while back.
After rambling here about PCs not having the resolution I remembered the post and had to dig
through my favorites/bookmarks (which I now remember need a serious organizing).
|
|
|
|
|
Mark Salsbery wrote: I guess you never said you were using Windows.
Does VS2005 exist on any other platform?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
DavidCrow wrote: Does VS2005 exist on any other platform?
Beats me, but I try not to assume, even though I do all the time.
|
|
|
|
|
lzzluca wrote: can merge sort be too fast to find order time by this code??).
Any sort is fast when only eight items are involved.
lzzluca wrote: I can't enlarge array (to have a bigger order time), so how i can do to find order time?
Why exactly do you need it? A sorting algorithm's time is only relevant on a particular machine. Move to a faster machine and the performance improves, but the number of comparisons/swaps does not change.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
I'm a student! My teacher gave me a project to do for an examination: i have to compare merge sort and quicksort, using an 8 elements array... So, seems good to have order time of merge and quick sort on the same array! Or not?
|
|
|
|
|
lzzluca wrote: So, seems good to have order time of merge and quick sort on the same array! Or not?
No, time is not a very useful number, especially when comparing sorting algorithms. Consider the result if you ran merge sort on computer A, and quicksort on computer B. Unless the two computer were identical, your results would obviously be skewed.
Surely your teacher has gone over big-O notation in the context of "benchmarking" algorithms. Those numbers do not change no matter what computer platform you use.
In any case, if you still need to time them, you'll need to explain to your teacher that the smallest resolution Windows will give you is 10ms, so both algorithms, sorting 8 items, will appear to complete in 0 seconds.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
This isn't of a whole lot of help but more food for thought.
Time is the Simplest Thing...[^]
I'd love to help, but unfortunatley I have prior commitments monitoring the length of my grass. :Andrew Bleakley:
|
|
|
|
|
What determines the Name property of a proxy server that I am developing in Win32?
For instance, the proxy settings in Internet Explorer ask for a Name and port number. Well, the port number depends upon which port I bind my listening socket to, but what determines the "Name?"
--------------------------------
"All that is necessary for the forces of evil to win in the world is for enough good men to do nothing" -- Edmund Burke
|
|
|
|
|
Richie308 wrote: but what determines the "Name?
I guess its the IP address or DNS name of the machine running the proxy
System.IO.Path.IsPathRooted() does not behave as I would expect
|
|
|
|
|
But what if you have more than one proxy running on a single machine?
--------------------------------
"All that is necessary for the forces of evil to win in the world is for enough good men to do nothing" -- Edmund Burke
|
|
|
|
|
Then it must be listening on a different port not a different name.
led mike
|
|
|
|