|
How to place a button control over a picture control or some other control
|
|
|
|
|
You mean programatically? Well, you can make the picture control the parent of the button or you can use SetWindowPos to setup a Z-Order in which the button is over the picture control. Also if you choose to do the later, have the WS_CLIPSIBLINGS style set on your picture control.
|
|
|
|
|
The solution was given in your previous post. Dint you try that?
|
|
|
|
|
hi, I am using VS2002 for a client
need to have a round corner combobox VC++/MFC
if Anyone can help?
Thanks in Advance
|
|
|
|
|
This article[^] may help.
Regards,
Sandip.
|
|
|
|
|
Lots of thanks
|
|
|
|
|
Very interesting article; thanks for the link!
|
|
|
|
|
Hi,
I have created an SDI application and created a new class "CMyClass" that is derived from CObject. So I have included the header file "stdafx.h/afx.h " in CMyClass.h. I am trying to create an object of CMyClass in CMyDoc.h and for this purpose I have to include MyClass.h.When I do so and compile I am getting the "warning C4182: #include nesting level is 360 deep; possible infinite recursion" and "fatal error C1076: compiler limit : internal heap limit reached; use /Zm to specify a higher limit".
In order to solve the problem , I have maximum tried to minimize the inclusion of header files. But couldn't.
How to solve this problem?
Thanks in advance.
Taruni
|
|
|
|
|
Taruni wrote: I am trying to create an object of CMyClass in CMyDoc.h and for this purpose I have to include MyClass.h
Possibly you're including MyClass.h in MyDoc.h and viceversa.
you may use
#pragma once
at the top of you header files to prevent multiple inclusion.
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]
|
|
|
|
|
Thank you Pallini.
#program once is already there in all the header files except in MyClass.h.When I tried to include, I am getting the errors
'CMyClass' : is not a class or namespace name
syntax error : identifier 'CMyClass'
syntax error : missing ';' before '}'
syntax error : missing ';' before '}'
.
.
.
.
.
fatal error C1003: error count exceeds 100; stopping compilation
Taruni
|
|
|
|
|
What is the source file the error is given for?
Have you included MyClass.h in that source file?
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]
|
|
|
|
|
In adding to the generated classes for SDI application (all the .h files however has #pragma once statements and all .cpp files have #include "stdafx.h" statements) , I am writing a serializable class(CMyclass) that is derived from CObject. In the MyClass.h file, I am including "stdafx.h" (as the header file for CObject and others) file and in the MyClass.cpp file, I am including "MyClass.h" file .
Upto this point the application compiles nicely. But whenever I include "MyClass.h" in "MyTrialDoc.h" (in order to create a global object of CMyClass) I get that the compiler limit.When I tried to include #pragma once , I got all the errors which I have mentioned in my previous post.
Taruni
|
|
|
|
|
The compiler reports the source file under compilation when the error occurs. This piece of info is important, please post it.
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]
|
|
|
|
|
"The compiler reports the source file under compilation when the error occurs" - Pallini are you speaking of "'CMyClass' : is not a class or namespace name" error?
Taruni
|
|
|
|
|
Instead of placing #include <stdafx.h> in your CMyClass.h, put is as the first line in CMyClass.cpp. That will most likely resolve the problem.
Good luck.
Karl - WK5M
PP-ASEL-IA (N43CS)
PGP Key: 0xDB02E193
PGP Key Fingerprint: 8F06 5A2E 2735 892B 821C 871A 0411 94EA DB02 E193
|
|
|
|
|
Thank you krmed.
I have even tried that. When I tried to include "stdafx.h" in .cpp files, I am getting the error "error C2504: 'CObject' : base class undefined". As the other alternatives I have even tried including "afx.h" and "afxwin.h" . But in vain.
Taruni
|
|
|
|
|
Taruni wrote: So I have included the header file "stdafx.h/afx.h " in CMyClass.h.
Under normal circumstances, there's no need to do this.
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
Was your project compiling correctly prior to creating CMyClass ? What does the stdafx.h file look like? The top of CMyClass.cpp should look like:
#include "stdafx.h"
#include "myclass.h" Do you concur?
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
Thank you David.
If I include those header files in .cpp file, then the compiler generates the error as it doesn't find the header file for CObject in MyClass.h file.Again if I include afx.h (which is usually indirectly included by stdafx.h in MyClass.h file in order to solve, the error "compiler limit: internal heap limit is reached " is once again generated.
Taruni
|
|
|
|
|
Taruni wrote: If I include those header files in .cpp file, then the compiler generates the error as it doesn't find the header file for CObject in MyClass.h file.
Which is why I asked what the stdafx.h file looks like.
At this point, I would create a "dummy" MFC project, and then create your new class via Insert --> New Class. In the Class Type combobox, select Generic Class. In the Derived From box, type CObject . Study the contents of the files created.
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
Hi,
I'm looking for C/C++ programmers interested in developing an opensource antivirus engine.
Done so far: basic virus detection using Aho-Corasick for string searching, clam database, recursive directory searching.
If you are interested please send me an email at: dreamlost88@yahoo.com
Thank you,
Have a nice day!
|
|
|
|
|
That's the wrong forum for such a post. I suppose a better choiche is the Article Requests and Ideas [^] one.
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]
|
|
|
|
|
Why you dont make it yourself?
|
|
|
|
|
|
You have to use an external pictures hosting site for that (see for instance imageshack or flickr).
|
|
|
|