Microsoft Patch 958369 MS08-070 violated my VB6 application (Mismatch type - dynamically created control)

We updated our machines with the microsoft fix listed above, and now there are problems with some winsock controls. Moving to the new component library, we ran into two problems:

  • We create a Winsock control dynamically using Form.Controls.Add (...). With the new dlls, this gave us a 731 runtime error, stating that we need to add a license.

This problem was resolved by adding the line License.Add (PrgID of the control) before adding the control.

Now the problem is when we try to configure this control on an object of type mWinsock, we get a Mismatch type runtime error. Any thoughts?

+6
vb6 winsock
source share
4 answers

Take a look at "Description of the cumulative update rollup for Visual Basic 6.0 Service Pack 6 (SP6) extended development environment files."

http://support.microsoft.com/kb/957924/

The December 30, 2008 update should remove and replace the defective security update on December 9th. It seems to apply to both 926857 and 957924.

958369 seems to be a Visual FoxPro KB article for the same failed update (December 9th). VFP uses many VB controls.

+2
source share

You may need to add the control to the toolbar so that the project and the VB6 form have the correct link to it. You will need to do this, even if you do not actually have it in shape during development.

With reference to VB, there may not be all the information needed to resolve the methods and properties of the control at run time

+1
source share

Since the interface signatures have changed, you will have to remove the component link from the project, completely save and close VB6, unregister the old control, register the new version from the patch, reopen the project and add the component back in. If you do, you most likely lose support for machines that do not have the patch installed (or you will have to install it as part of your installation package).

Of course, you can always declare the link "As an object" if it will be easier, but your performance will decrease a little and you will lose support WithEvents

0
source share

I ran into a similar problem when dynamically creating non-interminable controls in VB6. Perhaps Winsock is no longer considered internal. Try declaring your variable as VBControlExtender instead of Winsock as follows:

Option Explicit Dim WithEvents objExt As VBControlExtender Private Sub LoadControl() Licenses.Add "MSWinsockLib.Winsock", "xydsfasfjewfe" Set objExt = Controls.Add("MSWinsockLib.Winsock", "myCtl") End Sub Private Sub extObj_ObjectEvent(Info As EventInfo) ' Program the events of the control using Select Case. Select Case Info.Name Case "DataArrival" ' Do stuff End Select End Sub 

See this MSDN article for more details.

0
source share

All Articles