Author Topic: Dialog: Bad control Name: 1 error  (Read 2448 times)

Orionbelt

  • Newbie
  • *
  • Posts: 24
Dialog: Bad control Name: 1 error
« on: July 26, 2013, 01:13:46 pm »
hi all,
 I created small utility to show dialog of ASSETTAG...etc on my windows WINPE osd deployment. Problem is when exe run, i am getting followin error. attached file.
I am not really programmer but found winbatch really helpful. My code and dialog is attached.


thanks in advance...

Deana

  • Wilson WindowWare Tech Support
  • Pundit
  • *****
  • Posts: 1183
  • WinBatch® can do it.
    • WinBatch Tech Support Database
Re: Dialog: Bad control Name: 1 error
« Reply #1 on: July 26, 2013, 01:33:32 pm »
The code seems to be failing on this line:

Code: Winbatch
If IP!=PrevIP Then DialogControlSet(Info_Handle,1,DC_TITLE,IP)

DialogControlSet's second parameter expects a CONTROL NAME rather than a control number. Older versions Dialog WWWDLGED 6.1 Accepted a number of the control (i.e. 1), however 6.2 formatted dialogs expect a CONTROL NAME.

Quote
Syntax:
DialogControlSet( dialog-handle, control-name, set-request-code, set-info )

If you are trying to update the IP ADDRESS VARYTEXT control (Information003=`025,035,156,010,VARYTEXT,"VaryText_8",i,"IP Address:  %IP%",DEFAULT,7,0,"Microsoft Sans Serif|8192|70|34","0|0|128",DEFAULT`
) then you need to specify the name "VaryText_8".


Code: Winbatch
If IP!=PrevIP Then DialogControlSet(Info_Handle,"VaryText_8",DC_TITLE,IP)

Also note that you currently have all the controls Tab number set to seven. You might want to give each control its own unique tab-order number.
Deana F.
Technical Support
Wilson WindowWare Inc.