⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 form1.frm

📁 使用VB作为开发工具的朋友,应该都知道VB的IDE不支持对AciveDLL添加 输出函数.这样的DLL文件只能采用"引用"的办法来用.有没有办法让它像普 通DLL一样拥有输出函数呢?请使用
💻 FRM
字号:
VERSION 5.00
Begin VB.Form Form1 
   BorderStyle     =   3  'Fixed Dialog
   Caption         =   "Form1"
   ClientHeight    =   2715
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   2475
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   2715
   ScaleWidth      =   2475
   ShowInTaskbar   =   0   'False
   StartUpPosition =   3  '窗口缺省
   Begin VB.TextBox Text1 
      Height          =   330
      Left            =   90
      TabIndex        =   3
      Text            =   "欢迎访问紫水晶工作室"
      Top             =   45
      Width           =   2265
   End
   Begin VB.CommandButton Command3 
      Caption         =   "GetLen"
      Height          =   690
      Left            =   90
      TabIndex        =   2
      Top             =   450
      Width           =   2265
   End
   Begin VB.CommandButton Command2 
      Caption         =   "SetFlat"
      Height          =   690
      Left            =   90
      TabIndex        =   1
      Top             =   1890
      Width           =   2265
   End
   Begin VB.CommandButton Command1 
      Caption         =   "ShowDLLMsg"
      Height          =   690
      Left            =   90
      TabIndex        =   0
      Top             =   1170
      Width           =   2265
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False

'此处的声明一定要与DLL内一致

Private Declare Function ShowMsg Lib "my1stdll.dll" ()
Private Declare Function aa Lib "my1stdll.dll" (ByVal sHwnd As Long)
Private Declare Function SetLen Lib "my1stdll.dll" (ByVal str As String, ByRef kk As Long)


Private Sub Command1_Click()            '弹出DLL内的对话框

ShowMsg

End Sub

Private Sub Command2_Click()            '调用DLL内过程,把指定HWND的按钮样式设置为平面.

MsgBox "设置按钮 " & Chr(34) & "ShowDLLMsg" & Chr(34) & " 为平面样式"

aa Command1.hWnd

Command1.Refresh

End Sub

Private Sub Command3_Click()            '调用DLL内过程,返回指定字符串的长度

Dim A As Long

SetLen Text1.Text, A

MsgBox "Str: " & Text1.Text & vbCrLf & vbCrLf & "Len: " & A

End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -