|
-
May 22nd, 2000, 07:45 PM
#1
Having just upgraded to Pro edition i was fiddling around with an activex dll project.
In order to test my newly compiled DLL i tried to use a standard API call like this:
Code:
Public Declare Sub HelloMessage Lib "C:\Windows...\MyNewDLL.dll" ()
but when I called this sub from a command button, an error message said that it could not find the entry point in the dll for this subroutine.
The MSDN hasnt helped me much in this respect, but it says something about needing a class module in all activex components.
the code that i used in the dll subroutine called "HelloMessage" is a simple one to bring up a normal msgbox saying "hello".
This is just a simple task so that i can get used to the way that dll's work. Once i get this sussed out I can expand, and make my fortune!
What am I doing wrong?
Thanks 
-
May 22nd, 2000, 08:25 PM
#2
Member
You can't call an ActiveX DLL like that. What you need to do is start a std exe project and set a reference to your newly compiled COM DLL, (i.e. ActiveX DLL). Look in Project|References and you should see your server name. If you called your project MyNewDLL, you'll see it in your list of available references. Once you've set your reference, you can instantiate classes from your component.
Dim cMine As MyNewDLL.ClassName
Set cMine = New ClassName
cMine.HelloMessage
Set cMine = Nothing
-
May 22nd, 2000, 08:34 PM
#3
Frenzied Member
you'll need a reference to your dll
Code:
'form code
Option Explicit
Private Sub Command1_Click()
Dim obj As New mydll.Class1
obj.HelloMessage
End Sub
Code:
'class1 code
Option Explicit
Public Sub HelloMessage()
MsgBox "Hello from inside this dll.."
End Sub
-
May 23rd, 2000, 12:06 AM
#4
Doh!
Ahhh, brilliant thanks guys
boy, do I feel dumb!
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
|