Passing Multiple Parameters to a DLL function


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 5 of 5

Thread: Passing Multiple Parameters to a DLL function

  1. #1
    Join Date
    Jul 2005
    Location
    Kenya
    Posts
    32

    Passing Multiple Parameters to a DLL function

    Hi Guyz,

    Im very new to working with DLLs. I want to create DLL which will get values from a third party software and parameters passed to it to perform some process.
    Here is the Defination

    Public Sub Hello(YourName As String, YourAcc As String, AvailBal As String)
    'Area to put code to process

    MsgBox "Hello " & YourName & "!", vbInformation
    MsgBox "Your Account is " & YourAcc & "!", vbInformation
    MsgBox "Available Balance is " & avaibal & "!", vbInformation

    End Sub

    So i want to pass the three parameters when i call it but it seem not to be working. All the parameters im passing them as variables.

    'Here Calling the DLL fuction

    Private Sub CmdProc_Click()
    Dim Jina As String
    Dim AccNo As String
    Dim AvaBal As String

    AccNo = InputBox("Enter Account No")

    FindCrit = "ACCNO='" & AccNo & "'"
    DFAccs.Find FindCrit
    Jina = DFAccs!ACNAME
    AvaBal = DFAccs!AvailBal

    Hello(Jina,AccNo,AvaBal) 'This line is not working

    End Sub

    When i call Hello fuction with the parameters as shown above.. the compiler doesnt accept, the lines are shown in red. So could somebody show me how to call that function and pass the three parameters to it.
    Last edited by wandera; 11-24-2005 at 10:24 AM.

  2. #2
    Join Date
    May 2005
    Location
    UK
    Posts
    278
    what does DFAccs this do ? cant seem to understand its presence in your code
    Sri

  3. #3
    Join Date
    Jul 2005
    Location
    Kenya
    Posts
    32
    DFaccs is a recordset which is opened at the form load. i.e database connection and opening is done at form load. I want to query in that recordset i.e DFaccs.

  4. #4
    Join Date
    Nov 2003
    Location
    Portland, OR
    Posts
    8,387
    Hello(Jina,AccNo,AvaBal) 'This line is not working

    Remove the parentheses around the parameters. You may only use parentheses when the function returns a value. In other words, this would be OK:

    Result = Hello(Jina, AccNo, AvaBal)

    Because your Hello Sub does not return a value, you must call it like this:

    Hello Jina, AccNo, AvaBal
    Phil Weber
    http://www.philweber.com

    Please post questions to the forums, where others may benefit.
    I do not offer free assistance by e-mail. Thank you!

  5. #5
    Join Date
    Jul 2005
    Location
    Kenya
    Posts
    32
    Thanks Phil that works preetty good.

Similar Threads

  1. Replies: 2
    Last Post: 01-02-2003, 02:32 PM
  2. Replies: 5
    Last Post: 07-20-2001, 02:25 PM
  3. Passing variables to a dll
    By Bragi +Fannar in forum Web
    Replies: 5
    Last Post: 09-26-2000, 12:58 PM
  4. How do I detect an FTP timeout?
    By Julian Milano in forum VB Classic
    Replies: 0
    Last Post: 08-10-2000, 09:16 PM
  5. Dll function call problem
    By Pete Mitchell in forum VB Classic
    Replies: 0
    Last Post: 06-27-2000, 03:56 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center