Solved

Password continued

Posted on 1998-12-03
4
199 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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
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 tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

786 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