-
Apr 16th, 2018, 10:03 PM
#1
Thread Starter
Member
How to call a function properly on an ActiveX.dll?
I wrote this code in my class module:
Public Function ListFiles(strPath As String, Optional Extention As String)
Dim File As String
If Right$(strPath, 1) <> "\" Then strPath = strPath & "\"
If Trim$(Extention) = "" Then
Extention = "*.*"
ElseIf Left$(Extention, 2) <> "*." Then
Extention = "*." & Extention
End If
File = Dir$(strPath & Extention)
Do While Len(File)
Form1.List1.AddItem File
File = Dir$
Loop
End Function
And these on my mainform:
Dim x As MyClass
Private Sub Command1_Click()
Set x = New MyClass
x.ListFiles "C:\Users\Public\Music\Sample Music", ""
End Sub
It works fine, but when i transferred it to activeX.dll and having referred to it and add the ff:
Dim x As MyDLL.MyClass
Private Sub Command1_Click()
Set x = New MyDLL.MyClass
x.ListFiles "C:\Users\Public\Music\Sample Music", ""
End Sub
It's giving me an error Object required... My object=nothing... Having problem with this line x.ListFiles "C:\Users\Public\Music\Sample Music", "" when i debug it... I want to resolve why my object=nothing... What am I doing wrong?
-
Apr 17th, 2018, 02:09 AM
#2
Re: How to call a function properly on an ActiveX.dll?
Does the ActiveX DLL have forms?
Because the filenames are added to Form1.List1
This is not Form1.List1 of the calling application, but Form1.List1 in the ActiveX dll
-
Apr 17th, 2018, 10:39 AM
#3
Re: How to call a function properly on an ActiveX.dll?
This translates to the age-old discussion of children not force-feeding their parents, but the other way round: children providing the information, and the parents pulling it.
Last edited by Zvoni; Tomorrow at 31:69 PM.
----------------------------------------------------------------------------------------
One System to rule them all, One Code to find them,
One IDE to bring them all, and to the Framework bind them,
in the Land of Redmond, where the Windows lie
---------------------------------------------------------------------------------
People call me crazy because i'm jumping out of perfectly fine airplanes.
---------------------------------------------------------------------------------
Code is like a joke: If you have to explain it, it's bad
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|