Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

mswinsck distribution problem

Status
Not open for further replies.

wigwug

Programmer
Feb 13, 2005
35
US
I am having problems distributing an app I wrote to my test systems. The app contains the MSWINSCK control which I use to obtain local IP address. I get the message that the control is not licensed for use? I have attempted to insert it with the rest of the OCX controls in install shield. I get the message that it is part of another assembly, would I like to include it. It does not matter if I include it or not if I include it with the rest of my controls I always get the same licensing error on the client machine. Any ideas?

Thanks

Wigwug
 
I am assuming that you are instantiating the control in code, though you have not said so. You have two options: Add the winsock control to a form and use it from there or subclass it (OLEControl) in a vcx and use it from there.

The reason (if this is what you are indeed running into) is that in order to create the control in code requires a design-time license -- which is why it is throwing a fit on the client's machine. However, using the control when it has been placed on a form or is instantiated from an olecontrol subclass only requires a run-time license (which is the scenario you have when distributing your application to client machines that don't have the full development version of Visual FoxPro on it).

boyd.gif

SweetPotato Software Website
My Blog
 
Craig:

Thanks, but… I am sorry I did not go into more detain. The control is contained in a VCX. I have a bus object called ‘emailstuff’ that instantiates and uses the PEM’s. The OCX (along with several other OCXes that work fine) are contained in the Install shield assembly. Could it be a version problem???

Tkx again
 
Here is the code I have used...

loWinSock = CREATEOBJECT('MSWinsock.Winsock')
THIS.prpIPaddress = loWinSock.LocalIP
THIS.prpLocalhost = loWinSock.LocalHostName

RETURN THIS.prpIPaddress
 
If your winsock control is already contained in a class, you need to instantiate it as:

SET LIBRARY TO YourClass.VCX
loWinSock = CREATEOBJECT('NameOfWinsockSubclass')

instead of:
loWinSock = CREATEOBJECT('MSWinsock.Winsock')


-Dave Summers-
[cheers]
Even more Fox stuff at:
 
>>loWinSock = CREATEOBJECT('MSWinsock.Winsock')

This clearly shows that you are using the winsock control directly and not via a subclass as I outlined above. I believe if you use the Olecontrol subclass you created in your vcx (Dave's code shows what it should look like) you will find that your problem is solved. Having run into this a time or two myself with various controls (such as MSMAPI) I know how frustrating this can be. Good luck and let us know how it turns out.

boyd.gif

SweetPotato Software Website
My Blog
 
Thanks everyone for your help! I will let you know how this works.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top