I have never written a Win32 application before but I recently purchased PBWin90 with the intention of learning and developing something useful. So, I have been struggling with COM syntax and being able to access the routines in a specific DLL.
Here is what does work in VB 2005 Express:
Question
I feel like I have looked through all the DOC's and samples and have hit a wall. So, any chance someone here on the board could duplicate the above VB in PB? It would be greatly appreciated.
Here is the include output from the PowerBasic COM Browser
Here is the DLL file: uniobjects.dll
Here is the TLB file: uniobjects.tlb
Here is the VB include file I converted to PB.
Thanks in advance.
Here is what does work in VB 2005 Express:
Code:
#INCLUDE "vb_unioaif.inc" PrivateSub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) HandlesMyBase.Load Dim objSession AsObject objSession = CreateObject(UV_SESSION_OBJECT) If objSession IsNothingThen MsgBox("Error creating object", MsgBoxStyle.Critical) ExitSub' End the program EndIf objSession.UserName = "fredsmith" objSession.Password = "password" objSession.HostName = "host.example.com" objSession.AccountPath = "/home/FREDSMITH" objSession.Transport = 1 objSession.Connect() If objSession.IsActive Then If objSession.HostType = UVT_UNIX Then MsgBox("You are connected to a UNIX server") Else MsgBox("You are connected to a Windows NT system") EndIf objSession.Disconnect() Else ' ' Check for Session errors - display message box with error code ' No error means the user cancelled the connection dialog box ' If objSession.Error <> UVE_NOERROR Then MsgBox("Unable to open connection :- " & objSession.Error) EndIf EndIf EndSub
I feel like I have looked through all the DOC's and samples and have hit a wall. So, any chance someone here on the board could duplicate the above VB in PB? It would be greatly appreciated.
Here is the include output from the PowerBasic COM Browser
Here is the DLL file: uniobjects.dll
Here is the TLB file: uniobjects.tlb
Here is the VB include file I converted to PB.
Thanks in advance.
Comment