Click to See Complete Forum and Search --> : I need to VB guru to help me!


S@bot4g3
07-01-2002, 10:45 AM
Y0 y0.I would like to use the IP Address control which from what i understand is contained in the MS Windows Common Controls. This control is however not one of the default controls. According to the MSDN library i need to do this to be able to use it :

"Initializing an IP Address Control

To use an IP address control, call InitCommonControlsEx with the ICC_INTERNET_CLASSES flag set in the dwICC member of the INITCOMMONCONTROLSEX structure."

Hmm, i have a rough idea of whats going on but i'll be damned if i can figure how to do that. Please guide me through this process if you can..

Cheers
-Sab-

hu flung dung
07-01-2002, 01:04 PM
This is going to require quite a bit of Windows API programming!

I'll just say that it would be easier to use the Masked Edit control. It would provide similar functionality!

I will, however, figure this one out! This control could become quite useful to me, and I just cannot say 'No' to a good challenge! I think I have a good enough understanding of the API calls involved!

Oh, I'm sorry but you wont find this control in the 'Components' or the 'References' dialog box! :(

S@bot4g3
07-01-2002, 03:27 PM
Well, according to the MSDN the Microsoft Windows Common Controls which is located in Components Dialog actually contains more controls than is available to you. Perhaps im wrong on this one but that is what i got from it. You have to call a function to set bit flags of some sort to indicate which controls should be loaded from the DLL. Thats the part that bothers me..a little bit inconclusive if you ask me..

-Sab-

S@bot4g3
07-01-2002, 03:33 PM
Let me elaborate a bit and add some more problems as we go along. There is a proggie that came with half life called HLTV which connects to a games serva as a proxy for users to view the ensuing action.

I use it regularly to connect to my machine from another in the network to monitor my play. To correctly activate it i need to type the following in the HLTV directory : HLTV +connect 192.168.xxx.xxx:27015. I would like to create a simple proggie in VB with that darn IP Address control for the IP,Textbox for the Port and perhaps even a directory control for the HLTV directory that i could use to do this. I know it might seem like a negligible project but i reckon it would be fun as well as challenging for a vb noob like me to do.

The question. How would i within my simple app execute HLTV (with those parameters obtained from the controls) which is usually executed from the command interface ?

And trust me i am trying to learn these things where i can but i just havent found the relative info yet.

Cheers..
-Sab-

hu flung dung
07-01-2002, 07:23 PM
Originally posted by S@bot4g3
Let me elaborate a bit and add some more problems as we go along. There is a proggie that came with half life called HLTV which connects to a games serva as a proxy for users to view the ensuing action.

I use it regularly to connect to my machine from another in the network to monitor my play. To correctly activate it i need to type the following in the HLTV directory : HLTV +connect 192.168.xxx.xxx:27015. I would like to create a simple proggie in VB with that darn IP Address control for the IP,Textbox for the Port and perhaps even a directory control for the HLTV directory that i could use to do this. I know it might seem like a negligible project but i reckon it would be fun as well as challenging for a vb noob like me to do.

The question. How would i within my simple app execute HLTV (with those parameters obtained from the controls) which is usually executed from the command interface ?

And trust me i am trying to learn these things where i can but i just havent found the relative info yet.

Cheers..
-Sab-

Hmm, sorry! Havn't had time today to work on your IP Address control problem!

Look up the 'Shell' function for executing command lines! Oh, and you can use a normal text box (or a masked edit control if you want) for inputing IP addresses. You can treat any IP address as a string in Visual Basic!

df
07-02-2002, 09:46 AM
i dont understand your question. you can use the winsock control (vb6 sp5 version) mswinsck.ocx to do tcp/udp connections, etc. this will also give info on your localhost/localip, etc.etc.etc.

hit your toolbox. if "Microsoft Winsock Control 6.0 (SP5)" is not listed, browse for it in your System32 (or system for 98 users). drop it on a form.

hu flung dung
07-02-2002, 02:06 PM
Originally posted by df
i dont understand your question. you can use the winsock control (vb6 sp5 version) mswinsck.ocx to do tcp/udp connections, etc. this will also give info on your localhost/localip, etc.etc.etc.

hit your toolbox. if "Microsoft Winsock Control 6.0 (SP5)" is not listed, browse for it in your System32 (or system for 98 users). drop it on a form.

The IP Address control is nothing more than a modified masked edit control for typing in IP addresses!

Thats why I say to use the masked edit control (found in the components dialog, under 'microsoft masked edit control') or just use 4 text boxes with special properties and a little code to achieve the same exact functionality!

Programming is about imagination, use it!

S@bot4g3
07-02-2002, 02:58 PM
True, true. It would be nice to have that control nonetheless and i will definately use an alternative method if i need to. But then again this is the challenge : to get that IP Address control to work. I'll keep chipping away at it until i figure it out. Cheers for the responses :)


Oh and ta for the info on the Shell method. Works great ;)

-Sab-

Thraner
07-02-2002, 03:52 PM
Hi there. I just wanted to add another reply, even though I think you are up and running. I am a CS player/clan leader/HLDS server admin. The best way to add parameters automatically to a program when you run it is:
1. Right-click on your desktop
2. Click New -> Shortcut
3. Browse for and select your HLTV file
4. In the field that says Target, make sure it says (for example) c:\Sierra\Half-Life\HLTV\HLTV.exe +connect 192.168.xxx....

And now to run it, just double-click the shortcut.
I dig programming in VB too, so I can see why you would want to write an app, but there is always more than one way to skin a cat, I just happen to believe this is the easiest! Good luck!!

-[gLm]-Thraner
Great Lakes Militia
http://www.greatlakesmilitia.com
CS Server: 66.66.241.22:27016

hu flung dung
07-02-2002, 04:28 PM
Originally posted by Thraner
Hi there. I just wanted to add another reply, even though I think you are up and running. I am a CS player/clan leader/HLDS server admin. The best way to add parameters automatically to a program when you run it is:
1. Right-click on your desktop
2. Click New -> Shortcut
3. Browse for and select your HLTV file
4. In the field that says Target, make sure it says (for example) c:\Sierra\Half-Life\HLTV\HLTV.exe +connect 192.168.xxx....

And now to run it, just double-click the shortcut.
I dig programming in VB too, so I can see why you would want to write an app, but there is always more than one way to skin a cat, I just happen to believe this is the easiest! Good luck!!

-[gLm]-Thraner
Great Lakes Militia
http://www.greatlakesmilitia.com
CS Server: 66.66.241.22:27016


Not really!

I made a similar program for Quake2! If you have a several hundred maps, maybe a thousand skins, and almost a hundred mods (our Quake2 directory was well over a gigabyte large!), then you dont want thousands of shortcuts! My VB program made it a lot easier to choose which mod and map you wanted to use, and you could even edit CFG files with it!

df
07-02-2002, 06:29 PM
Originally posted by hu flung dung

The IP Address control is nothing more than a modified masked edit control for typing in IP addresses!

Thats why I say to use the masked edit control (found in the components dialog, under 'microsoft masked edit control') or just use 4 text boxes with special properties and a little code to achieve the same exact functionality!


is that all he wanted? aah i thought he wanted to write a client or something.. shrugs :>