请教:怎样将已做好的数据库管理系统程序做成DLL,供别的系统调用?

aloka 2003-01-09 03:10:33
我已做好一个数据库管理系统程序,其中有设置数据源、查询库存,写入记录等各种窗体,现想把它做成DLL,供别的系统调用,应该怎么样做?请指点!
1、做成activeX.DLL、还是activeX文档DLL?activeX文档DLL用户文档应该写些什么代码?
2、这个DLL中的窗体是不是不能用ADODC控件?
3、这个DLL在调用时如何显示其中的窗体?
...全文
44 点赞 收藏 5
写回复
5 条回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
csscsh 2003-01-22
要做成Dll,必须要对类模块进行编程

在公共类模块中增加公共的方法或属性,在方法中把你要显示的窗体进行显示就可了
回复
ningkang 2003-01-22
参考msdn 创建activex dll 分步教程
回复
ccbl 2003-01-09
DLL是为类写方法,属性,对象,贴点代码自己看


Option Explicit
'*********报表正文对象*********
'功能:添加文本信息,修改文本信息,动态绑定文本数据
'设计人: 日期:2002.10.8
'文件位置:C:\WINDOWS\SYSTEM32\ 注册
'开发周期: 3天
'************************
'以下为属性与方法:
'Txts 正文 (属性) //返回正文集合(正文对象)
'Cells 表格 (属性) //返回表格集合(表格对象)
'Pics 图形 (属性) //返回图形集合(图形对象)
'Objs 对象 (属性) //返回对象集合(对象绑定)
'Count 页总数(属性)
'PageHeader 页眉 (属性)
'PageCauda 页角 (属性)
'ReportHeight宽度 (属性)
'ReportWidth 长度 (属性)
'Page 页号 (属性)
'SetDate 日期 (属性)
'Left 左边距(属性)
'Top 右边距(属性)

'Proview 显示 (方法)
'PrintReport 打印 (方法) //直接输出到报表
'OutHtml 网页 (方法) //直接输出到主页

'集合声明
Private RepTxts As New ReportTXTs
Private RepCells As New ReportCells
Private RepPics As New ReportPics
Private RepObjs As New ReportObjs
Private RepFile As New ReportFile

'页面静态
Private PageHeader_TP As String
Private PageCauda_TP As String
Private ReportHeight_TP As Single
Private ReportWidth_TP As Single
Private Page_TP As Boolean
Private SetDate_TP As Boolean
Private Left_TP As Single
Private Top_TP As Single


Private Declare Function SetBitmapBits Lib "gdi32" (ByVal hBitmap As Long, ByVal dwCount As Long, lpBits As Any) As Long

'正文集合
Public Property Get Txts() As ReportTXTs
Set Txts = RepTxts
End Property

'表格集合
Public Property Get Cells() As ReportCells
Set Cells = RepCells
End Property

'图形集合
Public Property Get Pics() As ReportPics
Set Pics = RepPics
End Property

'对象绑定集合
Public Property Get Objs() As ReportObjs
Set Objs = RepObjs
End Property

Public Property Get File() As ReportFile
Set File = RepFile
End Property

'以下是页面设置信息
'页头设置
Public Property Get PageHeader() As String
PageHeader = PageHeader_TP
End Property

Public Property Let PageHeader(ByVal vData As String)
PageHeader_TP = vData
End Property

'页角设置
Public Static Property Get PageCauda() As String
PageCauda = PageCauda_TP
End Property

Public Static Property Let PageCauda(ByVal vData As String)
PageCauda_TP = vData
End Property

'报表高度
Public Property Get ReportHeight() As Single
ReportHeight = ReportHeight_TP
End Property

Public Property Let ReportHeight(ByVal vData As Single)
ReportHeight_TP = vData
End Property

'报表宽度
Public Property Get ReportWidth() As Single
ReportWidth = ReportWidth_TP
End Property

Public Property Let ReportWidth(ByVal vData As Single)
ReportWidth_TP = vData
End Property

'是否设置页号
Public Property Get Page() As Boolean
Page = Page_TP
End Property

Public Property Let Page(ByVal vData As Boolean)
Page_TP = vData
End Property

'是否设置日期
Public Property Get SetDate() As Boolean
SetDate = SetDate_TP
End Property

Public Property Let SetDate(ByVal vData As Boolean)
SetDate_TP = vData
End Property

'设置左边距
Public Property Get Left() As Single
Left = Left_TP
End Property

Public Property Let Left(ByVal vData As Single)
Left_TP = vData
End Property


'设置右边距
Public Property Get Top() As Single
Top = Top_TP
End Property

Public Property Let Top(ByVal vData As Single)
Top_TP = vData
End Property

Public Sub Proview()
'输出到预览,在此添加过程
Dim i As Long
ViewReport.AutoRedraw = True

For i = 1 To RepTxts.Count
ViewReport.CurrentX = RepTxts(i).CurrentX
ViewReport.CurrentY = RepTxts(i).CurrentY
ViewReport.Print RepTxts(i).Txt & vbLf
Next

For i = 1 To RepCells.Count
ViewReport.CurrentX = RepCells(i).CurrentX
ViewReport.CurrentY = RepCells(i).CurrentY
ViewReport.Print RepCells(i).Txt
Next
Dim jpg() As Byte

For i = 1 To RepPics.Count
jpg() = RepPics(i).Pic
SetBitmapBits ViewReport.Picture1.Image, UBound(RepPics(i).Pic), jpg(1)
Next
ViewReport.Show
End Sub

Private Sub Class_Terminate()
Set RepTxts = Nothing
Set RepCells = Nothing
Set RepPics = Nothing
Set RepObjs = Nothing
Set RepFile = Nothing
End Sub
回复
holydiablo 2003-01-09
做成ActiveXDLL,看起来你对这些组件的写法还有些生疏,还是去google中找一找吧
回复
bu_wen 2003-01-09
做成activex.dll 和 普通 exe 工程一样..可以直接在 dll 里 显示窗体
在dll里设置一些方法,来显示dll里的窗体.
这样在 引用他的工程里就可以调用这个方法来显示窗体.
回复
发动态
发帖子
VB基础类
创建于2007-09-28

7453

社区成员

VB 基础类
申请成为版主
社区公告
暂无公告