Solved

Password continued

Posted on 1998-12-03
4
182 Views
Last Modified: 2010-04-02
Hi all, specifically Nietod and Alexo...

I placed this in the Init part of my dialog based MFC and I am getting all sorts of errors... how do I get this create function to work?

CEdit* editCtrl = (CEdit*) GetDlgItem(IDC_EDITBOX);
rect passwordbox;
editCtrl->GetRect(&passwordbox);
CWnd* pParentWnd = GetParent();
editCtrl->Create(ES_PASSWORD,passwordbox,
pParentWnd,IDC_EDIT5_PASSWORD);  
0
Comment
Question by:rose3377
  • 3
4 Comments
 
LVL 8

Expert Comment

by:Answers2000
Comment Utility
Why don't you simply set the password style on the edit control at design time in the resource editor ?
0
 
LVL 8

Expert Comment

by:Answers2000
Comment Utility
If you don't want to do that, then use ModifyStyle instead of Create - if the window already exists as part of the dialog
0
 
LVL 32

Accepted Solution

by:
jhance earned 20 total points
Comment Utility
GetRect doesn't work in the initialize (OnInitDialog) as the window you are trying to get the rect of doesn't exist yet.  Try doing this in the constructor for your dialog instead.
0
 
LVL 8

Expert Comment

by:Answers2000
Comment Utility
This is back 2 front jhance

To me the problem seems to be that rose is creating a window which is _already_ created
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
What is C++ STL?: STL stands for Standard Template Library and is a part of standard C++ libraries. It contains many useful data structures (containers) and algorithms, which can spare you a lot of the time. Today we will look at the STL Vector. …
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now