ActiveX DLL ????? 
Author Message
 ActiveX DLL ?????

Can anyone please help. I've looked at simple examples including MS's Thing
and can't figure out how to make a simple form with a textbox and a command
and take a simple string from a simple VB6  DLL. Below is a sample. I have
made a Mydll.dll and referenced it.

'In Form1
Option Explicit
Private Declare Function Thing Lib "Class1.dll" (Saying As String)
Public Saying As String

Public Sub Command1_Click()
    Text1.Text = Thing(Saying)
End Sub


'In Class1.Cls
Option Explicit
Dim Saying As String
Private Function Thing()
    Saying = "Hey Now"
End Function

Thu, 14 Feb 2002 03:00:00 GMT  
 ActiveX DLL ?????
A VB6 DLL is an COM component, so you do not have to use the declare
statement.  First you need to set a reference to your DLL in the References
dialog on the Project Menu.  Then you can use the following code.  First
declare a variable as the class in your DLL and then call the Thing

'In Form1
Option Explicit

Public Sub Command1_Click()
    Dim objMyDLL As New MyDLL.Class1
    Text1.Text = objMyDLL.Thing
End Sub

You will also need to change the Class code.  First I would make the
Function Thing Public so your project can see it.  Next you need to declare
a return value for the Thing Function.  Finally, say what to return (thing =

'In Class1.Cls
Option Explicit
Private Function Thing() as String
     Thing = "Hey Now"
 End Function

Matthew Arnheiter
Flash Creative Management

Thu, 14 Feb 2002 03:00:00 GMT  
 [ 2 post ] 

 Relevant Pages 

1. ActiveX.exe or ActiveX DLL or ActiveX Control?????????????

2. ActiveX DLL, ActiveX EXE & ActiveX OCX version

3. ActiveX DLL, ActiveX EXE & ActiveX OCX version

4. Building ActiveX controls that will access activex.dll running on PWS

5. ActiveX exe vs ActiveX dll

6. ActiveX DLL to ActiveX EXE

7. ActiveX dll vs ActiveX control - Whats the difference

8. ActiveX Exe Using ActiveX Dll?

9. Accessing IE5 DOM from inside my clientside activex obj in a activex dll

10. ActiveX DLL vs ActiveX EXE

11. Why DCOM ActiveX Exe is Working and ActiveX Dll is not working

12. Passing ActiveX control as a parrameter to ActiveX.dll


Powered by phpBB® Forum Software