Computing.Net > Forums > Programming > VB6 and the Internet

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

VB6 and the Internet

Reply to Message Icon

Name: HaTcH
Date: July 13, 2005 at 08:35:20 Pacific
OS: XP home + sP1
CPU/Ram: 512RDRAM/2.533ghz P4
Comment:

This is obviously going to be a winsock question, so here goes.

How can I retrieve the internet ip (the one assigned by the ISP) using anything from VB (not VB.net, and not relying on like an http server)?

Second question, how can I have vb block until it gets a response from the other computer it connects to. Example of what I mean:
using winsock, TCP, internet (not local ip)
VB program sends some data to another computer, but that computer needs to respond before this computer can send the next data. Its sort of like an FTP conversation, but its too bad that winsock.senddata doesn't return the next winsock_dataArival.

If there is a way to get it to work like this that would be great:
strResponse = wsTCP.sendData("foobar")
strResponse -> "from computer 2: I recieved your message of 'foobar'"

Doing this would make VB wait at that one line of code until it got some return value, then it could move on to the next line of code. (blocking)



Sponsored Link
Ads by Google

Response Number 1
Name: StuartS
Date: July 13, 2005 at 15:52:38 Pacific
Reply:

In regard to your first question, do you mean your own IP address or the IP address of the remote computer and how are you connecting to the Internet.

In regard to the second part. Don't use winsock, use the wininet.ocx. This has an FTP mode and be programmed to work in synchronous or asynchronous mode. You need synchronous mode. Wininet.ocx acts as a wrapper for all the various DLLs used in Internet communication.

Stuart


0

Response Number 2
Name: HaTcH
Date: July 13, 2005 at 16:39:23 Pacific
Reply:

I'm refering to the address a website would see me as, the 207.231.whatever (or if lets say, you wanted to connect to my computer from your computer over the internet, the ip you would use for that), not my LAN IP (192.168.whatever) Anyway, it should really be regardless how you connect to the internet wether it be PPP or broadband.

And don't tell me windows doesn't know, because when you open up the properties of your internet connection/details, it says in plain day, "Client IP Address:."

As for wininet.ocx, I don't have it, where can I get it?


0

Response Number 3
Name: StuartS
Date: July 13, 2005 at 17:48:30 Pacific
Reply:

I asked because if you are behind a router then Windows will not know the IP address, it will only have the LAN address. Windows will only be able to find out the Internet IP address if the modem is plugged directly into the computer. For that you need to interrogate the modem.

wininet.ocx is part of VB6. You should already have it.

Stuart


0

Response Number 4
Name: HaTcH
Date: July 13, 2005 at 18:35:53 Pacific
Reply:

I did a search of my entire hard drive and I can find no trace of a file called wininet.ocx, where is it supposed to be?

I was dabbling on the net and I came across this: http://www.vbip.com/winsock-api/gethostname/gethostname-01.asp
check out the download and see what it does. I tried following the code, and I kindof understand the API calls, but when the programer started using RTLMoveMemory I was like ok, wtf is this. I was hoping for something that does what this code does but doesn't require the RTLMoveMemory API call.


As a side note, what is the control that you use to make an application talk to the serial port? Mscomm or somthing? I've seen it before, its an icon with a yellow phone on it, but I can't remember how I got it...


0

Response Number 5
Name: StuartS
Date: July 13, 2005 at 21:20:44 Pacific
Reply:

Sorry. I misled you the correct name for the control is msinet.ocx. It uses the Wininet.dll which got me confused. It came with SP6 so you will need to have SP6 installed. It is listed in the components list as Microsoft Internet Transfer Control 6

The communication control is MSComm32.ocx

RTLMoveMemory is another API. Because it has no return value the parameters and not enclosed in parenthesis which makes it look a little different than most APS.

Read this:

RTLMove Memory

Stuart


0

Related Posts

See More



Sponsored Link
Ads by Google
Reply to Message Icon






Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: VB6 and the Internet

Turbo C++ 3.0 and the Internet www.computing.net/answers/programming/turbo-c-30-and-the-internet/6806.html

VB6 and windows XP www.computing.net/answers/programming/vb6-and-windows-xp/442.html

VB6 and Outlook Macros www.computing.net/answers/programming/vb6-and-outlook-macros/2255.html