COM simple program (VB)

xiaoxiao2021-03-06  103

Add an EXE project to add an ActiveXDLL project

Modify the Class1 class in the ActiveX project to CLSADD and add the following code PUBLIC FUNCTION ADDOTEGER Addone = Inum 1END FUNCTION Generate DLL file Add a reference to the project 2 within the EXE project (SP to upgrade to SP4 You can see the Chinese characters, otherwise choose the more like that), then add the following code DIM CLS1 AS New CLSADD 'Add a CommandButton Control Private Sub Command1_Click () DIM ITESTNUM AS ITESTNUM = 9 msgbox cls1.addone (Itestnum) End Sub Generate EXE file runs EXE file

转载请注明原文地址:https://www.9cbs.com/read-103456.html

New Post(0)