CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6

Thread: Passing Arrays

  1. #1
    Join Date
    May 2000
    Location
    Chennai, India
    Posts
    18

    Passing Arrays

    HI Guys!
    How to pass an array of strings to a dll ? I have created a dll with declaration as:
    Public Function Authorize(Uid as Variant, xyz() as variant).

    I can even change the declaration of the function,if necessary, so, any other syntax for declaring the array is welcome.
    From my main program how to pass an array say a() to this dll ?

    Hand in Hand we Walk towards SUCCESS.

  2. #2
    Join Date
    May 1999
    Posts
    3,332

    Re: Passing Arrays

    is that DLL you want to call a C(++) DLL or an ActiveX DLL?

    One way to pass an array:

    Dim var() as Variant
    var = Array(1, 2, 3)
    Call Authorize(null, var)



    (tested in VB 6 nt4)


  3. #3
    Join Date
    May 2000
    Location
    Chennai, India
    Posts
    18

    Re: Passing Arrays - Tkx Lothar

    Thanks Lothar!
    Its working. Actually it was an ActiveX Dll. Hey! Lothar, is there any difference between an Windows Dll and an ActiveX Dll ? IS so what are the differences ?


    Hand in Hand we Walk towards SUCCESS.

  4. #4
    Join Date
    May 1999
    Posts
    3,332

    Re: Passing Arrays - Tkx Lothar

    >is there any difference between an Windows Dll and an ActiveX Dll ?

    certainly. I'm not the expert to tell you all the technical details of those two beast, but:
    - an ActiveX dll has a COM interface
    you instantiate it via CreateObject or early binding (dim .. as new ...)

    you call functions via objectInstanceName.Methodname

    - a "normal" DLL is invoke via implicit or explicit linking (LoadLibrary(Ex))
    you "call" the functions and "declare" it before you can use them.

    There are a couple of other differences (e.g. ActiveXDLL can be easily made "remotable")


  5. #5
    Join Date
    May 2000
    Location
    Chennai, India
    Posts
    18

    Re: Tnkx Lothar

    Hi Lothar!
    Hey! man thanks for ur few tips, I would build up the rest on it.
    Anyway, Lothar, where do u work(Geographical Location) and on what do u work ? I am an Analyst working for Silverline Tech. Inc, Chennai, India.
    Bye and Thanks once again.

    Hand in Hand we Walk towards SUCCESS.

  6. #6
    Join Date
    May 1999
    Posts
    3,332

    Re: Tnkx Lothar

    >where do u work(Geographical Location)
    Germany
    >what do u work
    I'm a QA guy.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured