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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MSWinsock.Winsock.1 License Issue?

Status
Not open for further replies.

nwmedia

Programmer
Jun 21, 2001
7
US
We've written an email class that utilizes the Microsoft Winsock 6.0 Active X control that comes with Foxpro and Visual Studio.

When the compiled program is executed on a machine other than the development machine, a message appears indicating there is no license available to instantiate the object.

What is this and how do we fix it?
 
How did you install the Winsock control on the client computer?

Did you use the Setup Wizard? If so, did you remember to include ActiveX controls and pick the Winsock control?

If not, did you copy the OCX file manually and register it using REGSVR32.EXE?

Or did you do something entirely different?

Ian
 
This "problem" is a variant (different OCX) of the one described in - "INFO: OLE Control Licensing in Visual FoxPro (Q139154)". The final example shows a way around the problem.

You may want to also read - "BUG: License Error with ActiveX Control Added at Run-Time (Q192693)"

Rick
 
We're using VFP 7.0 and have defined a class. Within this class we create the object, connect, etc.

We used the InstallShield Express to create a setup and added the Winsock control as part of the setup process.

After installing the program and rebooting the client computer, we still get the license error.

Any more ideas?
 
Have a look at Uncanny's comment (5/20/02) near the bottom of thread184-271916. He answers the question, although it's probably not the answer you're looking for.

Ian
 
Uncanny is my partner in crime!!! We're both employed by the same development company and need an email function for our various applications and needless to say, have been battling this Winsock stuff.

Our email class is very stable and reliable except we can't understand this Winsock license error.

We even manually registered the ocx file on the client machine and still get the license error!?!

Any more ideas?
 
Heh...well, what do you know! It's a small world after all!

Without the license, you can't use the OCX. The only solution to the problem is to install Visual FoxPro on the client machine, which will install the proper license for the OCX. This will work fine as long as it's one of your own computers.

Otherwise, the ony thing you can do is use a different OCX. I've never done anything like this, so I can't help, I'm afraid. :eek:(

Ian
 
I'm not sure exactly what you are doing, but the following works just fine in many locations (VFP 6.0 SP5). Basically, because the VCX does the direct usage of Winsock, and it's precompiled, it doesn't create a license problem! It's a simple procedure that uses Winsock to get the IP address. (Andy is one of our programmers.)

* Program....: GETIP.PRG
* Version....: 1.0
* Author.....: ** Andy Goeddeke **
* Date.......: January 8, 2002
* Return IP address as char string

* 02/04/2002 Changed the technique slightly to avoid the "Class not registered/licensed" errors.

*!* The following DOESN'T work!
*!* LOCAL loWinsock
*!* loWinSock = CREATEOBJECT("MSWinsock.Winsock")
*!* return loWinsock.LocalIP

LOCAL oForm1, lcIP
oForm1 = CREATEOBJECT("dummyform")
lcIP = oForm1.Olecontrol1.LocalIP
RELEASE oForm1
RETURN lcIP

*************************************
DEFINE CLASS dummyform AS form

DoCreate = .T.
Caption = "dummyform"
Name = "dummyform"

PROCEDURE INIT
IF .F.
** This sucks the class into the project automatically.
SET CLASS TO ep_winsock
ENDIF
THISFORM.NewObject("olecontrol1", "ep_winsock", "ep_winsock")
ENDPROC

ENDDEFINE

*** Where ep_winsock.vcx is:
**************************************************
*-- Class: ep_winsock (..\classlibs\ep_winsock.vcx)
*-- ParentClass: olecontrol
*-- BaseClass: olecontrol
*-- Time Stamp: 02/04/02 10:38:02 AM
*-- OLEObject = C:\WINNT\SYSTEM32\MSWINSCK.OCX
*
DEFINE CLASS ep_winsock AS olecontrol
Height = 100
Width = 100
Name = "ep_winsock"

ENDDEFINE
*
*-- EndDefine: ep_winsock
**************************************************

Rick
 
Couldn't this be extended to an even simpler format? Such as something like this:
[tt]
DEFINE CLASS oleWinsock AS OLECONTROL
OLECLASS="MSWinsock.winsock.1"
ENDDEFINE
[/tt]
Couldn't you then instantiate this class in your program? Would that do the same thing, since this code would be pre-compiled in the EXE? Or would it need to be in a VCX? In that case, could you not do the same thing anyway?

I'm afraid I cannot test this code...I have Visual Studio installed on all of the computers here, allowing me to do my work on any workstation.

Ian
 
Thanks Rick! Creating a plain old class using the OLECONTROL and a winsock control on it and then inheriting that class eliminated the license issue.

Your code snippet did the trick.

Tom

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top