Click here to Skip to main content
16,011,508 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Generalsimilar functions in vc++ for clreol and gotoxy Pin
1-May-01 8:55
suss1-May-01 8:55 
GeneralRe: similar functions in vc++ for clreol and gotoxy Pin
Christian Graus1-May-01 13:06
protectorChristian Graus1-May-01 13:06 
GeneralRe: similar functions in vc++ for clreol and gotoxy Pin
Tomasz Sowinski2-May-01 1:23
Tomasz Sowinski2-May-01 1:23 
GeneralHelp Topics Pin
kk91-May-01 8:46
kk91-May-01 8:46 
GeneralCOleControl and Office 200 Problem under NT4 Pin
Michael A Barnhart1-May-01 6:26
Michael A Barnhart1-May-01 6:26 
Generalw*fstream troubles Pin
Someone20021-May-01 5:43
Someone20021-May-01 5:43 
GeneralSimple Custom Control Question Pin
Mark Jones1-May-01 5:14
Mark Jones1-May-01 5:14 
GeneralRe: Simple Custom Control Question Pin
Michael A Barnhart1-May-01 7:36
Michael A Barnhart1-May-01 7:36 
Is your function really CNewEdit::OnCreate()?

If so it is probably not being called. The WM_CREATE message calls.
CMyEdit::OnCreate(LPCREATESTRUCT lpCreateStruct);
I usually override the create function as shown below and add the functionality that I need. But both of the below functions are executed when created by the parent.
One other option is are you calling Create or letting teh creation in a dialog initialization call it? IF the last case it may be only calling the base class.

Header File

class CMyEdit : public CEdit
{
// Construction
public:
CMyEdit();

// Attributes
public:

// Operations
public:

// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CMyEdit)
public:
virtual BOOL Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext = NULL);
//}}AFX_VIRTUAL

// Implementation
public:
virtual ~CMyEdit();

// Generated message map functions
protected:
//{{AFX_MSG(CMyEdit)
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
//}}AFX_MSG

DECLARE_MESSAGE_MAP()
};


C++ file

BEGIN_MESSAGE_MAP(CMyEdit, CEdit)
//{{AFX_MSG_MAP(CMyEdit)
ON_WM_CREATE()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CMyEdit message handlers

// Create Message Handler
int CMyEdit::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CEdit::OnCreate(lpCreateStruct) == -1)
return -1;

// TODO: Add your specialized creation code here

return 0;
}

// Virtual Function Override.
BOOL CMyEdit::Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext)
{
// TODO: Add your specialized code here and/or call the base class

return CWnd::Create(lpszClassName, lpszWindowName, dwStyle, rect, pParentWnd, nID, pContext);
}


Michael A Barnhart
mabtech@swbell.net
GeneralRe: Simple Custom Control Question Pin
Mark Jones1-May-01 22:47
Mark Jones1-May-01 22:47 
GeneralRe: Simple Custom Control Question Pin
Tomasz Sowinski2-May-01 0:26
Tomasz Sowinski2-May-01 0:26 
GeneralRe: Simple Custom Control Question Pin
Mark Jones2-May-01 0:48
Mark Jones2-May-01 0:48 
GeneralPrint Preview Pin
1-May-01 4:59
suss1-May-01 4:59 
GeneralRe: Print Preview Pin
5-Jun-01 22:10
suss5-Jun-01 22:10 
GeneralRe: Print Preview Pin
Christian Graus5-Jun-01 22:24
protectorChristian Graus5-Jun-01 22:24 
Generalneed help with drawing and scrolling Pin
F.Dost1-May-01 4:27
F.Dost1-May-01 4:27 
GeneralRe: need help with drawing and scrolling Pin
Chris Losinger1-May-01 5:45
professionalChris Losinger1-May-01 5:45 
GeneralRe: need help with drawing and scrolling Pin
F.Dost1-May-01 6:03
F.Dost1-May-01 6:03 
GeneralRe: need help with drawing and scrolling Pin
Christian Graus1-May-01 13:09
protectorChristian Graus1-May-01 13:09 
GeneralDll link error Pin
1-May-01 3:30
suss1-May-01 3:30 
GeneralRe: Dll link error Pin
Tim Deveaux1-May-01 4:58
Tim Deveaux1-May-01 4:58 
GeneralRe: Dll link error Pin
1-May-01 17:21
suss1-May-01 17:21 
GeneralRe: Dll link error Pin
1-May-01 20:16
suss1-May-01 20:16 
Generalprinting a graphics plot Pin
DanYELL1-May-01 2:32
DanYELL1-May-01 2:32 
GeneralRe: printing a graphics plot Pin
Chris Losinger1-May-01 3:32
professionalChris Losinger1-May-01 3:32 
Generalsearching and extracting strings in a file Pin
hearties1-May-01 2:26
hearties1-May-01 2:26 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.