|
Thanks for the explaination!
But what about the case "SOMAXCONN"?
Thanks!
Nachi
|
|
|
|
|
|
I have an Edit control for hex input, and I'd like draw it with spaces between every two characters (the user doesn't actually type any spaces):
43 4F 44 45 50 52 4F 4A ... etc
I'd rather not use SetWindowText to shove the spaces directly into the text, since I'd have to have special handling for editing, cutting, pasting, undo, validate and all.
Is it possible to do the formatting at display time instead? I looked through the MFC source and I didn't see any CEdit draw methods that I could override.
|
|
|
|
|
Look in the CEdit section here, there are several masked edit classes if memory serves.
|
|
|
|
|
The masked edit classes keep the literals within the data, and so they have to have special processing for all edit and cursor functions. I could adapt one of these useful classes to insert that space every two characters, but it seems like overkill.
I'd like to keep the text data the way the user enters it, and mess only with how it would get displayed. My idea is to grab the draw method for CEdit and override it with a function that formats a copy of the text right there, and displays it. I like minimal added logic.
Problem is, I don't have any idea where the CEdit control is drawing itself. I looked in the MFC sources and I can't find anything like CEdit::OnPaint(). Can anyone offer any clues on this?
|
|
|
|
|
Mabe you can handle EN_UPDATE and reset the text in the control to have every third letter a blank?
|
|
|
|
|
That's an idea I can try. Not as clean as I hoped, but if it does the job, I'll use it.
|
|
|
|
|
Hello fellas
Which GDI+ class lets you open a bmp file and draw it on your CView derived class? And will it take care of painting or do we have to keep re-rendering it in the OnDraw?
Regards,
Nish
p.s. I went through the GDI/GDI+ sections on CP. Haven't been able to find what I wanted
Author of the romantic comedy
Summer Love and Some more Cricket [New Win]
Review by Shog9
Click here for review[NW]
|
|
|
|
|
|
|
|
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!
|
|
|
|