Hi all
In PB, how do I make a reference to a DLL and use the objects in it?
Thanks
In PB, how do I make a reference to a DLL and use the objects in it?
Thanks
Private Sub Form_Load() On Error GoTo ErrorHandler Dim oSQLServerDMOApp As SQLDMO.Application Dim i As Integer 'Use the SQL DMO Application Object to find the available SQL Servers Set oSQLServerDMOApp = New SQLDMO.Application Dim namX As NameList Set namX = oSQLServerDMOApp.ListAvailableSQLServers For i = 1 To namX.Count txtServer.AddItem namX.Item(i) Next 'Show top server txtServer.ListIndex = 0 Set oSQLServerDMOApp = Nothing Exit Sub ErrorHandler: Set oSQLServerDMOApp = Nothing MsgBox Err.Description End Sub
#COMPILE EXE #DIM ALL #INCLUDE "WIN32API.INC" FUNCTION PBMAIN () AS LONG Dim oSQLServerDMOApp As Dispatch Dim i As Integer Dim vRes AS Variant Dim nCount AS Long Dim vIdx AS Variant Dim vItem AS Variant Dim strItem AS String Dim namX As Dispatch 'Use the SQL DMO Application Object to find the available SQL Servers oSQLServerDMOApp = New Dispatch In "SQLDMO.Application" If IsNothing(oSQLServerDMOApp) Then Exit Function Try Object Call oSQLServerDMOApp.ListAvailableSQLServers TO vRes namX = vRes Object Get namX.Count To vRes nCount = Variant#(vRes) For i = 1 To nCount vIdx = i Object Call namX.Item(vIdx) To vItem strItem = Variant$(vItem) MSGBOX strItem Next Catch MSGBOX "Error &H" & Hex$(Objresult) Finally oSQLServerDMOApp = Nothing End Try END FUNCTION
We process personal data about users of our site, through the use of cookies and other technologies, to deliver our services, and to analyze site activity. For additional details, refer to our Privacy Policy.
By clicking "I AGREE" below, you agree to our Privacy Policy and our personal data processing and cookie practices as described therein. You also acknowledge that this forum may be hosted outside your country and you consent to the collection, storage, and processing of your data in the country where this forum is hosted.
Comment