|
Which is incorrect. Remove the call to GetDlgItem() .
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
David,
It works on both ends, referencing the GetDlgItem was my problem.
Thanks a lot....
|
|
|
|
|
C++NewBe wrote:
It works on both ends...
Both ends of what?
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
|
This works fine in v6. It must be something specific to v7.x, or you have other code in place that is masking the problem.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
SetWindowText(...) will work i suppose.
God is Real, unless declared Integer.
|
|
|
|
|
Can someone please verify that if a derived class redefines a protected virtual function from the base class it must be redfined as a public member in the derived class. So for instance,
class Core {
protected:
virtual double grade(double) const;
};
class Grad: public Core {
public:
double grade(double) const; // OK, it's public.
protected:
double grade(double) const; // NOT OK!
};
If true, can you please provide the logic behind this? Otherwise, why is VC++ 6.0 complaining?
THANKS!! Much obliged!
Matthew
|
|
|
|
|
It's not true. Otherwise, what would be the point of a protected virtual function if you had to make it public?
If you remove the public version from Core it should compile.
|
|
|
|
|
There is no public version in Core, only a protected version. The example shows a redefined function in Grad: one version is public and one protected. They are mutually exclusive. I only put them both there for the example.
Matthew
|
|
|
|
|
This compiles
class Core {
protected:
virtual double grade(double) const;
};
class Grad: public Core {
protected:
double grade(double) const;
};
Nevertheless its better to keep in the declaration
virtual double grade(double) const;
cos maybe ull have another level of derivation
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
Thanks! I found the problem (but don't quite understand it). It's related to a clone function that I had in my derived class. When I remove the private clone function I get a clean compile. From Accelerated C++:
The return type for the clone function in class Grad must be changed to be a Core* rather than a Grad* as written in the book:
#ifdef _MSC_VER
Core* clone() const { return new Grad(*this); }
#else
Grad* clone() const { return new Grad(*this); }
#endif
because VC++ 6.0 does not yet allow a virtual function returning a pointer (or reference) to a base class to be defined in a derived class to return a pointer (or reference) to the derived type.
Matthew
|
|
|
|
|
helloo all gr8 programar i ahve little problem
i want to change via programming ip address,hostname,dns name,default gateway of computer
i tried using registry but failed it no helping, ineed a solid programmin code that help me.
it my challenge to all gr8 vc++ programmer
Alok Gupta
visit me at http://alok.stormpages.com
|
|
|
|
|
I have a dialog application with a list control and a edit control. I am trying to write float values to the controls, or to at least one of them, at run time. I dont know how to do this. Can someone help me out?
Jerry
|
|
|
|
|
double d = 12.34;
char s[32];
sprintf(s, "%f", d);
edit.SetWindowText(s);
list.AddString(s);
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
|
U can use
SetWindowText for this
example
float b=.343;
CString o;
o.format("%f",b);
johnsb2->SetWindowText(o); //where johnsb2 is CEdit
Bye
Hopes this help u.
krishnadk
|
|
|
|
|
Hai guys
I have a new idea for compressing files.. it work as follows
Example:
samlpe text : "something is better than nothing"
first s is placed first letter as usual now i will find the difference between s and o and only that difference is placed and so on..
How is this idea
pls respond if u understand what i said(my language is poor .
i know it).
bye
krishnadevan
krishnadevan@ushustech.com
mail to me if u interested...
any new ideas also welcome..
krishnadk
|
|
|
|
|
It seems to me its a substitution and not a compression
am i wrong?
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
Hum...
And how will the text compressed ???
You will need to store the difference between the two characters and this will be stored in a 1 byte type (can be more if you use integers but then you increase the size of your file !!!!).
So, you will store 1 byte instead of 1 byte. There is no compression at all and you will lose a lot of time for nothing
|
|
|
|
|
Size of the data for string difference may be less than 1 byte.
|
|
|
|
|
Yes it could but to go from the lowest letter to the highest letter it will have to be as many bits as the letters anyways. You could use some type of encding to save bits for the differences using some type of average difference and making these ther shortest code but I'd bet this will not help as the differences between letters looks distributed to me.
John
|
|
|
|
|
|
I agree as this will not save anything because differences have to be as big as the values.
John
|
|
|
|
|
I Will answwe to ur question
First u can use 6 bits for storing the difference.one thing understand that i now think on it. this some raw idea.
come to the idea
Out of 6 bits 3 bit u can use for the range.. that is using 3 bits u can represent from 1-7. when i find the difference is 72 i the bits is something like this 111010 . first 3 bits is 10 ^ that number. then it is added with 2 that is 010. then we get 111010.
Similarly for 65 bits like 110101 ..
now we can save 2 bits.. . For big file it may compress.
Also we can do this repeatidly ..
Then the final result will be small file(I hopes.. I should do this): )
bye
KD
krishnadk
|
|
|
|
|
I Will answer to ur question
First u can use 6 bits for storing the difference.one thing understand that i now think on it. this some raw idea.
come to the idea
Out of 6 bits 3 bit u can use for the range.. that is using 3 bits u can represent from 1-7. when i find the difference is 72 i the bits is something like this 111010 . first 3 bits is 10 ^ that number. then it is added with 2 that is 010. then we get 111010.
Similarly for 65 bits like 110101 ..
now we can save 2 bits.. . For big file it may compress.
Also we can do this repeatidly ..
Then the final result will be small file(I hopes.. I should do this): )
bye
KD
krishnadk
|
|
|
|