|
actually i wan to create a .cpp file to the project. Is it possible to create an additional .cpp file with the basic code and working just like when i use the mfc wizard exe.
Can i do it by creating a new class for custom control?
i'm using a dialog based application.
|
|
|
|
|
you can do it by clicking new->source file and then you create an empty .cpp file
but you must include the file StdAfx.h if you want to go on.
is it right?
just do it
|
|
|
|
|
actually i wan to create a .cpp file to the project. Is it possible to create an additional .cpp file with the basic code and working just like when i use the mfc wizard exe.
Can i do it by creating a new class for custom control?
i'm using a dialog based application.
|
|
|
|
|
The appwizard can set up a class associated with a dialog template for you. Beyond that, I'm not sure what you're hoping for, the wizard can't do much more for you, as there's not much more boiler plate code to be had.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
You can use AppWizard to create an empty .cpp file, or you can use ClassWizard (Ctrl+W) to create a class derived from some other class. Either way, the file is added to the project.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
I have overridden the OnPaint() API in a dialog based application to give the dialog box a rounded rect shape using CRgn.
<br />
CRect rect;<br />
GetClientRect(&rect);<br />
CRgn rgn;<br />
<br />
rgn.CreateRoundRectRgn(0, 0, rect.Width(), rect.Height(), 30, 30);<br />
<br />
SetWindowRgn((HRGN)rgn.GetSafeWnd(), TRUE);<br />
After that I have painted the inside of the Rgn giving it a gradient background as explained in one of the articles by Mr. Nishant.(using bitblt())
Now I want to draw a boundary to this rounded rectangle.
I tried FrameRgn() API but the gradient painting drew over the boundary.
I also tried FrameRect() API after gradient painting, selecting the NULL_BRUSH. But all I got was a black Rounded Rectangle.
How do I draw a boundary to the Rounded Rectangle without sacrificing my gradient background?
Cutebug
|
|
|
|
|
|
Naveen R wrote: try
RoundRect().
RoundRect() fills the area with the currently selected brush.
Thus I would lose the gradient background.
Cutebug
|
|
|
|
|
why dont u first draw the frame and then fill the rgn?
nave
|
|
|
|
|
Ok I draw the frame first.
Then, for filling the region with gradient background, I am considering the pixels from 0 to rect.width() (For Width) and from 0 to rect.Height() (For Height).
Since this is a rounded rectangle, I don't know how to deal with the curved portion of the region so as not to paint over the boundary.
How do I accomplish this?
Cutebug
|
|
|
|
|
did u try selecting null brush as Mark Salsbery said?
nave
|
|
|
|
|
cutebug wrote: RoundRect() fills the area with the currently selected brush.
Thus I would lose the gradient background.
What about selecting a NULL brush?
|
|
|
|
|
ho ...left this point
nave
|
|
|
|
|
Using of NULL_BRUSH provides no help and the entire region is filled by BLACK.
Cutebug
|
|
|
|
|
cutebug wrote: Using of NULL_BRUSH provides no help and the entire region is filled by BLACK.
Hmm... that sounds like an RGB(0,0,0) brush, not a GetStockObject(NULL_BRUSH) brush.
|
|
|
|
|
It worked with SelectStockObject(NULL_BRUSH).
Thanks a lot.
Cutebug
|
|
|
|
|
hi i m exactly looking for what u have done.
Actually i want to apply gradient background to my dialogs and make it rounded rectangle and create a frame. i have seen nish article but i didn't understand where to put the code. i didn't find any onerasebackground message. can u plz post ur code or plz send it to indupuriraj@yahoo.co.in
thnx in advance.
|
|
|
|
|
How can i add support of different languages to my application?
|
|
|
|
|
kiranin wrote:
How can i add support of different languages to my application?
MultiLanguage[^]
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and you
|
|
|
|
|
I've got a list of names in a combo box, which have to be sorted right. What I'm trying to do is insert a name into the middle of the list without overwriting an existing name or screwing up the order of the list. What's the best way to do that? Should I open up a gap by shifting the names after the position I'm inserting at to the right, and then use InsertString to put the name in? Or is there a more efficent way of doing it? I can't use the built in sorting than comes with the CComboBox class since I need more control than it can provide.
|
|
|
|
|
CoffeeAddict19 wrote: What I'm trying to do is insert a name into the middle of the list without overwriting an existing name or screwing up the order of the list.
Check out CComboBox::InsertString()
|
|
|
|
|
NEVER GO FOR THIS .... there is nothing there .
Only at the site you will see indexes & syllabus for the courses in interactive way
but while doing the course , I felt very cheated .
They charged Rs 6500 for "Programming Expertise in Visual C++ ". There was no time boundation , no
exercise checking , many lectures were absent and at the last they didn't give any project .
They were in hurry to give the certificate and get rid of me .
Same is the story with other online courses .
Never go for any e-course from KSET Pvt. Ltd. ( http://quest.ksetindia.com )
Avanish
|
|
|
|
|
You should probably post this a few more times....just in case I missed something the first three
times.
I'll give you some projects and only charge you half that.
|
|
|
|
|
avanish123 wrote:
Never go for any e-course from KSET Pvt. Ltd. ( http://quest.ksetindia.com )
why don't you directly ask that from Mr. Yashwant Kanetkar!.. they are always available for help via mail !
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and you
|
|
|
|
|
This really should go in the soapbox.
Either way, there's no substitute for buying a good book and working through it.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|