Passing objects to a dll ?

Results 1 to 2 of 2

Thread: Passing objects to a dll ?

  1. #1
    Peter Jarvis Guest

    Default Passing objects to a dll ?

    Hi,<BR><BR>I am trying to pass an object to a dll and get a "Type Mismatch" error.<BR><BR>I read somewhere that you can only pass things as Variants to a dll - is this true ? Is there no solution other than to change the dll to accept variants ?<BR><BR>Many thanks,<BR><BR>Peter

  2. #2
    SPG Guest

    Default RE: Passing objects to a dll ?

    In VB, you can auto-typecast a passed variable with the "byVal" preface<BR><BR> public sub isTrue(byVal bIn as boolean)<BR><BR>Additionally, a VBS conversion at the time of passing appears to work<BR><BR> call myComponent.isTrue(cBool(-1))<BR><BR>As far as passing an actual _object_ in, you may have difficulties; the component will have to fully understand what sort of object it&#039s recieving (which generally means a whole lot of overhead and another referenced file). But, if you can do it, it might look like:<BR><BR> public funciton validConn(byVal objConn as adodb.connection) as boolean<BR><BR>or something.<BR><BR>Hope it helps.

Posting Permissions

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