-
Jul 17th, 2024, 05:35 PM
#1
Thread Starter
PowerPoster
how to make activex dll project by twinbasic?
it's need auto set a default class for public
and when i add 4 class file(1.cls,2.cls,3.cls,4.cls)
By default, each new class added should automatically become a public class object. Excuse me, where can I set the permission to disclose or not to disclose this class? This template seems to be completely unusable at present.
Code:
Module MainModule
' This project type is set to 'ActiveX DLL' in the Settings file
End Module
-
Jul 17th, 2024, 05:49 PM
#2
Thread Starter
PowerPoster
Re: how to make activex dll project by twinbasic?
A new class should automatically add a code like [classid ("9287ac14-E29F-4372-ad68-C87cb6c39D71")].
Double-click the line to prompt whether to create a new ClassId?
Code:
[ClassId("9287AC14-E29F-4372-AD68-C87CB6C39D71")]
Class MyTestLibrary
' ---------------------------------------------------------------------------------------
' For further instructions, please visit https://www.twinbasic.com/preview.html#sample3
' ---------------------------------------------------------------------------------------
' The 'Build Type' of this project is set to ACTIVEX DLL in the project settings
' After building this project, the generated ActiveX DLL will be automatically registered
' so that you can then reference the library in your favourite COM host, like Access VBA or Excel VBA
Public Function MultiplyByTen(ByVal A As Long) As Variant
Return A * 10
End Function
' You'll find the COM reference in the VBA References list under 'MyTestLibrary Project'
' From the VBA side you'd then do something like this:
'
' Dim testObject As New MyTestLibrary
' MsgBox testObject.MultiplyByTen(123456)
'
' PLEASE NOTE: make sure you create a DLL of the correct bitness to match your version of VBA
' (e.g. if you're using the 64-bit version of VBA, make sure you change the 'Active Build' in the twinBASIC panel to 'win64')
End Class
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
|