Jump to content

Dll open and dllcall


Recommended Posts

Hi there,

I would be very grateful for any help on this.

I have an application that needs to call a dll to get data from another application.

The other application is a large database with a client application on the local PC.

I want to write an app that can rad information from the database about the current record which is open in this database application.

The vendoe provides an SDK and dll in order to do this, but in order to use the dll I have to call it providing it with credentials and the location of the data source.

Below is a snippet of VB code that works correctly but I cannot seem to find the equivalent of the VB command InitializeWithID.

The VB application is a single command button that onclick calls the dll, opens the remote data source and returns the reference number for the current record open in this other database application.

Here is the VB code:

Private Sub Btn_Populate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Btn_Populate.Click

Dim em As New DLLName.Function

Dim sess_id

Dim num

Dim err

Dim outcome

Dim VCDB, prod_name, version, login

Dim x = em.InitializeWithID(0, "192.168.1.15", "USERNAME", "PASSWORD", "", "SUPPLIERID", sess_id, VCDB, prod_name, version, login, err, outcome)

em.DLLfunctioncall(sess_id, num, err, outcome)

MessageBox.Show(num)

End Sub

Before you ask, if it works in VB why not stick with that, the answer is that the main application, written in AutoIt, is now many thousands of lines of code and uses functionality that is not available in VB!!

Many thanks,

David

AutoIt rules!

Link to comment
Share on other sites

Hi there,

I would be very grateful for any help on this.

I have an application that needs to call a dll to get data from another application.

The other application is a large database with a client application on the local PC.

I want to write an app that can rad information from the database about the current record which is open in this database application.

The vendoe provides an SDK and dll in order to do this, but in order to use the dll I have to call it providing it with credentials and the location of the data source.

Below is a snippet of VB code that works correctly but I cannot seem to find the equivalent of the VB command InitializeWithID.

The VB application is a single command button that onclick calls the dll, opens the remote data source and returns the reference number for the current record open in this other database application.

Here is the VB code:

Private Sub Btn_Populate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Btn_Populate.Click

Dim em As New DLLName.Function

Dim sess_id

Dim num

Dim err

Dim outcome

Dim VCDB, prod_name, version, login

Dim x = em.InitializeWithID(0, "192.168.1.15", "USERNAME", "PASSWORD", "", "SUPPLIERID", sess_id, VCDB, prod_name, version, login, err, outcome)

em.DLLfunctioncall(sess_id, num, err, outcome)

MessageBox.Show(num)

End Sub

Before you ask, if it works in VB why not stick with that, the answer is that the main application, written in AutoIt, is now many thousands of lines of code and uses functionality that is not available in VB!!

Many thanks,

David

AutoIt rules!

AutoIt is a lot like VBScript and nothing like VB.

Do you have the interface description of that DLL function call from the vendor, listing the exact data passed and return type? If so, AutoIt can still probably run the DLL, but the syntax won't resemble VB, so translating from that isn't going to help.

>_<

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...