![]() |
Telelogic System Architect (steve huntington) | ![]() |
Topic Title: auto open SA via VB6.0 Topic Summary: Created On: 25-Sep-2008 03:40 Status: Read Only |
Linear : Threading : Single : Branch |
![]() |
![]()
|
![]() Answer: Try following as your starting point: Public Const MAX_CONNECT_STRING = 1024 Sub StartSA() Dim SA_App As Object Dim EncyPath As String Dim EncyName Dim SAStartupPath As String Dim iStart As Long, iEnd As Long, iLen As Long Dim ErrMsg As String Dim UserResponse As Long ' Connect to a running version of System Architect RetryLoop: On Error GoTo OfferToRetry Set SA_App = CreateObject("SA2001.Application") Set SA_IMF = SA_App.Interface("ISAImf") Set sa_Ency = SA_App.Encyclopedia If sa_Ency Is Nothing Then GoTo OfferToRetry End If sa_Ency.OpenObjectsAsReadOnly = True 'need this in case another network user has somthing locked On Error GoTo 0 EncyPath = String(MAX_CONNECT_STRING, " ") SA_IMF.SAGetEncyName EncyPath, MAX_CONNECT_STRING iStart = InStr(1, EncyPath, "(") + 1 iEnd = InStr(1, EncyPath, ")") - 1 iLen = iEnd - iStart + 1 EncyName = Mid(EncyPath, iStart, iLen) Debug.Print EncyPath Debug.Print EncyName GoTo MainExit OfferToRetry: 'Look in MS Word or it may appear that you are stuck UserResponse = MsgBox("This report cannot run now. It must wait until System Architect has opened an encyclopedia.", vbInformation Or vbRetryCancel) If UserResponse = vbRetry Then GoTo RetryLoop End If MainExit: Set dgmcollection = Nothing Set sa_Ency = Nothing Set SA_App = Nothing Exit Sub ErrorTrap: End Sub | |
![]() |
|
hi,all.
I want to open SA via VB6.0. I also want to judge that the user already selected the exist Encyclopedia. I write some test code , it only open SA , but I there is no Encyclopedia box . I want user select the Encyclopedia,and my program read the Encyclopedia's information. The exist code is: |
|
![]() |
|
![]() |
|
Try following as your starting point:
Public Const MAX_CONNECT_STRING = 1024 Sub StartSA() Dim SA_App As Object Dim EncyPath As String Dim EncyName Dim SAStartupPath As String Dim iStart As Long, iEnd As Long, iLen As Long Dim ErrMsg As String Dim UserResponse As Long ' Connect to a running version of System Architect RetryLoop: On Error GoTo OfferToRetry Set SA_App = CreateObject("SA2001.Application") Set SA_IMF = SA_App.Interface("ISAImf") Set sa_Ency = SA_App.Encyclopedia If sa_Ency Is Nothing Then GoTo OfferToRetry End If sa_Ency.OpenObjectsAsReadOnly = True 'need this in case another network user has somthing locked On Error GoTo 0 EncyPath = String(MAX_CONNECT_STRING, " ") SA_IMF.SAGetEncyName EncyPath, MAX_CONNECT_STRING iStart = InStr(1, EncyPath, "(") + 1 iEnd = InStr(1, EncyPath, ")") - 1 iLen = iEnd - iStart + 1 EncyName = Mid(EncyPath, iStart, iLen) Debug.Print EncyPath Debug.Print EncyName GoTo MainExit OfferToRetry: 'Look in MS Word or it may appear that you are stuck UserResponse = MsgBox("This report cannot run now. It must wait until System Architect has opened an encyclopedia.", vbInformation Or vbRetryCancel) If UserResponse = vbRetry Then GoTo RetryLoop End If MainExit: Set dgmcollection = Nothing Set sa_Ency = Nothing Set SA_App = Nothing Exit Sub ErrorTrap: End Sub |
|
![]() |
|
![]() |
|
thanks,above.
Now ,I can open SA via VB6.0,but I also want to minimum and lock the SA like "SA Publisher". The means that user can also use VB Program ,and the SA is lock. How should I do. thanks. |
|
![]() |
FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.