Old 1st March 2016, 21:41   #1
paradoxical
Junior Member
 
Join Date: Mar 2016
Posts: 3
Win10 - NsDialog NSDCreate does not push to stack

Hi everyone, I have been working with NSIS the past few days, but today I found myself stuck at the following:

This code is generated and ready to use. When I am using $CtlTomcatPortShutdown, $CtlTomcatPortHttp, $CtlTomcatPortHttp, $CtlTomcatServiceName ect. I get returned some random number, instead of the input I want. I have tried more example's from NsDialog document, I am not receiving user input to my script. I run Windows 10 64 bit. I'm completely stuck at the moment.

Here an example:

code:
Function tomcatConfig
!insertmacro MUI_HEADER_TEXT "$(TEXT_CONF_TITLE)" "$(TEXT_CONF_SUBTITLE)"

nsDialogs::Create 1018
Pop $Dialog3

${If} $Dialog3 == error
Abort
${EndIf}

${NSD_CreateLabel} 0 2u 100u 14u "Tomcat shutdown port"
Pop $R0

${NSD_CreateText} 150u 0 50u 12u "8005"
Pop $CtlTomcatPortShutdown
${NSD_SetTextLimit} $CtlTomcatPortShutdown 5
${NSD_CreateLabel} 0 19u 100u 14u "Tomcat default http port"
Pop $R0
${NSD_CreateText} 150u 17u 50u 12u "80"
Pop $CtlTomcatPortHttp
${NSD_SetTextLimit} $CtlTomcatPortHttp 5

${NSD_CreateLabel} 0 36u 100u 14u "Tomcat default https port"
Pop $R0
${NSD_CreateText} 150u 34u 50u 12u "443"
Pop $CtlTomcatPortSSL
${NSD_SetTextLimit} $CtlTomcatPortSSL 5

${NSD_CreateLabel} 0 57u 140u 14u "Tomcat service name"
Pop $R0
${NSD_CreateText} 150u 55u 140u 12u "Servicename"
Pop $CtlTomcatServiceName

${NSD_SetFocus} $CtlTomcatPortShutdown

nsDialogs::Show
FunctionEnd

paradoxical is offline   Reply With Quote
Old 1st March 2016, 21:48   #2
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,534
$hCtl_lol_Number1 is not used anywhere in the code you posted so how are we supposed to know what you are talking about? Also please update your stackoverflow question with some information about what "looks invalid" actually means or embed a screenshot.

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 1st March 2016, 21:57   #3
paradoxical
Junior Member
 
Join Date: Mar 2016
Posts: 3
Hi Anders, thanks for your reply. I have updated my start post. On SE there was a link to CoolSoft NSIS Dialog Designer which I tried, but gave me the same result. I forgot to change those vars in my start post.

In short, Pop $CtlTomcatServiceName does not get me the servicename that has been put in the textbox, instead I get some random number, 32426235 for instance.
paradoxical is offline   Reply With Quote
Old 1st March 2016, 22:14   #4
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,534
It is not a random number, it is the handle (HWND) to the control you just created. Use NSD_GetText to get the text.

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 1st March 2016, 22:38   #5
paradoxical
Junior Member
 
Join Date: Mar 2016
Posts: 3
You have no idea how happy I am with the post. And how annoyed I am by missing that one control.. I read the NsDialog document 2 times and still missed it. Thanks alot!!
paradoxical is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump