LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

PasswordCtrl_ConvertFromString error -46

Solved!
Go to solution

I'm following the example password project "pwsample.cws".  I think I've followed it, and yet when I convert my text box like this:

 

passCtrlID = PasswordCtrl_ConvertFromString(passPanel,PASSWORD_COMMAND);

 

passCtrlID is getting a value of -46 (The attribute passed is invalid.)  I can't figure out why that is.  When I step through the pwsample project, the value passed is 2.  What is going on?

0 Kudos
Message 1 of 3
(3,196 Views)
Solution
Accepted by topic author ElectroLund

Just to be sure it's not a typo: "text box" or "string control"? The control to convert must be a string: if you pass a different control you're likely to get an error.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
Message 2 of 3
(3,193 Views)

Eureka!  That was my problem, the control I was using (actually, I inherited this design, so it's not my fault!) was a single-line text box.  No wonder!  Changed it to a text string control and it works just fine.

0 Kudos
Message 3 of 3
(3,190 Views)