Solved

Password continued

Posted on 1998-12-03
4
205 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
ID: 1179160
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
ID: 1179161
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
ID: 1179162
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
ID: 1179163
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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will show you some of the more useful Standard Template Library (STL) algorithms through the use of working examples.  You will learn about how these algorithms fit into the STL architecture, how they work with STL containers, and why t…
Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.

809 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