|
|
|
|
Ha! Straight from MSDN:
Image image(L"Grapes.jpg");
graphics.DrawImage(&image, 60, 10);
Go and do likewise...
|
|
|
|
|
|
Ok, more browsing through MSDN - try skipping the whole "new" thing, & using Bitmap::FromFile() to produce the Bitmap* .
|
|
|
|
|
|
Nishant S wrote:
I'd still have to delete it obviously
I suppose... If you really *want* to. But memory leaks help keep your computer healthy by ensuring the swap file gets plenty of exercise, right?
|
|
|
|
|
Shog9 wrote:
But memory leaks help keep your computer healthy by ensuring the swap file gets plenty of exercise, right?
Yeah, but I have VS.NET which takes care of leaking more than enough memory to keep the swap file in good health
Nish
Author of the romantic comedy
Summer Love and Some more Cricket [New Win]
Review by Shog9
Click here for review[NW]
|
|
|
|
|
I want to call a SQL Server stored procedure from my VC++ app that uses ADO (non-MFC). But the stored procedure takes an output parameter. How can i call this procedure and how do i retrieve the value of Output parameter when function returns ???
|
|
|
|
|
I want to have info all about Rich Text format, its headers and how pictures are represented using RTF. If there is any such article here then let me know please.
|
|
|
|
|
|
I'm a newhand .Yesterday ,my boss let me to construct a class that can be used to print text,html and bitmap.But ,I don't know how to begin my work,so I want somebody to help me ,thanks!
|
|
|
|
|
Check the many fine articles on printing fine articles on printing here on CP. If you have a specific problem then ask here again.
CPUA 0x5041
Sonork 100.11743 Chicken Little
"So it can now be written in stone as a testament to humanities achievments "PJ did Pi at CP"." Colin Davies
Within you lies the power for good - Use it!
|
|
|
|
|
Head over to http://www.codeproject.com/printing/[^] and read it. That'll give you a start, at least. The really hard bit will be HTML - i wish you luck with that, it could end up being quite a bit of work.
|
|
|
|
|
Does anyone know how to make a combobox sort data dynamically? Is there a CBS_SORT and if there is, how do I call it (note that I'm not creating the combobox dynamically)?
Thanks,
~ Selevercin
|
|
|
|
|
Annonomous wrote:
Is there a CBS_SORT
Yes.
Annonomous wrote:
how do I call it (note that I'm not creating the combobox dynamically)?
Properties Dialog -> Styles tab -> Sort checkbox
CPUA 0x5041
Sonork 100.11743 Chicken Little
"So it can now be written in stone as a testament to humanities achievments "PJ did Pi at CP"." Colin Davies
Within you lies the power for good - Use it!
|
|
|
|
|
Yes, but how do you do that with code?
Thanks,
~ Selevercin
|
|
|
|
|
Anonymous wrote:
Yes, but how do you do that with code?
????
If you specify the CBS_SORT style the strings are automatically sorted when they are added with AddString() .
You said you are not creating the control dynamically, so I assumed you were using a template to create it. If you are creating the control dynamically, then you use the Create() member function, and add CBS_SORT as one of the styles in the dwStyle parameter.
CPUA 0x5041
Sonork 100.11743 Chicken Little
"So it can now be written in stone as a testament to humanities achievments "PJ did Pi at CP"." Colin Davies
Within you lies the power for good - Use it!
|
|
|
|
|
Yes, but I need to be able to change the setting during the program. Can I add this ability in the program? I AM using the dialog control maker (not dynamic). Thanks VERY much,
~ Selevercin
|
|
|
|
|
Ok, now I get what you want
You can use the ModifyStyle() function. Just remember that some styles can not be changed after the control is created, I am not sure if CBS_SORT is one of them or not. Also, after you modify some styles you may have to call RedrawWindow() or SetWindowPos() with the SWP_FRAMECHANGED flag in order for the changes to show.
CPUA 0x5041
Sonork 100.11743 Chicken Little
"So it can now be written in stone as a testament to humanities achievments "PJ did Pi at CP"." Colin Davies
Within you lies the power for good - Use it!
|
|
|
|
|
When the user changes the selection of a combo box, I receive the CBN_SELCHANGE notification (via the MFC callback mechanism). The problem is that the UpdateData(TRUE) with the handler sets the CString to the previous.
Who was this guy at Microsoft who might think that if a user changes the Combo box selection that I would be interested in the previous selection, not in the new?
Btw, I tried catching the CBN_EDITCHANGE , CBN_EDITUPDATE , CBN_CLOSEUP , and CBN_SELENDOK notifications. They all return the previous selection, except for CBN_EDITCHANGE and CBN_EDITUPDATE that are never called.
Michel
It is a lovely language, but it takes a very long time to say anything in it, because we do not say anything in it, unless it is worth taking a very long time to say, and to listen to.
- TreeBeard
|
|
|
|
|
AFAIK, the window is not actually updated until the message handler returns.
Use GetCurSel() and GetLBText() to get the new selection.
|
|
|
|
|
Using UpdateData(TRUE) would have been too simple, isn't it? Btw, when do I call these functions?
What I want to do is to update another control when the user changes the selection.
Michel
It is a lovely language, but it takes a very long time to say anything in it, because we do not say anything in it, unless it is worth taking a very long time to say, and to listen to.
- TreeBeard
|
|
|
|
|
Michel Prévost wrote:
Btw, when do I call these functions?
You should be able to call them from your CBN_CHANGE (from memory & it's early - something like that) handler. Heck, you could even put them in your DoDataExchange() method if you just want to keep using UpdateData() (make sure you only do it when going one way).
|
|
|
|