|
悬赏30金币已解决
求解释.二次开发T6 的clsProductFacade接口要怎么实现
clsProductFacade接口中用于协调子窗体与原MDI主窗体的交互的SetFrmProxy函数总是提示初始化插件失败!自己 乱整了一天都没结果呀. 哭呀.....百度了一天找到的VB 好难懂
百度来的VB Code
- VERSION 1.0 CLASS
- BEGIN
- MultiUse = -1 'True
- Persistable = 0 'NotPersistable
- DataBindingBehavior = 0 'vbNone
- DataSourceBehavior = 0 'vbNone
- MTSTransactionMode = 0 'NotAnMTSObject
- END
- Attribute VB_Name = "clsProductFacade"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = True
- Attribute VB_PredeclaredId = False
- Attribute VB_Exposed = True
- Option Explicit
- 'by lg070314 新增兼容u870的新接口调用
- '函数ILoginable_CallFunction
- '函数ILoginable_Login
- '属性Business
- '函数ILoginable_LogOff
- Implements UFPortalProxyInterface.ILoginable
- Private Function ILoginable_CallFunction(ByVal cMenuId As String, ByVal cMenuName As String, ByVal cAuthId As String, ByVal cCmdLine As String) As Object
- Set ILoginable_CallFunction = CallFunction(cMenuId, cMenuName, cAuthId, cCmdLine)
- End Function
- Private Function ILoginable_Login() As Boolean
- If ((Not g_business Is Nothing) And g_bLogined = False) Then
- Dim oLoginTmp As Object
- Set oLoginTmp = g_business.GetVBclsLogin()
- Set m_login = oLoginTmp
- ILoginable_Login = login(oLoginTmp)
- Set ClsBill = New USERPCO.VoucherCO
- ClsBill.IniLogin m_login, errStr
- Set moLogin = ClsBill.login
- If (ILoginable_Login = True) Then
- g_bLogined = True
- End If
- Else
- ILoginable_Login = True
- End If
- End Function
- Public Property Get Business() As Object
- Set Business = g_business
- End Property
- Public Property Set Business(busVal As Object)
- Set g_business = busVal
- Call Create_Odl_Cls
- Set Old_ModuleCls.Business = busVal
- End Property
- Private Function ILoginable_LogOff() As Boolean
- ILoginable_LogOff = True
- If (g_bLogined = True) Then
- ILoginable_LogOff = LogOff()
- If (ILoginable_LogOff = True) Then
- g_bLogined = False
- End If
- End If
- End Function
- '调用子窗体接口,与原左树菜单控件接口一致,gd_frmMain为原MDI主窗口对象
- '优先处理二次开发的功能节点,之后再处理系统原有的功能菜单'
- ' by 客户化开发中心 2006/03/01
- Public Function CallFunction(ByVal cMenuId As String, ByVal cMenuName As String, ByVal cAuthId As String, ByVal cCmdLine As String) As Object
- g_FormbillShow = False
- If bLoadmain = False Then
- g_bLoginSuccess = False
- Call Main
-
- If Screen.MousePointer = vbHourglass Then Screen.MousePointer = vbDefault
- If g_bLoginSuccess = False Then Exit Function
- End If
- Select Case cMenuId
- Case "MT0001", "MT0101", "MT0102", "MT0103", "MT0104", "MT0201", "MT0202", "MT0203", "MT0204", "MT0301", "MT0302", "MT0303", "MT0304", "MT0305", "MT0306"
- gd_frmMain.m_oMenu_OnCommand cMenuId, cMenuName, cAuthId, cCmdLine
- Case "MT0105" '材料出库生单
- If objKCGL Is Nothing Then
- Set objKCGL = CreateObject("KCGLSQL.clsProductFacade")
- End If
- Dim gobjLogin As New U8Login.clsLogin
- Set gobjLogin = m_login
- gobjLogin.login ("ST")
- Set objKCGL.Business = g_business
- objKCGL.login gobjLogin
- '==============jiang==============
- objKCGL.CallFunction "ST020202", cMenuName, "ASM0401", cCmdLine
- '安洽项目
- ''''''''''''''''''''cshu''''''''''''''''''''''''''''''
- End Select
- End Function
- '设置命令行参数,用于自动登录,860不用
- Public Function SetCommandLine(ByVal cCmd As String) As Boolean
- SetCommandLine = True
- Old_ModuleCls.SetCommandLine cCmd
- End Function
- '发送注销消息,gd_frmMain为原MDI主窗口对象
- Public Function LogOff() As Boolean
- g_bCanExit = False
- If bLoadmain = True Then
- Unload gd_frmMain
- '卸载主窗体过程中需要关闭所有本产品打开的窗体,如果成功,将g_bCanExit设为True,否则,将g_bCanExit设为False。
- LogOff = g_bCanExit
- Else
- LogOff = True
- Exit Function
- End If
-
- If LogOff = True Then
- 'LogOff = Old_ModuleCls.LogOff
- End If
- End Function
- '设置窗口管理器对象,用于协调子窗体与原MDI主窗体的交互,g_oMainFrmProxy为门户主窗体代理全局对象
- Public Function SetFrmProxy(ByRef oFrmProxy As Object) As Boolean
- ' Call Create_Odl_Cls
- Set g_oMainFrmProxy = oFrmProxy
- Old_ModuleCls.SetFrmProxy oFrmProxy
- End Function
- '设置报表管理器,pRepLst为报表管理器全局对象
- Public Sub SetReportMgr(pRep As clsReportManager)
- Set pRepLst = pRep
- Old_ModuleCls.SetReportMgr pRep
- End Sub
- '设置报表系统接口,pRepSysinfo为报表系统接口全局对象
- Public Sub SetSysInterface(pSys As clsSysInterface)
- Set pRepSysinfo = pSys
- Old_ModuleCls.SetSysInterface pSys
- End Sub
- '设置Login对象,初始化产品,g_oLogin为产品使用的全局U8Login对象,此接口必须显式返回True或False
- Public Function login(oLogin As Object) As Boolean
- Dim rst As ADODB.Recordset
- ' Call Create_Odl_Cls
- Set m_login = oLogin
- ' Old_ModuleCls.login oLogin
- Call Create_Report_Object
- If cModeCode = "" Then
- bLoadmain = False
- login = True
- End If
- End Function
- '扩展解决与外部接口问题
- Public Function SetUseModeName(sUseModeName As String) As Boolean
- cModeCode = UCase(sUseModeName)
- End Function
- Public Function GetVouchForm() As Object
- Set GetVouchForm = GetActiveForm()
- End Function
- '设置产品按钮风格,在门户中改变按钮风格时调用
- Public Function SetButtonStyle(ByVal cBtnStyle As String) As Boolean
- 'cBtnStyle为"T"表示文本按钮;cBtnStyle为"P"表示图片按钮
- Call GetApperance
- g_bTextButton = IIf(UCase(cBtnStyle) <> "P", True, False)
- Call ChangeToolbar
- SetButtonStyle = True
- End Function
- '将系统类传出供外部系统更改部分参数
- Public Function GetSASysInfObject() As Object
- Set GetSASysInfObject = clsSAWeb
- End Function
- '是否实现加载了单据窗体
- Public Property Get bSuccessShowVoucher() As Boolean
- bSuccessShowVoucher = g_FormbillShow
- End Property
- '读取配置文件
- 'by 客户化开发中心 2006/03/01
- Public Sub Create_Odl_Cls()
- On Error GoTo Err
- 'Old_ModuleCls_name表示要替换的原先的类名称
- Old_ModuleCls_name = "UfSubSys.clsProductFacade"
-
- If Trim(Old_ModuleCls_name) <> "" Then
- If Old_ModuleCls Is Nothing Then
- Set Old_ModuleCls = CreateObject(Old_ModuleCls_name)
- End If
- End If
- Exit Sub
- Err:
- MsgBox "类参数配置错误,请检查!" & Err.Description
- End Sub
- 'by ahzzd 20070323
- '处理870不能对老报表的支持
- '在这里初始化这两个对象
- 'Public pRepSysinfo As clsSysInterface
- Public Sub Create_Report_Object()
- On Error Resume Next
- If pRepSysinfo Is Nothing Then
- Dim adoConn As New ADODB.Connection
- adoConn.ConnectionString = m_login.UfDbName
- adoConn.Open
- Set pRepSysinfo = New clsSysInterface
- pRepSysinfo.systemId = m_login.cSub_Id
- pRepSysinfo.ServerRunmode = False
- Set pRepSysinfo.objU8Login = m_login
- pRepSysinfo.InitInterFace m_login.cSub_Id, , , adoConn, , , , , , , , , m_login
- Set pRepLst = pRepSysinfo.GetReportEngine()
- If pRepLst Is Nothing Then MsgBox " pRepLst Is Nothing "
- Old_ModuleCls.SetSysInterface pRepSysinfo
- Old_ModuleCls.SetReportMgr pRepLst
- pRepSysinfo.HelpFile = App.HelpFile
- Set adoConn = Nothing
- End If
- End Sub
复制代码
|
|