Old 17th January 2009, 15:45   #1
Junior Member
Join Date: Jun 2008
Location: UK
Posts: 9
nsDialogs IP Address Control

I'm trying to create an IP Address Control using nsDialogs and not having much luck.

No matter what I do I can't get a handle back other than 0, can someone let me know what I'm doing wrong?

Here's the code:

!define ICC_INTERNET_CLASSES 0x00000800

nsDialogs::Create 1018
Pop $Dialog

StrCmp $Dialog "error" 0 Start

System::Alloc 400
Pop $R0

System::Call "*$R0(i r1, i ${ICC_INTERNET_CLASSES})"
System::Call 'comctl32::InitCommonControlsEx(iR0)i.R4'

nsDialogs::CreateControl "WC_IPADDRESS" "${DEFAULT_STYLES}|${WS_TABSTOP}|${WS_CHILD}" "0" 5% 88% 40% 12u ""
Pop $1
messagebox mb_ok $1
System::Free $R0

Xokar is offline   Reply With Quote
Old 17th January 2009, 20:04   #2
Anders's Avatar
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,548
its not StrLen, but the size in bytes of the structure, try:
System::Call "*$R0(i 8, i ${ICC_INTERNET_CLASSES})"

also, WC_xxx is a define, so, make sure there is a define with that name and put ${ } around it, or just use "SysIPAddress32"

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 20th January 2009, 12:04   #3
Junior Member
Join Date: Jun 2008
Location: UK
Posts: 9

Thanks! It's working now
Xokar is offline   Reply With Quote
Old 19th April 2010, 12:49   #4
Major Dude
Join Date: Jun 2001
Posts: 1,173
Just cross-referencing this thread to a recent thread that discusses a font problem that can occur when using the SysIPAddress32 control 'as is'. Short summary: you must create a new font and set it on the IP address control before use to prevent corruption of your installer font.
http://forums.winamp.com/showthread.php?t=318497 - Problem of NSD_CreateIPAddress.nsh
Animaether is offline   Reply With Quote
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