|
thanks!
If it's broken, I probably did it
bdiamond
|
|
|
|
|
I have an application with an edit control. I need to write integer values to it...but I want to be able to change the font size to make the number as large as possible. I would also like to set the color. Can someone tell me how to set the font and color?
Thanks.
Jerry
|
|
|
|
|
Assuming the edit control is owned by a dialog, declare a font object in the dialog's class. Then in the OnInitDialog() method, create the font, and call the edit control's SetFont() method.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
|
You'll find that all CWnd derived classes will be similar.
classes? we don't need no stinkin' classes.
|
|
|
|
|
Hello, everyone,
I'd like to know how to handle the help button in property page. In my property page, there are OK, Cancel, Apply and Help button. For OK, Cancel and Apply button, it is easy to handle. I just go to ClassWizard->Message Maps to add function OnOK, OnCancel and OnApply, and then put code into the functions. But I don't know how to handle the help button.
What I can only think of is to get the rect of IDHELP button and then handle the mouse left click message. But I think there should be more straightforward way to handle it.
If you know how to handle it, please drop me a couple lines.
Thanks a lot in advance.
Bin
|
|
|
|
|
Add the following statement to the sheet's message map:
ON_COMMAND(ID_HELP, OnHelp) In the function that creates the sheet object, add:
sheet.m_psh.dwFlags |= PSH_HASHELP;
page1.m_psp.dwFlags |= PSP_HASHELP;
page2.m_psp.dwFlags |= PSP_HASHELP;
...
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
|
Hi All!
Please help me with one thing:
When i create listcontrol with such styles (LVS_OWNERDATA LVS_EX_CHECKBOXES) - checkboxes are hidden!
How to force my list control to work with this styles???
Thanks in advance!
|
|
|
|
|
From the docs:A virtual list-view control maintains very little item information itself. Except for the item selection and focus information, the owner of the control must manage all item information. Since the checkboxes are implemented using the state image list, when you put the list into virtual mode, the list no longer keep the state image info itself.
--Mike--
Personal stuff:: Ericahist | Homepage
Shareware stuff:: 1ClickPicGrabber | RightClick-Encrypt
CP stuff:: CP SearchBar v2.0.2 | C++ Forum FAQ
----
"That probably would've sounded more commanding if I wasn't wearing my yummy sushi pajamas."
-- Buffy
|
|
|
|
|
Hallo C++ world,
I would be appreciate your help!. I've a class with a CMap<int,int,cmyobject,cmyobject&> member variable. I have to store in it aprox. 8000 CMyObject elements. But after the 4600th element I get a CMemoryException.
I tried with a CArray<cmyobject,cmyobject&> variable. Here can I store only 1500 elements.
Can anyone tell me how can I work around this problem using a MFC collection.
With kind regards,
Reinaldo
Reinaldo Casamayor
|
|
|
|
|
Reinaldo Casamayor wrote:
But after the 4600th element I get a CMemoryException.
What is the text of the exception? Use either GetErrorMessage() or ReportError() for this.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
A CMemoryException typically indicates that new failed. MFC redefines the global operator new .
Stability. What an interesting concept. -- Chris Maunder
|
|
|
|
|
Hi,
I'm calling CListCtrl CustomDraw from a dialog, and I'm getting in trouble when I try to retrieve the column number that is currently being drawn ( I get a column number like 1242244).
What I make is:
<br />
void CRolesDlg::OnCustomdrawRoles(NMHDR* pNMHDR, LRESULT* pResult )<br />
{<br />
(...)<br />
LPNMLVCUSTOMDRAW lplvcd = (LPNMLVCUSTOMDRAW)pNMHDR;<br />
<br />
int iCol = lplvcd->iSubItem;<br />
(...)<br />
}<br />
And I get that strange iCol number , any ideas about why this happens ? It's a bug from MFC ? A bad casting ?
Greetings
Braulio
|
|
|
|
|
You left out a lot of code there... are you checking the draw stage? Returning the right CDRF_* flags to get notified of the draw stage for subitems?
--Mike--
Personal stuff:: Ericahist | Homepage
Shareware stuff:: 1ClickPicGrabber | RightClick-Encrypt
CP stuff:: CP SearchBar v2.0.2 | C++ Forum FAQ
----
Pinky, are you pondering what I'm pondering?
I think so Brain, but if we shaved our heads, we'd look like weasels!
|
|
|
|
|
Hi Michael,
The full code of the method is:
<br />
void CRolesDlg::OnCustomdrawRoles(NMHDR* pNMHDR, LRESULT* pResult )<br />
{<br />
<br />
NMLVCUSTOMDRAW* customDrawItem = reinterpret_cast<NMLVCUSTOMDRAW*>(pNMHDR);<br />
<br />
<br />
LPNMLVCUSTOMDRAW lplvcd = (LPNMLVCUSTOMDRAW)pNMHDR;<br />
<br />
int iCol = lplvcd->iSubItem;<br />
int iRow =0;<br />
switch(lplvcd->nmcd.dwDrawStage)<br />
{<br />
<br />
case (CDDS_SUBITEM):<br />
if(lplvcd->iSubItem == 1) {<br />
AfxMessageBox("");<br />
}<br />
break;<br />
<br />
default:<br />
*pResult = CDRF_DODEFAULT;<br />
<br />
} <br />
}<br />
I tried several things...
|
|
|
|
|
Hi Michale,
I'm following you article "Neat Sutff to do in List Controls Using Custom Draw", now things are going better
I hate to do things like this with MFC/ATL... when guys making sh*t with Visual Basic can do it in five minutes
Thanks for your help, Bye !
Braulio
|
|
|
|
|
I am using the VC++ date/time picker control. I want to select a date and then calculate the total seconds from 01-Jan-1980 until the selected date. Also I want to store this as an unsigned long int.
Do you know of a simply way to do this?
|
|
|
|
|
Store each of the dates in a COleDateTime object. Assign the difference to a COleDateTimeSpan object.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
I have very little VC++ experience. Could you give me more details on how to do this?
thank you
|
|
|
|
|
Yes, but I'd rather point you here:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vcmfc98/html/_mfc_cdatetimectrl.3a3a.gettime.asp
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vcmfc98/html/_mfc_coledatetime.asp
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vcmfc98/html/_mfc_coledatetimespan.asp
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
Does anyone know of a free (or one off payment) library for creating PDF documents that can be used from C/C++ programs? The only ones I managed to find so far are royalty based or can only be used from other languages such as PHP.
Systems AXIS Ltd - Software for Business ...
|
|
|
|
|
How about this one?
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
I'm not sure haow to qualify the textbox-append statement. The following statement:
myapp1::Form1::ioBOX.Appendtext("x");
Gives this error:
error C2228: left of '.Appendtext' must have class/struct/union type
type is ''
----------------------------------------------------------------------
Any ideas?
----------------------------------------------------------------------
//MY CODE - error near bottom
#pragma once
extern "C" int magiccalc(void);
namespace myapp1
{
using namespace System;
using namespace System::ComponentModel;
using namespace System::Collections;
using namespace System::Windows::Forms;
using namespace System::Data;
using namespace System::Drawing;
public __gc class Form1 : public System::Windows::Forms::Form
{
public:
Form1(void)
{
InitializeComponent();
magiccalc();
}
protected:
void Dispose(Boolean disposing)
{
if (disposing && components)
{
components->Dispose();
}
__super::Dispose(disposing);
}
private: System::Windows::Forms::TextBox * ioBOX;
private:
void InitializeComponent(void)
{
this->ioBOX = new System::Windows::Forms::TextBox();
... ...yadda yadda
}
public:
static void TOioBox(int outnum)
{
ERROR----> myapp1::Form1::ioBOX.Appendtext("x");
}
};
}
extern "C"
{
void showme(int wrapnum) // My wrapper for C
{
myapp1::Form1::TOioBox(3);
}
}
Thanks
|
|
|
|
|
You'd need to use an instance of Form1 , not the class itself, because ioBOX is an instance member.
Your syntax would probably look something like:
pForm1->ioBOX->AppendText( S"x" ); Note that C++ is case-sensitive and that the AppendText method takes a System::String* .
Stability. What an interesting concept. -- Chris Maunder
|
|
|
|