2 Replies - 4288 Views - Last Post: 07 July 2012 - 03:44 AM Rate Topic: -----

#1 aringo.boringo  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 06-July 12

Vb6 problem: Exe --> dll --> mswinsck.ocx

Posted 06 July 2012 - 04:07 PM

Hello, I'm having troubles with the deployment of an application.
I'm a newbie and I'm almost sure I'm missing something in the compile and build procedure.

I wrote a DLL (let's call it MEDIATION.DLL) which has a reference to the MSWINSCK.OCX.
I need this reference to use winsock objects and functions inside the DLL.

Then I wrote a standard exe program (let's call it CLIENT.EXE) to test if the DLL is working. This program constitutes a separated project from the MEDIATION.DLL but has a reference to it.

I tested the EXE and the DLL inside the development workstation and everything works fine (I just have to register MEDIATION.DLL with regsvr32).

Unfortunately tests does not work outside the development workstation.
The deployment steps that I do are:
- register MSWINSCK.OCX: popup appears and tells that the registration is successfull
- register MEDIATION.DLL: popup appears and tells that the registration is successfull
- run the CLIENT.EXE: popup appears and tells "Run-time error '429': Activex component can't create object"

Here follows some test I made that I hope could be helpfull to understand:

I wrote DIRECTCLIENT.EXE that doesn't pass through MEDIATION.DLL to use winsock, it has a direct reference to MSWINSCK.OCX.
Tests are successfull both in development and end-user worstation.

I wrote a TESTCLIENT.EXE and a DUMMY.DLL, the dll is called just to calculate the sum of two numbers, TESTCLIENT.EXE calls the dll and shows the result.
Tests are successfull both in development and end-user worstation.

I tried two different ways of referencing DLLs:
1) registering dll, opening the menu Project->References and then choosing the dll from the list of available references;
2) opening the menu Project->References, clicking on the 'Browse' button and then "taking" the DLL from the file system.
Neither of theese procedures worked successfully in the end-user workstation.

To build DLLs and EXEs I simply use the menu File->Make.

All the development and deployment process has been done with windows xp machines (actually I don't need to use my dll in recent OSs).

Thanks in advance
Hello
Aringo

Is This A Good Question/Topic? 0
  • +

Replies To: Vb6 problem: Exe --> dll --> mswinsck.ocx

#2 maj3091  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 299
  • View blog
  • Posts: 1,768
  • Joined: 26-March 09

Re: Vb6 problem: Exe --> dll --> mswinsck.ocx

Posted 06 July 2012 - 11:58 PM

Can you show the bits of code that you're using to instantiate and use the control, in your DLL and EXE tests that you did, might make it easier for people to understand what you're doing.

Secondly, are you certain the error is referring to the WinSock and not another control?
Was This Post Helpful? 0
  • +
  • -

#3 aringo.boringo  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 06-July 12

Re: Vb6 problem: Exe --> dll --> mswinsck.ocx

Posted 07 July 2012 - 03:44 AM

Hello maj3091, you're right, maybe there's something missing to better understand the problem.

1) What does the DLL:
I had to develop a DLL that has to be used by another developer.
My DLL has to do a very simple job, it exposes just one function.
The contained in the DLL uses winsock to connect to an html page, process the page, obtain a substring and return it.
The DLL should be registered in different environments and used by another application (written in vb6).

2) What does the client:
The CLIENT.EXE is just a standard exe that I wrote to test if the DLL is working.
It just instantiates the object, calls its only function, gets the string and shows it inside a textbox.

3) There are probably no deployment problems with winsock:
I wrote DIRECTCLIENT.EXE that doesn't pass through MEDIATION.DLL; it uses winsock directly.
The deployment in the end-user workstation was successful, everything worked fine.

Finally, the code:
CLIENT.EXE
Private Sub Command1_Click()
    Dim med As MediationClass
    Set med = New MediationClass
    Text1.Text = med.geSubString("custom-parameter")
End Sub



MEDIATION.DLL
Option Explicit
Dim WithEvents winSck As Winsock

Private Sub Class_Initialize()
    Set winSck = New Winsock
End Sub

Private Sub Class_Terminate()
    Set winSck = Nothing
End Sub

Public Function geSubString(ByVal customParameter As String) As String
    ' do something
    winSck..Connect
    ' do something
    geSubString = "result string"
End Function


Was This Post Helpful? 0
  • +
  • -

Page 1 of 1