|
noticed (with some help from inside sources) that in the problem is with the compiler for some odd reason it doesn't like creating a 3rd variable of string in Animals.
I moved weight be to be first and name was last (3rd) then it showed Bad ptr message in the debugger.
its a very strange error....
|
|
|
|
|
Sivyo wrote: In main() you have
goldfish -> setName(name);
but in class Animals you have
string setName(string &name){return m_name = name;}
I think your setName() definition should read:
string setName(string name){return m_name = name;}
Also as mentioned previously there is little to be gained in the setXXX() functions in returning the parameter values. Using void return types is better as:
void setName(string name)
{
m_name = name;
}
|
|
|
|
|
I think there's nothing wrong in his method signature.
Why should he pass the string by value?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Yes, the old brain only working on one cylinder...confusing string with char*.
|
|
|
|
|
noticed when moving around the protected names...
protected:
string m_weight;
string m_name;
string m_gender;
the problem moves to gender. ect...
very very strange
|
|
|
|
|
Even stranger ... I have copied your code, compiled and run it and it works perfectly! May I suggest the extracts you have posted lack some information relevant to the problem.
|
|
|
|
|
|
What do you mean by lock?
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Sometimes you just have to hate coding to do it well. <
|
|
|
|
|
Send the EM_SETREADONLY [^] message to the edit box.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
How to create an HBITMAP from a window's HDC?
|
|
|
|
|
CreateCompatibleBitmap [^].
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
NO, I want that it is like the LoadBitmap function.
|
|
|
|
|
vcguileaner wrote: NO, I want that it is like the LoadBitmap function.
What do you mean? Do you want to copy the window client area to a bitmap?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
|
See, for instance, here [^].
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
i want to get an HBITMAP like LoadBitmap function.
|
|
|
|
|
Well, the sample code in the link I provided, shows how to.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
it writes an image file rather than returns an HBITMAP.
|
|
|
|
|
What a lazy guy you are: if you stop copying from the sample code just before the following lines
GetObject(hbmScreen,sizeof(BITMAP),&bmpScreen);
Then you have your requested HBTIMAP and no more.
BTW: The image file was for free
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Now, now - there's no need to shout.
|
|
|
|
|
At first you should learn what this handles and the beloved BITMAPINFO are representing and than you can use CreateCompatibleBitmap() and GetDiBits()
Press F1 for help or google it.
Greetings from Germany
|
|
|
|
|
How to do?
|
|
|
|
|
|
Hi,
I am using GLUI Ver 2.3.5 for my project.I need to implement password field (i.e., the characters should be shown as *******).Please suggest if this can be implemented using glui ver 2.3.5.
Thanks in advance,
Govind
|
|
|
|
|
What does this have to do with C/C++/MFC. Please go to the GLUI website and ask for help.
|
|
|
|