|
Nothing wrong with it. I just wanted to practice using template and see how it works.
Thanks for the help
|
|
|
|
|
Are you sure your class IS A array, instead of HAS A array ? Don't use CArray, it's crap. Contain a vector, and if you want your class to be an array, expose the methods you need to.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
I'm trying to implement a timer in my UI thread, with a call back. I need 3 timers setup. In order for my timer to work I need to pass a hwnd as part of the settimer function.
Is there a way to convert my m_hThread HANDLE to a HWND so that my timer will work?
Thanks
Tom Wright
tawright915@yahoo.com
|
|
|
|
|
Check out GetGUIThreadInfo() , maybe it helps you.
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04
Within you lies the power for good - Use it! Honoured as one of The Most Helpful Members of 2004
|
|
|
|
|
A thread and a window are totally distinct objects.
If you don't have a window handy, pass a NULL HWND and a non-NULL function pointer to SetTimer() and it will call that function.
--Mike--
LINKS~! Ericahist | 1ClickPicGrabber | CP SearchBar v2.0.2 | C++ Forum FAQ
Strange things are afoot at the U+004B U+20DD
|
|
|
|
|
Tom Wright wrote:
Is there a way to convert my m_hThread HANDLE to a HWND so that my timer will work?
Short answer: No.
Long answer: The SetTimer function is used to tell the system to call a given function (in your process), at set time intervals. You can use the SetTimer function, even if there is no associated window (hWnd=NULL), in which case the nIDEvent has no meaning. What you would use it for, I have no ideas (at this time).
If your timers are all used in just one window, then you can call the SetTimer function once for each event that is required with different event IDs. Then switch on the ID passed to the TimerProc, to determine which timer event has occured. This also applies if you do not provide a TimerProc, in which case you need to handle the WM_TIMER message.
Of cource you could roll your own timer thread that takes the handle to a window and post message back to the window at given intervals. But why bother, when it is built in.
Good Luck!
INTP
"The more help VB provides VB programmers, the more miserable your life as a C++ programmer becomes."
Andrew W. Troelsen
|
|
|
|
|
My problem is that my threads do not have windows. So I do not have a HWND to pass to settimer. The problem with that is that each thread has 3 timers in order for the 3 timers to work I need an nIDEvent to be passed. But this is ignored if I do not have a HWND. So my...hence my delemia. If I pass the HWND of my main app then if one thread kills a timer, then it's killed for all threads....why...I'm thinking that since the HWND and the nIDEvent are the same the message systems does not know which one to effect so it effects them all.
John R. Shaw wrote:
If your timers are all used in just one window, then you can call the SetTimer function once for each event that is required with different event IDs. Then switch on the ID passed to the TimerProc, to determine which timer event has occured. This also applies if you do not provide a TimerProc, in which case you need to handle the WM_TIMER message.
I'm not sure what you mean by this...can you explain some more?
Thanks
Tom Wright
tawright915@yahoo.com
|
|
|
|
|
Tom Wright wrote:
I'm not sure what you mean by this...can you explain some more?
When you are using a timer in a window, you use the nIDEvent parameter to set the event ID. The event ID is passed to the the TimerProc, so that you can determine which timer event caused the TimerProc to be called. For instants you may have an event that occurs every 1 second and anouther event that occurs every 5 seconds. By checking the event ID that is passed to the TimerProc, you can decide what your programm needs to do.
Now as for running a non-windowed thread that needs timer events, well you will probably have to insert code in that thread to check when the individule time periods have passed (manual time interval monitoring). Or you could roll your own timer thread and use one of the WaitFor... functions to check when a times up event to occur.
I know there is an article out there somewhere on rolling your own timer, but I have not looked at it in years, so I do not know where it is.
INTP
"The more help VB provides VB programmers, the more miserable your life as a C++ programmer becomes."
Andrew W. Troelsen
|
|
|
|
|
Does anybody know which *.dll files i have to copy with my program ,which i have compiled in C++.Net with "Release" when i take it to other computer where Microsoft Visula Studio.Net is not installed.
G.Moniava
|
|
|
|
|
two things. One if you try and run your program it will usually tell you what dll's are missing. Two....just link in the runtime dll's and you won't have to worry about it.
Tom Wright
tawright915@yahoo.com
|
|
|
|
|
|
also, keep in mind that Microsof didn't include dlls to run release versions of C++ .NET applications on Server 2003. (you can run release versions of VC6 apps, but not VC7 apps)
Serge
|
|
|
|
|
I have written a class for doing arithmetic operations on big numbers,inherited from CString class.But when i multiply numbers which are longer than 512 digits i get the incorrect result.In other cases i get the correct result.
P.S : i think the promblem is in displaying numbers which are longer than 1024 digit.why ? maybe CString objects can't contain texts longer than 1024 digit??
Can anyone help ?
G.Moniava
|
|
|
|
|
does "digit" = bit or byte?
includeh10
|
|
|
|
|
for example : 1500 is a 4 digit number, 545 3 digit number and etc.
SROCalm
|
|
|
|
|
if so
what do u mean "256 digits"?
int i=928373774848 .......... 382772 ?????
includeh10
|
|
|
|
|
Yes, but not
int i=928373774848 .......... 382772 ?????
i mean
CString s = "928373774848 .......... 382772";
s is text which contains 256 letters
m0n0
|
|
|
|
|
if so, there is no problem, i am sure.
CString can handle much longer than 256.
includeh10
|
|
|
|
|
Do you know approximately how much longer ?
Because this class handles all operations +,-,*,/ and returns the right result . //Only if result (the number) is //less than 1024 digits.
m0n0
|
|
|
|
|
at least 1M, i guess. i used for hundreds of Ks.
includeh10
|
|
|
|
|
According to this[^] thread, a CString can hold up to about 232 characters. I've used it with 64K chunks of text with no problems.
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
Giorgi Moniava wrote:
maybe CString objects can't contain texts longer than 1024 digit??
Wrong. CString objects can store up to INT_MAX (2,145,483,647) characters. This is documented in the CString::AllocBuffer() method.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
It sounds like you need to take a look at the limits of the algorithm you are using to multiply those numbers. You may be overflowing or something like that.
CString is limited to the maximum positive size that can be stored in a 32-bit integer (minus some overhead).
INTP
"The more help VB provides VB programmers, the more miserable your life as a C++ programmer becomes."
Andrew W. Troelsen
|
|
|
|
|
hiho@ll
i have an app which uses skins
and i want to use a hidden button for a tooltip
but it doesn't show!
the tooltip only shows when the button is visible, but this isn't what i want/need
andybody knows a workaround?
thx@ll
|
|
|
|
|
tooltip works with the button's messages of WM_MOUSEMOVE etc.
if the button is invisible, those messages will not be sent to the button, so standard tooltip doesn't work anyway.
you can create ur tooltip for dialog, if mouse moves to the button's position, then show ur tooltip. this is possible only way to do.
includeh10
|
|
|
|