Hello Guest it is April 28, 2024, 01:32:33 AM

Author Topic: DLL - CreateObject help  (Read 1944 times)

0 Members and 1 Guest are viewing this topic.

DLL - CreateObject help
« on: July 15, 2014, 11:43:08 PM »
I am trying to use a .dll to interface an instrument with Mach3 through a macro call.

When I view the dll in visual studio the structure looks like this:

ALControls2                          '-----------------   .dll file
     {}alNETControls                '----------------    namespace
             AcqMultiControl        '-----------------   class

             AcqMultiControl()      '------------------   default constructor
             FromXML(string)       '------------------   filepath to load settings  public void
             NumberofBoards()    '------------------    returns # of boards installed   public int
             Init(bool,bool,bool)   '------------------    call to setup board objects before use   public void
             CollectSingleShot()  

So far many attempts have failed.  Should I be able to use CreateObject?  Could someone suggest how to structure all this?
The only documentation I have with this is for visual studio and I am totally new to that so it is hard to follow.
The instrument is an ultrasonic pulser/receiver feeding into a PCI aquisition card, it computes a time of flight.
I have used some other simple .dll's with the Declare Function and had no trouble (setting a multiplexor channel, serial communication).
Am I on the right track, is this possible???  I have found a few examples that I am trying to learn from like, PoKeys.
When I single step through any of my scripts it fails at my createobject and goes to error handler.
Right now I would just love to connect to the board and have it return the NumberofBoards() atleast, but nothing so far.

Thanks!

-Bob