IP Address component in BCB6

Posted on 2005-05-07
Last Modified: 2013-11-17
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?
Question by:learn1
    LVL 16

    Expert Comment

    by:George Tokas
    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...


    Author Comment

       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

    LVL 16

    Accepted Solution

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

    LVL 5

    Expert Comment

    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.
    LVL 16

    Expert Comment

    by:George Tokas
    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...:-)


    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    Here is a helpful source code for C++ Builder programmers that allows you to manage and manipulate HTML content from C++ code, while also handling HTML events like onclick, onmouseover, ... Some objects defined and used in this source include: …
    How to install Selenium IDE and loops for quick automated testing. Get Selenium IDE from ( Go to that link and select download selenium in the right hand columnThat will then direct you to their downlo…
    This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
    The viewer will learn how to use and create keystrokes in Netbeans IDE 8.0 for Windows.

    733 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    25 Experts available now in Live!

    Get 1:1 Help Now