国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 開發 > 綜合 > 正文

用VB6創建MTS組件

2024-07-21 02:15:41
字體:
來源:轉載
供稿:網友
'隨便貼貼,學過vb的人都應該知道的,不好意思。
'**********************************************************************************************
' mts vb6 com component template - by michael gonzalez
'**********************************************************************************************
'(1) you must create a reference to the microsoft transaction server type library (mtxas.dll).
' if using windows 2000, choose the com+ services library (comsvcs.dll) instead.
'(2) set your classmodule's mtstransactionmode property to 2 - requirestransaction
' note: only use 2 - requires transaction if you plan on using the component with an msdtc-
' compliant resource manager such as msmq or sql server - otherwise, use
' 1 - no transactions
'(3) make sure your project's unattended execution property is checked
'(4) make sure your project's component version compatibility is set to binary compatibility
'**********************************************************************************************
' objectcontrol implements the interface that is used by mts when the object is
' activated and/or deactivated - this happens when you call one of the components's methods
' the objectcontrol implementation makes use of three procedures:
' 1) objectcontrol_activate
' 2) objectcontrol_canbepooled
' 3) objectcontrol_deactivate
'**********************************************************************************************
implements objectcontrol

dim objoc as objectcontext

public sub something()
'this is a user-defined procedure/method
'the objectcontext object is returned by getobjectcontext

on error goto abort

'*******************************************************
' perform whatever you want in this area
' visual basic 6 stuff goes here
' the something() procedure/method is just
' an example - you may use properties and other
' methods/procedures as well!
'*******************************************************

finished:
objoc.setcomplete
exit sub
abort:
objoc.setabort
err.raise err.number, err.source, err.description
exit sub
end sub

private sub objectcontrol_activate()
'mts invokes this procedure/method when the component/object is instantiated
set objoc = getobjectcontext()
exit sub
end sub

private function objectcontrol_canbepooled() as boolean
'this enables mts object pooling (not currently supported my mts 2.0)
objectcontrol_canbepooled = true
end function

private sub objectcontrol_deactivate()
'mts invokes this procedure/method right before the component/object is released
set objoc = nothing
exit sub
end sub


發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 乌拉特后旗| 汤阴县| 鹿泉市| 平潭县| 凤冈县| 邵阳县| 阿鲁科尔沁旗| 友谊县| 图片| 扎兰屯市| 平江县| 濮阳县| 宜都市| 上高县| 温州市| 阳新县| 涪陵区| 信阳市| 青岛市| 广宗县| 于田县| 溆浦县| 西城区| 瑞安市| 绵竹市| 乃东县| 客服| 谢通门县| 新津县| 攀枝花市| 嵊泗县| 子洲县| 榕江县| 扶绥县| 德令哈市| 郧西县| 高淳县| 通化市| 德化县| 邵阳市| 洪泽县|