Results 1 to 2 of 2

Thread: accessing dlls

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Feb 2001
    Location
    Crossroads
    Posts
    3,046

    accessing dlls

    I was thinking of moving some code in an app to a C++ dll to speed up the execution of some heavy loops. This will all be new to me so I have some concerns.

    1) I would have to be able to pass UDTs as arguments .. is this possible? Anyone know where I can find a quick example?

    2) How much will I have to give up in terms of debugging? Im guessing there is no way to run the VB prog in Debug and step into the C++ dll? How would you debug this sort of application?

    3) Is it possible that the overhead of passing UDTs as arguments will negate the benefit of the increased speed of C++ ?

    Thanks for any help!

  2. #2
    Frenzied Member Microbasic's Avatar
    Join Date
    Mar 2001
    Posts
    1,402
    Passing UDTs as arguments is simple. Just use

    VB Code:
    1. Public Declare Function xx Lib "xx.dll" ([b]UDT As MYTYPE[/b]) As Long

    In VB, you can't step into a VC++ dll, so you either have to debug it in C++ or just assume that your DLL is error-free and assume all unidentifiable error as one in the DLL.

    There is little overhead in passing UDTs since only a memory pointer is passed. Just make sure you don't change anything not meant to be changed!


    MicroBasic
    Dragon Shadow Trainer

    There is no good or evil in the world...only programmers and fools .

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