• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 571
  • 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?
  • 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...

learn1Author Commented:
   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

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...:-)

You have also the TJvIPAddress component of the Jedi VCL :

Rather than making you own, it should be better to use a commonly used one.
George TokasCommented:
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...:-)

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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