|
Do you have a copy constructor and are you copying all the members inside of it as well?
1. I will develop myself to the maximum of my potential in all ways
2. I will look for the good in all people and make them feel worthwhile.
3. If I have nothing good to say about a person, I will say nothing.
4. I will always be as enthusiastic about the success of others as I am about my own.
5. I will always remain loyal to God, my country, family and my friends - Chuck Norris
Ernest Laurentin
|
|
|
|
|
piul wrote: However, the value in m_a is not correct! It gets a random value.
Where/how are you verifying this?
I tried your code, and the CData object in the list did indeed contain the value 10 for the m_a member variable.
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
I am able to display a bitmap using bltblit() function.
Now i have a raw image buffer. I want to display this data to my window using the device context.
I have the current HDC.
should i have to create a bitmap from this raw buffer.
Please help me.
|
|
|
|
|
I guess it depends on the raw image buffer format.
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
|
|
|
|
|
What is the solution for this problem?
|
|
|
|
|
As I've already pointed out, knowledge of the raw image data format maybe a good start.
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
|
|
|
|
|
I am not getting your point.I have a 800 x 600 x 4 RGBA raw image buffer.
I want to display this on current HDC.
My question is should i have to create a bitmap for this buffer and then should i use bltblit () function.
Curently i am able to display a bitmap on current HDC.
Please elaborate your idea in little details.
Thanks,
Soumyadipta De
|
|
|
|
|
Soumyadipta wrote: My question is should i have to create a bitmap for this buffer and then should i use bltblit () function.
Yes.
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
|
|
|
|
|
Is there is any other alternative other than creating a bitmap?
Thanks,
Soumyadipta De
|
|
|
|
|
IMHO nope. But there are a lot of tutorials about.
Have a look at GDI articles here at CP .
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
|
|
|
|
|
Thanks for you help.But i am not understanding one thing that, if it's not possible to do this in any other way then what you are suggesting to find me in the GDI tutorials?
Thanks,
Soumyadipta De
|
|
|
|
|
How to build 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
|
|
|
|
|
Is there any freeware tool to find out only GDI leaks in a project.
Can anyone tell me the occurances of GDI leaks.
modified on Tuesday, May 20, 2008 1:30 PM
|
|
|
|
|
Well you can use of Task Manager it displays GDI resources for each process.
|
|
|
|
|
|
Using Visual C++ 6.0 MFC in SDI application
I'm relatively new to C++ (from C). In an application using Visual C++ MFC, I setup a menu item. When that menu item is selected, my code calls the following routine that was setup by Visual C++
CMainFrame::ShowTheCircle()
{
// has my code here...
}
I want to perform this identical operation from another place in my code, which is in a separate .cpp file. I don't understand how to call the ShowTheCircle function from this other place.
void MyCode(void)
{
// call the ShowTheCircle function just as if the menu item was
// selected
// thanks for your help!
}
|
|
|
|
|
One way would be to make ShowTheCircle() a static method. Another would be to make it not part of the CMainFrame class.
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
void MyCode(void)
{
CMainFrame *pWndMainFrame = dynamic_cast<CMainFrame *>(AfxGetMainWnd());
pWndMainFrame->ShowTheCircle();
}
provided CMainFrame is the class for the main frame window of the application.
|
|
|
|
|
ShowTheCircle is a method of CMainFrame class, therefore to call it you must have a reference (or a pointer) to a CMainFrame object, for instance
CMainFrame * pMainFrame = (CMainFrame *) AfxGetMainWindow();
CMainFrame * pMainFrame = (CMainFrame *) AfxGetMainWnd();
pMainFrame->ShowTheCircle();
Note that ShowTheCircle must also be declared public .
BTW what about a good C++ tutorial?
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
modified on Tuesday, May 20, 2008 2:58 PM
|
|
|
|
|
Thanks to all for the help. The function in your reply should have been AfxGetMainWnd() and not AfxGetMainWindow() but I found things. Everything worked great!
|
|
|
|
|
Kwanalouie wrote: Thanks to all for the help.
You're welcome.
Kwanalouie wrote: The function in your reply should have been AfxGetMainWnd() and not AfxGetMainWindow()
Of course. Fixed: thank you for pointing out.
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
|
|
|
|
|
hai,
what is the difference between bool and BOOL?
reply me..
Born to win...!
|
|
|
|
|
bool vs BOOL[^]
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
bool is a C++ keyword, BOOL a Microsoft alias for int :
typedef int BOOL;
Any variable declared bool can assume only the following two values: true or false , moreover C++ conditional expressions evaluates to a bool result (true or false ). On the other hand, a BOOL variable is a fully qualified int and hence can assume any numeric value an int can (MSDN suggest: it should be either TRUE or FALSE ).
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
|
|
|
|
|
CPallini wrote: typedef int BOOL
not really
maybe
|
|
|
|