Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Obtaining IP address of current PC
Message
 
 
To
04/06/2001 08:49:34
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00514497
Message ID:
00514535
Views:
9
>Thanks
>Kev

This works in the development environment but usually not in a distributed application. the reason for this is that Createobject requires a development license for MSWinsock. This is installed with Visual Studio (or one of the individual products contained within - VFP, VB, etc.). Most user machines don't have these loaded so the Createobject will fail with a licensing error.

To avoid this, embed MSWinsock in a form and distribute it that way. The run-time license will be embedded in the SCX itself and MSWinsock won't balk during instantiation.

You could also subclass the OLEControl. The same license information is embedded in the VCX. However, because the object is an OLEControl, there is a workaround for using the subclass in code. You have to add it to a form at run-time. The following might work:
oform = createobject('form')
oform.Newobject('owinsock','mywinsockclass','mywinsockclasslibrary')
? oform.owinsock.LocalIP
oform.release
release oform
HTH.
Larry Miller
MCSD
LWMiller3@verizon.net

Accumulate learning by study, understand what you learn by questioning. -- Mingjiao
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform