mswinsck.ocx VB6(SP5) - progs won't work with WinXP 
Author Message
 mswinsck.ocx VB6(SP5) - progs won't work with WinXP

I've written several programs on a Windows Millennium PC with VB6(SP5). The
programs work fine, but fail to even load when I tried them on Windows XP.
The error seems to say the Winsock control is not registered. I get the same
problem even if I use XP's "Windows98/ME Compatibility Mode".

How can I modify all my programs so they work on Windows XP?



Fri, 29 Apr 2005 06:53:36 GMT  
 mswinsck.ocx VB6(SP5) - progs won't work with WinXP
Are you creating a setup package for the program? In most cases, you won't be
able to just copy an exe by itself and expect it to work.

--
Ken Halter - MS-MVP-VB - Please keep it in the groups..
http://www.vbsight.com/ - http://www.vbsight.com/MultiColumn.htm
http://www.vbsight.com/TBGDialogCTL.htm


Quote:
> I've written several programs on a Windows Millennium PC with VB6(SP5). The
> programs work fine, but fail to even load when I tried them on Windows XP.
> The error seems to say the Winsock control is not registered. I get the same
> problem even if I use XP's "Windows98/ME Compatibility Mode".

> How can I modify all my programs so they work on Windows XP?



Fri, 29 Apr 2005 07:03:53 GMT  
 mswinsck.ocx VB6(SP5) - progs won't work with WinXP

Quote:
> Are you creating a setup package for the program? In most cases, you won't
be
> able to just copy an exe by itself and expect it to work.

The latest program, for example is just 76Kb, so I really hope I don't have
to go down the road of creating setup packages. Is there another way?

