From: "rozni yusof" on
Err, nevermind... I restarted my PC, and the stuff works....

Thank you guys!

I was wondering if I was going to have to create a link library...
not something I relish, dlltool not being that good.

On 12/12/06, rozni yusof <rozniy(a)gmail.com> wrote:
> I looked in the Control Panel, and gave the name "DT9834(00)" to the
> olDaInitialize.
>
> LPHDEV lphDev=0;
> ecode= DTolDaInitialize("DT9834(00)", lphDev);
>
> It gave some memory problems when run... "Can't be written" or
> something like that.
>
> Am I on the right track?
>
>
> On 12/11/06, Michael Hieke <michael.hieke(a)elwi-elektronik.de> wrote:
> > Sorry for getting off-topic here...
> >
> > rozni yusof wrote:
> >
> > > 'Tis a proprietary device driver for a Data Translation DAQ card...
> > > that company only provides drivers for Microsoft Visual C++ (and
> > > .NET), and I'm trying to access the functions in the DLL
> >
> > It is no problem to access the driver DLL from any language capable of
> > creating programs for MS Windows; we do it from Delphi, with a suitable
> > import unit created from the information in the header file.
> >
> > > typedef ECODE (wxSTDCALL *DT_InitType)(PSTR, PHDEV);
> > > DT_InitType DTolDaInitialize= (DT_InitType)
> > > dll.GetSymbol("olDaInitialize");
> > > PSTR lpszName=""; LPHDEV lphDev=0;
> >
> > This seems to be the problem, if the name is empty it can not find the
> > matching device. Try the device name that is listed in the Open Layers
> > control panel instead, it should work. Something like "DT303_1", or
> > "DT9800_1" in your case.
> >
> > > I have never bothered with Visual C++ before, but looks like I'll
> > > have to start...
> >
> > No need to, but have a look at their documentation and samples...
> >
> > HTH
> >
> > --
> > Michael Hieke
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: wx-users-unsubscribe(a)lists.wxwidgets.org
> > For additional commands, e-mail: wx-users-help(a)lists.wxwidgets.org
> >
> >
>

---------------------------------------------------------------------
To unsubscribe, e-mail: wx-users-unsubscribe(a)lists.wxwidgets.org
For additional commands, e-mail: wx-users-help(a)lists.wxwidgets.org

From: Michael Hieke on
rozni yusof wrote:

> You have worked with Data Translation devices too?

Yes. DT300 and DT3010 series cards, up to three in parallel.

> Err.. I thought the olDaInitialize function was supposed to tell you
> the device name in the lpszName argument?

No. Install the DA SDK, and have a look at DASDK.HLP, it's all
explained there.

> So, you're actually supposed to *provide* its name?

Yes. How else are you going to access the correct card if you have more
than one in the system? I guess olDaEnumBoards() and similar would help
you to find the name.

BTW: I'm glad it seems to work for you now ;-)

Thanks

--
Michael Hieke


---------------------------------------------------------------------
To unsubscribe, e-mail: wx-users-unsubscribe(a)lists.wxwidgets.org
For additional commands, e-mail: wx-users-help(a)lists.wxwidgets.org

From: "rozni yusof" on
The driver is temperemental though... sometimes I get memory errors,
sometimes it works.

All I did is this:



if(dll.Load("oldaapi32.dll")) wxLogMessage("successful load");

ECODE ecode;
wxString wxstr;

typedef ECODE (wxSTDCALL *DT_InitType)(LPSTR, LPHDEV);
DT_InitType DTolDaInitialize= (DT_InitType) dll.GetSymbol("olDaInitialize");
LPSTR lpszName="DT9834(00)";
LPHDEV lphDev;

ecode= DTolDaInitialize("DT9834(00)", lphDev);


wxstr.Printf("Initialize %i", ecode);
wxLogMessage(wxstr);


dll.Unload();
if(!dll.IsLoaded()) wxLogMessage ("successful unload");

On 12/12/06, Michael Hieke <michael.hieke(a)elwi-elektronik.de> wrote:
> rozni yusof wrote:
>
> > You have worked with Data Translation devices too?
>
> Yes. DT300 and DT3010 series cards, up to three in parallel.
>
> > Err.. I thought the olDaInitialize function was supposed to tell you
> > the device name in the lpszName argument?
>
> No. Install the DA SDK, and have a look at DASDK.HLP, it's all
> explained there.
>
> > So, you're actually supposed to *provide* its name?
>
> Yes. How else are you going to access the correct card if you have more
> than one in the system? I guess olDaEnumBoards() and similar would help
> you to find the name.
>
> BTW: I'm glad it seems to work for you now ;-)
>
> Thanks
>
> --
> Michael Hieke
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: wx-users-unsubscribe(a)lists.wxwidgets.org
> For additional commands, e-mail: wx-users-help(a)lists.wxwidgets.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: wx-users-unsubscribe(a)lists.wxwidgets.org
For additional commands, e-mail: wx-users-help(a)lists.wxwidgets.org

From: Michael Hieke on
Hi,

rozni yusof wrote:

> The driver is temperemental though... sometimes I get memory errors,
> sometimes it works.

> LPSTR lpszName="DT9834(00)";
> LPHDEV lphDev;
>
> ecode= DTolDaInitialize("DT9834(00)", lphDev);

Try

HDEV hDev = 0;
ecode = DTolDaInitialize("DT9834(00)", &hDev);

instead.

HTH

--
Michael Hieke


---------------------------------------------------------------------
To unsubscribe, e-mail: wx-users-unsubscribe(a)lists.wxwidgets.org
For additional commands, e-mail: wx-users-help(a)lists.wxwidgets.org

From: "rozni yusof" on
Works like a charm. THanks, man... I always did have trouble with pointers.

On 12/14/06, Michael Hieke <michael.hieke(a)elwi-elektronik.de> wrote:
> Hi,
>
> rozni yusof wrote:
>
> > The driver is temperemental though... sometimes I get memory errors,
> > sometimes it works.
>
> > LPSTR lpszName="DT9834(00)";
> > LPHDEV lphDev;
> >
> > ecode= DTolDaInitialize("DT9834(00)", lphDev);
>
> Try
>
> HDEV hDev = 0;
> ecode = DTolDaInitialize("DT9834(00)", &hDev);
>
> instead.
>
> HTH
>
> --
> Michael Hieke
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: wx-users-unsubscribe(a)lists.wxwidgets.org
> For additional commands, e-mail: wx-users-help(a)lists.wxwidgets.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: wx-users-unsubscribe(a)lists.wxwidgets.org
For additional commands, e-mail: wx-users-help(a)lists.wxwidgets.org