Question Using a structure declared in a DLL

ee0jmt

New member
Joined
Jul 15, 2008
Messages
1
Programming Experience
1-3
I have created a DLL (called AddOnFunctions.dll) which contains the following structure:

VB.NET:
 Public Structure databaseResults
        Dim oneCompleted As Boolean
        Dim twoCompleted As Boolean
        Dim threeCompleted As Boolean
        Dim finalArray(,) As String
    End Structure
The DLL also contains a function that returns this structure.

I have created a program that uses the DLL mentioned. I have declared the function in the DLL using the following line:
VB.NET:
Public Declare Function searchDatabases Lib "AddOnFunctions" Alias "searchDatabases" (ByVal data As String) As databaseResults

but the program does not recognise the databaseResults structure returned by the function, because it has been declared in the DLL and not the program calling the function.

How can I declare the structure in my program using the actual structure in the DLL.

I know there are other ways of importing DLL files into programs, however I want to be able to create different DLL files with the same name and function declarations and return values, but the actual functions will have different code and the structure could contain different values. When I come to deploy the program I will just need to copy the appropriate dll file and not have to recompile the whole program.

All help appreciated!
 
Back
Top