Click here to Skip to main content
15,890,690 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionGet List of applications only Pin
vikrant kpr23-Jan-09 1:19
vikrant kpr23-Jan-09 1:19 
AnswerRe: Get List of applications only Pin
Nishad S23-Jan-09 1:49
Nishad S23-Jan-09 1:49 
AnswerRe: Get List of applications only Pin
Sarath C23-Jan-09 1:57
Sarath C23-Jan-09 1:57 
QuestionHow to change size of dialog box @ run time? Pin
sam_psycho23-Jan-09 0:50
sam_psycho23-Jan-09 0:50 
AnswerRe: How to change size of dialog box @ run time? Pin
Code-o-mat23-Jan-09 0:52
Code-o-mat23-Jan-09 0:52 
AnswerRe: How to change size of dialog box @ run time? Pin
Cedric Moonen23-Jan-09 0:54
Cedric Moonen23-Jan-09 0:54 
GeneralRe: How to change size of dialog box @ run time? Pin
sam_psycho23-Jan-09 1:02
sam_psycho23-Jan-09 1:02 
QuestionCEdit SetPasswordChar SetFont [modified] Pin
Taulie22-Jan-09 23:07
Taulie22-Jan-09 23:07 
Hello,

i've a problem with a subclassed CEdit on WindowsCE 5.0.
If i use SetPasswordChar and SetFont in the same subclassed CEdit it generates an acces violation

[Stack fault]: Thread=9a431400 Proc=98328d20 'xxxxxx.exe'
AKY=00004001 PC=0017ba6c(xxxxxx.exe+0x0016ba6c) RA=000318e8(xxxxxx.exe+0x000218e8) BVA=1e2a1ee4 FSR=00000007


my Code:

...
if(edit->SubclassDlgItem(IDC_EDIT1, this)){
edit->SetFont(m_Font, FALSE);

edit->SetPasswordChar(0x25CF); // --> stack fault
}
...


If i don't use SetFont OR SetPasswordChar it works fine...

whats wrong ???
can anybody help me?

Thanx for replys...


edit:
// Initialization
Controls.edit2 = new CMyEdit();
Controls.edit2->__SubClassControl(this, IDC_EDIT2);
Controls.edit2->__SetMaxTextLength(9);
//Controls.edit2->SetPasswordChar('*'); // --> stack fault
Controls.edit2->SetPasswordChar(0x25CF); // --> stack fault

// Control-Code
BOOL CMyEdit::__SubClassControl(CMyDialog *pParent, int nID)
{
// subclassing per SubclassDlgItem is okay, SubclassWindow does not work
m_pParent = pParent;
m_nID = nID;

BOOL ret = SubclassDlgItem(m_nID, m_pParent);

// changing FontSize to parentfont and the heigth of the Control
LOGFONT lf;
if(m_pParent->GetFont()->GetLogFont(&lf) != 0){
// m_Font is a derived class from CFont and an Item of my CMyEdit for better Fonthandling
// if i use CFont the same Problem exist with SetPasswordChar (isn't the reason)
m_Font->_SetLogFont(lf);

if(m_bFontResizing == TRUE){
CRect rect;
GetClientRect(&rect);
rect.DeflateRect(2,2,2,2);
m_Font->_SetHeight(rect.Height());
}
SetFont((CFont*)m_Font, FALSE);
}

return ret;
}

void CMyEdit::__SetMaxTextLength(int maxLen)
{
m_maxLen = maxLen;

// del mask
m_Mask = _T("");
}

modified on Friday, January 23, 2009 7:14 AM

AnswerRe: CEdit SetPasswordChar SetFont Pin
Code-o-mat23-Jan-09 0:00
Code-o-mat23-Jan-09 0:00 
GeneralRe: CEdit SetPasswordChar SetFont Pin
Taulie23-Jan-09 1:06
Taulie23-Jan-09 1:06 
GeneralRe: CEdit SetPasswordChar SetFont Pin
Code-o-mat23-Jan-09 4:00
Code-o-mat23-Jan-09 4:00 
GeneralRe: CEdit SetPasswordChar SetFont Pin
Taulie23-Jan-09 4:03
Taulie23-Jan-09 4:03 
GeneralRe: CEdit SetPasswordChar SetFont Pin
Code-o-mat23-Jan-09 4:06
Code-o-mat23-Jan-09 4:06 
GeneralRe: CEdit SetPasswordChar SetFont Pin
Taulie23-Jan-09 4:15
Taulie23-Jan-09 4:15 
AnswerRe: CEdit SetPasswordChar SetFont Pin
krmed23-Jan-09 0:39
krmed23-Jan-09 0:39 
GeneralRe: CEdit SetPasswordChar SetFont Pin
Taulie23-Jan-09 1:07
Taulie23-Jan-09 1:07 
GeneralRe: CEdit SetPasswordChar SetFont Pin
krmed23-Jan-09 6:57
krmed23-Jan-09 6:57 
AnswerRe: CEdit SetPasswordChar SetFont Pin
prasad_som23-Jan-09 1:01
prasad_som23-Jan-09 1:01 
GeneralRe: CEdit SetPasswordChar SetFont Pin
Taulie23-Jan-09 1:08
Taulie23-Jan-09 1:08 
GeneralRe: CEdit SetPasswordChar SetFont Pin
«_Superman_»24-Jan-09 1:49
professional«_Superman_»24-Jan-09 1:49 
GeneralRe: CEdit SetPasswordChar SetFont Pin
Taulie25-Jan-09 4:14
Taulie25-Jan-09 4:14 
QuestionRe: CEdit SetPasswordChar SetFont Pin
David Crow23-Jan-09 3:13
David Crow23-Jan-09 3:13 
AnswerRe: CEdit SetPasswordChar SetFont Pin
Taulie23-Jan-09 3:54
Taulie23-Jan-09 3:54 
GeneralRe: CEdit SetPasswordChar SetFont Pin
Taulie23-Jan-09 4:00
Taulie23-Jan-09 4:00 
QuestionProblem while horizontal scrolling Pin
Deepu Antony22-Jan-09 22:33
Deepu Antony22-Jan-09 22:33 

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.