|
Just because it has been declared does not mean it has been defined. Define x in the class' .cpp file. Static members are initialized outside of any class methods (e.g., file scope).
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
First off, Sorry!, Time is running out for me , so out of panic, I wasn't quite listening to you guys completely. I should have put the definition of the static member again in the .cpp. I did it wrong doing it inside the constructor or a function. Now I put it out side the constructor. It's fine now.
<br />
#include <class.h><br />
int class::x;
void class::class()<br />
{<br />
int class::x;
}<br />
void class::func()<br />
{<br />
<br />
}<br />
Thanks, CL, David, viorel, cederic.. and SORRY FOR THE LATE ACKNOWLEDGEMENT . Need to rush.. thanks a lot.
<marquee scrollamount="1" scrolldelay="1" direction="up" height="10" step="1">--[ ]--
[My Current Status]
|
|
|
|
|
Hello!,
I need to code a program that works in UNIX and dos there I can use text color, green, red and so on. How can I do that?
the text I need to put on the screen need to be in color.
|
|
|
|
|
Well, VT/XTerm color codes can be used to write in color to a (supported) Unix console. I would suggest using something like the curses library for that, but it has been quite some time since I did any console-coloring so some other libraries may be around.
If you only need to run the app on Unix but access it from DOS (do you mean a Win32 Console?) and Unix, so that there is only one platform to build for, use curses and connect to it using a terminal emulator that supports ANSI/XCode color codes.
If you need to build for Unix and Windows, I would suggest that you use the Console Functions in Win32 to do coloring in the Windows/Console build.
Peace!
-=- James If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! DeleteFXPFiles & CheckFavorites (Please rate this post!)
|
|
|
|
|
hey that's a cool work to do.. settextcolor() If remember it correctly. I dont know about UNIX though. And I'm talking about Borland C++ complier.
<marquee scrollamount="1" scrolldelay="1" direction="up" height="10" step="1">--[ ]--
[My Current Status]
|
|
|
|
|
In VC :
SetConsoleTextAttribute ( m_hConsole,<br />
FOREGROUND_RED |<br />
FOREGROUND_GREEN |<br />
FOREGROUND_BLUE );
<marquee scrollamount="1" scrolldelay="1" direction="up" height="10" step="1">--[ ]--
[My Current Status]
|
|
|
|
|
Hi All,
How to enter only Hexadecimal values in EditBox in Dialog?
Thanks in Advance.
|
|
|
|
|
Use a masked-edit control. There are several to choose from here at CP. If that is too elaborate for you, derive your own class from CEdit() , and override the OnChar() method. In that method, only allow 0-9 and A-F characters.
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Handle the WM_CHAR and allow only 0-9 + A-F + 'x' .
<marquee scrollamount="1" scrolldelay="1" direction="up" height="10" step="1">--[ ]--
[My Current Status]
|
|
|
|
|
no backspace allowed ?
he will be surprised
|
|
|
|
|
WOW! You live in history? just like Van Helsing? oh man this thread is too old!!
by the way I'm like Google, don't like "deleting" :->
<marquee scrollamount="1" scrolldelay="1" direction="up" height="10" step="1">--[ ]--
[My Current Status]
Link2006 wrote:Let's take it outside of CP
Jeremy : Please don't.I would love to see this.I'm making the popcorn already.
|
|
|
|
|
VuNic wrote: You live in history?
nope, just browsing the forum, searching for a topic, instead than asking for a question that has been asked soooo many times already
|
|
|
|
|
One of the controls I created some time ago supports filtering of input. You can use its implementation as an example of one way to restrict input to a certain set of characters (in your example, "0-9 " and "a-f ", and optionally "x ").
http://www.codeproject.com/editctrl/enhfocusedit.asp[^]
-=- James If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! DeleteFXPFiles & CheckFavorites (Please rate this post!)
|
|
|
|
|
cn u send me an example as i easily undestand
i hav three dialog boxes
third dialog box contain menu
i want that when i goto third dialog box from first dialog box then its menu are disabled but when i go from second dialog box third dialog box menues are not disabled.
plz send me code how to do it
note : specially for viorel
Please mail me
-- modified at 8:40 Thursday 15th June, 2006
|
|
|
|
|
put a flag in the dialog. u should check this flag in the InitDialog. if flag is set, disable the menu.
so before calling the domodal function from the first dialog set this flag.
and when u call DoModal from the second dialog reset the flag..
nave
|
|
|
|
|
CAN U SEND ME SOME EXAMPLE PLZ
Please mail me
|
|
|
|
|
Hi,
I have some problem with this fn.
IMultiMediastream::GetDuration(..);
but this fn. worked well
IMultiMediastream::SetState(STREAMSTATE_RUN);
how to solve this problem
-- modified at 8:08 Thursday 15th June, 2006
|
|
|
|
|
Hi,
Is there any tool that can effectively find out the occurances of memory leaks?
Thanks in advance
Taruni
|
|
|
|
|
|
|
|
try out :-Rational Purifier .
Regards,
FarPointer
Blog:http://farpointer.blogspot.com/
|
|
|
|
|
there are proffessional licensed tools like Numega Bounds Checker and inte vtune performance analyser.
SaRath.
"Don't Do Different things... Do Things Differently..."
Understanding State Pattern in C++
|
|
|
|
|
Search for AQTime and Rational Purify
Cheers
"Peace of mind through Technology"
|
|
|
|
|
I use BoundsChecker from NuMega, but VC6 had functions of detecting memory leaks and there are some articles on it at CP. The best solution I found (non-group) was to put a TRACE command (that is a macro in VC6) before every allocation (new, malloc, etc...) and deallocation (delete, free, etc...) in your program. That includes constructors and destuctors in your classes, that way you know if you are the source of the leak or one of the libraries is. Use your imagination and you will find there are many ways to discover such problems; including appending the results to some file.
INTP
"Program testing can be used to show the presence of bugs, but never to show their absence."Edsger Dijkstra
|
|
|
|