Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

Can the ActiveX control be used in Visual Basic without a form?

0
Posted

Can the ActiveX control be used in Visual Basic without a form?

0

Yes, there are two ways that the control can be used without a form in Visual Basic. One is to create a reference to the control by selecting Project | References from the menu, then clicking on the Browse button and selecting the control’s file name. Then, in the program, an instance of the control can be created using the Dim statement as follows: Dim objSocket As New SocketWrench The other approach is to use the CreateObject method: Dim objSocket As Object Dim strLicenseKey As String Set objSocket = CreateObject(“SocketTools.SocketWrench.5”) objSocket.Initialize strLicenseKey Note that the strLicenseKey value must be obtained from the cswskey5.bas module that was created in the \Include folder where the product was installed. The Initialize method must be called explicitly when using the CreateObject function; otherwise a licensing error will occur when redistributing the application.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123