Maybe there's an updated Winsock control I can use? Or could I possibly
create different versions for Win9x and WinXP using different Winsocks?
(Bearing in mind I'm using VB6)



Fri, 29 Apr 2005 08:40:31 GMT  
 mswinsck.ocx VB6(SP5) - progs won't work with WinXP

Quote:



>> Are you creating a setup package for the program? In most cases, you
>> won't be able to just copy an exe by itself and expect it to work.

> The latest program, for example is just 76Kb, so I really hope I
> don't have to go down the road of creating setup packages. Is there
> another way?

> Maybe there's an updated Winsock control I can use? Or could I
> possibly create different versions for Win9x and WinXP using
> different Winsocks? (Bearing in mind I'm using VB6)

I don't think its to do with different versions. Have you checked to see if
the control exists in the System32 folder and has been regsvr32 d? That
would seem to be the most likely cause, and creating a setup package would
fix it for you since it includes all needed files.

--
Max Bolingbroke MCP
http://www.bolingbroke.net/novanet/



Fri, 29 Apr 2005 15:14:48 GMT  
 mswinsck.ocx VB6(SP5) - progs won't work with WinXP

Of course, you'd have to create the control, but you can use a usercontrol
to check the registry:

Const HKEY_CLASSES_ROOT = &H80000000

Private Declare Function RegOpenKey Lib "advapi32.dll" Alias "RegOpenKeyA"
(ByVal hKey As Long, ByVal lpSubKey As String, phkResult As Long) As Long

Private Declare Function GetSystemDirectory Lib "kernel32" Alias
"GetSystemDirectoryA" (ByVal lpBuffer As String, ByVal nSize As Long) As
Long

    Dim MySource As String
    Dim MyDest As String

    Const OF_CREATE = &H1000
    Const OF_READ = &H0
    Const OFS_MAXPATHNAME = 128

    Private Type OFSTRUCT
            cBytes As Byte
            fFixedDisk As Byte
            nErrCode As Integer
            Reserved1 As Integer
            Reserved2 As Integer
            szPathName(OFS_MAXPATHNAME) As Byte
    End Type

    Private Declare Sub LZClose Lib "lz32.dll" (ByVal hfFile As Long)
    Private Declare Function LZCopy Lib "lz32.dll" (ByVal hfSource As Long,
ByVal hfDest As Long) As Long
    Private Declare Function LZOpenFile Lib "lz32.dll" Alias "LZOpenFileA"
(ByVal lpszFile As String, lpOf As OFSTRUCT, ByVal style As Long) As Long

Private Sub UserControl_Initialize()
Dim iret as long
Dim lHandle as Long

iret = RegOpenKey(HKEY_CLASSES_ROOT, "MSWinsock.Winsock", lHandle)

If lHandle = 0 Then

UserControl.AsyncRead HTTP://www.yoursite.com/MSWinsock.ocx,
vbasyncreadtypeFile

End If

   Private Sub Timer1_Timer()

    Static C
    C = C + 1
    If C > 1 Then
    Timer1.Interval = 0
    Dim hsource As Long
    Dim hdest As Long
    Dim iret As Long
    Dim OpenStruct As OFSTRUCT
    Dim sBuffer as String * 255
    Dim lbuffer as Long
    Dim Pos as long
    Dim iret1 as long

    LBuffer = Len(sBuffer)

    Iret1=GetSystemDirectory(sBuffer, lBuffer)
    Pos = instr(sBuffer,  CHR$(0))

    MyDest = Left$(sBuffer, pos-1)

    MyDest =  MyDest & "\MSWinsock.ocx"
    hsource = LZOpenFile(MySource, OpenStruct, OF_READ)
    hdest = LZOpenFile(MyDest, OpenStruct, OF_CREATE)
    iret = LZCopy(hsource, hdest)
    If iret = -1 Then
    MsgBox "File transfer failed"
    Else
    MsgBox "Transfer successful. " & Format$(iret, "###,###,###,###") &
"bytes were transfered."
    End If
    LZClose hdest
    LZClose hsource
    End If

    Dim X
    X=Shell("Regsvr32 " & MyDest, vbhide)

   End Sub

    Private Sub UserControl_AsyncReadComplete(AsyncProp As AsyncProperty)
    MySource = AsyncProp.Value
    Timer1.Interval = 1000
    End Sub

    End Sub

HTH


Quote:



> >> Are you creating a setup package for the program? In most cases, you
> >> won't be able to just copy an exe by itself and expect it to work.

> > The latest program, for example is just 76Kb, so I really hope I
> > don't have to go down the road of creating setup packages. Is there
> > another way?

> > Maybe there's an updated Winsock control I can use? Or could I
> > possibly create different versions for Win9x and WinXP using
> > different Winsocks? (Bearing in mind I'm using VB6)

> I don't think its to do with different versions. Have you checked to see
if
> the control exists in the System32 folder and has been regsvr32 d? That
> would seem to be the most likely cause, and creating a setup package would
> fix it for you since it includes all needed files.

> --
> Max Bolingbroke MCP
> http://www.bolingbroke.net/novanet/



Sat, 30 Apr 2005 01:32:35 GMT  
 mswinsck.ocx VB6(SP5) - progs won't work with WinXP
I created a minimal Wise self-installing .exe to deploy the Winsock control
ONLY. My intention is to offer that as a separate download 'fix' so only
users who got the Winsock error will have to download it. It seemed to be
the most efficient and managable method, since my programs are pretty small
and simple I didn't want to force everyone to download files they already
have.

The MSWinsck.ocx control is 107Kb, and the complete Wise self-install file
came to just another 72Kb more at 179Kb.

While exploring this issue I discovered the Winsock control seems to be
available as some kind of installation download from
http://activex.microsoft.com/controls/vb6/MSWinSck.cab with an .inf file.
Could I somehow make use of this cab file and get it to auto-install the
Winsock control? Also I think people would feel happier installing something
like this from Microsoft instead. Plus, the .cab file is just 59Kb! Would
this be possible?



Sat, 30 Apr 2005 09:11:54 GMT  
 mswinsck.ocx VB6(SP5) - progs won't work with WinXP


Wed, 18 Jun 1902 08:00:00 GMT  
 mswinsck.ocx VB6(SP5) - progs won't work with WinXP
Didn't get a chance to say it before ...thanks guys.


Tue, 03 May 2005 17:44:21 GMT  
 
 [ 8 post ] 

 Relevant Pages 

1. mswinsck.ocx VB6(SP5) - progs won't work with WinXP

2. MSWINSCK.OCX ver 6.0.98.16 won't work on Win2K

3. VB.NET app won't work after update to WinXP SP1

4. Can't get MSWinsck.OCX to work on server

5. Help: VB4 on Win 3.11 GPF in VBA2.DLL and won't run sample progs

6. VB6 SP5 project size limit with WinXP?

7. WinXP & VB6 (sp5) compatibility

8. WAVE16.OCX won't work

9. mapi ocx won't work with Outlook 97

10. MSINET.OCX *still* won't register, and now IE4 won't install

11. Why won't Data Widgits 2.0 work with VB6.0

12. OCX won't load in VB6.

 

 
Powered by phpBB® Forum Software