• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 567
  • Last Modified:

IP Address component in BCB6

How do I use the MS IP Address common control WS_IPADDRESS to create a IP dialogue control in BCB6
to get an IP address from user, also to save as an text version of the result as opposed to just the expected
Long from the windows control?
0
learn1
Asked:
learn1
  • 3
1 Solution
 
George TokasCommented:
There are many ways to do it...
What do you want to do and what components you use???
The easiest way is to do this with a TEdit control.. But all depents on WHAT you want to do...

gtokas.
0
 
learn1Author Commented:
Hi,
   I wanted to create an method for a use to enter IP address so that I could then use it to change system settings by
passing the info to NETSH or if I can figure out how to use MS IPHELPER code in BCB6 to change the systems IP address
and DHCP settings. It is rather easy to pass variables to NETSH I was just needing to collect IP info from the user. MS has
this nice neet little function with WS_IPADDRESS and I was going to try and use it. I have never used anything other then the
standard templates or my own masks to control input from the user. Maybe I am complicating this too much. The MS component
handles the input masking and range checking very well. I am open to any Ideas or pointers. Thanks

learn1
0
 
George TokasCommented:
Then you have to use a TEdit component and a Button.
When you click the button you will make a proccessing on TEdit->Text to check if the values are on the range you want.
I presume you want to set a new static ip address on your machine to indentify at your lan.
So you have to check if it is at the range needed (192.168.x.x or 10.x.x.x)...
You can also use 4 TEdits to input the parts of the IP...
Also IF the IP variable is of type char* or string after the proccess for the range (if valid) you can pass the string to the IP variable...
I hope I helped a bit...:-)

gtokas.
0
 
GreybirdCommented:
You have also the TJvIPAddress component of the Jedi VCL :
http://homepages.borland.com/jedi/jvcl/

Rather than making you own, it should be better to use a commonly used one.
0
 
George TokasCommented:
@Greybird:
True if you are sucrifice execution speed and total length of the final exe...
I instaled Jedi and uninstalled because of the size and the time BCB IDE took to start..
Otherway you are absolutetly right...:-)

gtokas.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now