1. Tsunami Record Manager

Ok, so I almost wrapped this library. But i have one problem. What is a 
QUAD? I know what all the other types are and what to put them in as but 
Euphoria doesn't seem to have a tye for a QUAD. If anyone knows how it 
should work, could you tell me?

new topic     » topic index » view message » categorize

2. Re: Tsunami Record Manager

The Tsunami Record Manager (www.TRM-UG.com) is written in PB/DLL (PowerBASIC ->
www.powerbasic.com). PB/DLL knows the variable type QUAD, that means:


Quad-integer 64 bits (8 bytes), signed -9.22x10^18 to +9.22x10^18 -2^63 to
2^63-1

(extract from the PB/DLL help file)

I hope this helps.

Best regards,
Markus


Elliott Sales de Andrade schrieb am 25.01.2002:
>
>
>Ok, so I almost wrapped this library. But i have one problem. What is a 
>QUAD? I know what all the other types are and what to put them in as but 
>Euphoria doesn't seem to have a tye for a QUAD. If anyone knows how it 
>should work, could you tell me?
>
>
>
>
-----------------------
Markus Vedder-Kemnitzer
vekem at gmx.de

new topic     » goto parent     » topic index » view message » categorize

3. Re: Tsunami Record Manager

> Ok, so I almost wrapped this library. But i have one problem. What is
a
> QUAD? I know what all the other types are and what to put them in as
but
> Euphoria doesn't seem to have a tye for a QUAD. If anyone knows how it
> should work, could you tell me?


To get around the problem of the QUAD, download the trm_vb.dll from
their site.
Its a wrapper for all the functions which require returning or passing a
QUAD.

I've been trying to get it to work myself but am having trouble with
calling trm_Open() in trm.dll.

Perhaps someone here can help????????

This is the VB declaration.
~~~~~~~~~~~~~~~~~~
Declare Function trm_Open Lib "TRM.DLL"  (PathFileName As String,
MultiUser As Long) As Long

Here's my code.... what am I doing wrong?

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include machine.e
include dll.e

atom trm,trm_vb ,trm_Loaded, trm_Open ,lpcstr ,hFile, mode

trm = open_dll("trm.dll")
trm_vb = open_dll("trm_vb.dll")
if trm = 0 or trm_vb = 0 then
    puts(1, "Couldn't open the dlls!\n")
    abort(1)
end if

trm_Loaded = define_c_func(trm_vb, "trm_Loaded" ,{}, C_LONG)
trm_Open  = define_c_func(trm, "trm_Open" ,{C_POINTER, C_LONG}, C_LONG)

if c_func(trm_Loaded,{}) = 0 then
    puts(1, "Not Loaded!\n")
    abort(1)
end if

lpcstr = allocate_string("trmdemo.dat")
mode = 0

-- it produces an application error on this call...
hFile = c_func(trm_Open,{lpcstr, mode})
puts(1,"If you can read this, it worked...\n")

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

new topic     » goto parent     » topic index » view message » categorize

4. Re: Tsunami Record Manager

On 26 Jan 2002, at 0:27, Markus Vedder-Kemnitzer wrote:

> 
> The Tsunami Record Manager (www.TRM-UG.com) is written in PB/DLL (PowerBASIC
> ->
> www.powerbasic.com). PB/DLL knows the variable type QUAD, that means:

Oh no!! Eu users will argue against "goto" and use a PowerBASIC dll !?!

Kat

new topic     » goto parent     » topic index » view message » categorize

5. Re: Tsunami Record Manager

Yep, that's basically the same problem I'm getting (using the code I
uploaded).
I wonder why it works for VB but not Euphoria?

It might be worth experimenting with calling trm.dll directly, and using
the following trick to
pass the QUAD.

You might be able to emulate the QUAD by passing two C_INTs.
The hard problem is with the functions that return a QUAD. Don't know
how to get round that
one. Maybe, by declaring it as returning a C_FLOAT and then converting
it, somehow. Blech.

Ross

>
>  I used the VB DLL, but I am still having that problem also.
>  It's almost always the same error:
>
>      The instuction at 00a2c0e2 referenced memory at 00000001
>      The memory could not be read from.
> Sometimes its 00000000 instead of 00000001.
>
> [Offtopic]
> If anyone is still wondering, I didn't get this message and another
> reply from Markus Vedder-Kemnitzer. And Bernie's came really late,
too.
>
>
> rossboyd at ihug.com.au wrote:
> > > Ok, so I almost wrapped this library. But i have one problem. What
is
> > a
> > > QUAD? I know what all the other types are and what to put them in
as
> > but
> > > Euphoria doesn't seem to have a tye for a QUAD. If anyone knows
how it
> > > should work, could you tell me?
> >
> >
> > To get around the problem of the QUAD, download the trm_vb.dll from
> > their site.
> > Its a wrapper for all the functions which require returning or
passing a
> > QUAD.
> >
> > I've been trying to get it to work myself but am having trouble with
> > calling trm_Open() in trm.dll.
> >
> > Perhaps someone here can help????????
> >
> > This is the VB declaration.
> > ~~~~~~~~~~~~~~~~~~
> > Declare Function trm_Open Lib "TRM.DLL"  (PathFileName As String,
> > MultiUser As Long) As Long
> >
> > Here's my code.... what am I doing wrong?
> >
> > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > include machine.e
> > include dll.e
> >
> > atom trm,trm_vb ,trm_Loaded, trm_Open ,lpcstr ,hFile, mode
> >
> > trm = open_dll("trm.dll")
> > trm_vb = open_dll("trm_vb.dll")
> > if trm = 0 or trm_vb = 0 then
> >     puts(1, "Couldn't open the dlls!\n")
> >     abort(1)
> > end if
> >
> > trm_Loaded = define_c_func(trm_vb, "trm_Loaded" ,{}, C_LONG)
> > trm_Open  = define_c_func(trm, "trm_Open" ,{C_POINTER, C_LONG},
C_LONG)
> >
> > if c_func(trm_Loaded,{}) = 0 then
> >     puts(1, "Not Loaded!\n")
> >     abort(1)
> > end if
> >
> > lpcstr = allocate_string("trmdemo.dat")
> > mode = 0
> >
> > -- it produces an application error on this call...
> > hFile = c_func(trm_Open,{lpcstr, mode})
> > puts(1,"If you can read this, it worked...\n")
> >
> > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> >
> >
>
>
>

new topic     » goto parent     » topic index » view message » categorize

6. Re: Tsunami Record Manager

I posted something on their site and it turns out you must use Strings and 
not pointers. So I tried to pass a sequence but that didn't work either.They 
have decided to create a DLL that uses pointers and no QUAD integers, so 
maybe we should wait until that comes out.


>From: rossboyd at ihug.com.au
>Reply-To: EUforum at topica.com
>To: EUforum <EUforum at topica.com>
>Subject: Re: Tsunami Record Manager
>Date: Sun, 27 Jan 2002 23:52:06 +1100
>
>
>Yep, that's basically the same problem I'm getting (using the code I
>uploaded).
>I wonder why it works for VB but not Euphoria?
>
>It might be worth experimenting with calling trm.dll directly, and using
>the following trick to
>pass the QUAD.
>
>You might be able to emulate the QUAD by passing two C_INTs.
>The hard problem is with the functions that return a QUAD. Don't know
>how to get round that
>one. Maybe, by declaring it as returning a C_FLOAT and then converting
>it, somehow. Blech.
>
>Ross
>
> >
> >  I used the VB DLL, but I am still having that problem also.
> >  It's almost always the same error:
> >
> >      The instuction at 00a2c0e2 referenced memory at 00000001
> >      The memory could not be read from.
> > Sometimes its 00000000 instead of 00000001.
> >
> > [Offtopic]
> > If anyone is still wondering, I didn't get this message and another
> > reply from Markus Vedder-Kemnitzer. And Bernie's came really late,
>too.
> >
> >
> > rossboyd at ihug.com.au wrote:
> > > > Ok, so I almost wrapped this library. But i have one problem. What
>is
> > > a
> > > > QUAD? I know what all the other types are and what to put them in
>as
> > > but
> > > > Euphoria doesn't seem to have a tye for a QUAD. If anyone knows
>how it
> > > > should work, could you tell me?
> > >
> > >
> > > To get around the problem of the QUAD, download the trm_vb.dll from
> > > their site.
> > > Its a wrapper for all the functions which require returning or
>passing a
> > > QUAD.
> > >
> > > I've been trying to get it to work myself but am having trouble with
> > > calling trm_Open() in trm.dll.
> > >
> > > Perhaps someone here can help????????
> > >
> > > This is the VB declaration.
> > > ~~~~~~~~~~~~~~~~~~
> > > Declare Function trm_Open Lib "TRM.DLL"  (PathFileName As String,
> > > MultiUser As Long) As Long
> > >
> > > Here's my code.... what am I doing wrong?
> > >
> > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > > include machine.e
> > > include dll.e
> > >
> > > atom trm,trm_vb ,trm_Loaded, trm_Open ,lpcstr ,hFile, mode
> > >
> > > trm = open_dll("trm.dll")
> > > trm_vb = open_dll("trm_vb.dll")
> > > if trm = 0 or trm_vb = 0 then
> > >     puts(1, "Couldn't open the dlls!\n")
> > >     abort(1)
> > > end if
> > >
> > > trm_Loaded = define_c_func(trm_vb, "trm_Loaded" ,{}, C_LONG)
> > > trm_Open  = define_c_func(trm, "trm_Open" ,{C_POINTER, C_LONG},
>C_LONG)
> > >
> > > if c_func(trm_Loaded,{}) = 0 then
> > >     puts(1, "Not Loaded!\n")
> > >     abort(1)
> > > end if
> > >
> > > lpcstr = allocate_string("trmdemo.dat")
> > > mode = 0
> > >
> > > -- it produces an application error on this call...
> > > hFile = c_func(trm_Open,{lpcstr, mode})
> > > puts(1,"If you can read this, it worked...\n")
> > >
> > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > >
> > >
<snip>

>
>
>

new topic     » goto parent     » topic index » view message » categorize

7. Re: Tsunami Record Manager

Thanks for the info Elliott.
Its very weird of them to pass strings on the stack instead of
pointers....
Never mind, we'll look forward to their new DLL. ...

Cheers,
Ross


> I posted something on their site and it turns out you must use Strings
and
> not pointers. So I tried to pass a sequence but that didn't work
either.They
> have decided to create a DLL that uses pointers and no QUAD integers,
so
> maybe we should wait until that comes out.
>
>
> >From: rossboyd at ihug.com.au
> >Reply-To: EUforum at topica.com
> >To: EUforum <EUforum at topica.com>
> >Subject: Re: Tsunami Record Manager
> >Date: Sun, 27 Jan 2002 23:52:06 +1100
> >
> >
> >Yep, that's basically the same problem I'm getting (using the code I
> >uploaded).
> >I wonder why it works for VB but not Euphoria?
> >
> >It might be worth experimenting with calling trm.dll directly, and
using
> >the following trick to
> >pass the QUAD.
> >
> >You might be able to emulate the QUAD by passing two C_INTs.
> >The hard problem is with the functions that return a QUAD. Don't know
> >how to get round that
> >one. Maybe, by declaring it as returning a C_FLOAT and then
converting
> >it, somehow. Blech.
> >
> >Ross
> >
> > >
> > >  I used the VB DLL, but I am still having that problem also.
> > >  It's almost always the same error:
> > >
> > >      The instuction at 00a2c0e2 referenced memory at 00000001
> > >      The memory could not be read from.
> > > Sometimes its 00000000 instead of 00000001.
> > >
> > > [Offtopic]
> > > If anyone is still wondering, I didn't get this message and
another
> > > reply from Markus Vedder-Kemnitzer. And Bernie's came really late,
> >too.
> > >
> > >
> > > rossboyd at ihug.com.au wrote:
> > > > > Ok, so I almost wrapped this library. But i have one problem.
What
> >is
> > > > a
> > > > > QUAD? I know what all the other types are and what to put them
in
> >as
> > > > but
> > > > > Euphoria doesn't seem to have a tye for a QUAD. If anyone
knows
> >how it
> > > > > should work, could you tell me?
> > > >
> > > >
> > > > To get around the problem of the QUAD, download the trm_vb.dll
from
> > > > their site.
> > > > Its a wrapper for all the functions which require returning or
> >passing a
> > > > QUAD.
> > > >
> > > > I've been trying to get it to work myself but am having trouble
with
> > > > calling trm_Open() in trm.dll.
> > > >
> > > > Perhaps someone here can help????????
> > > >
> > > > This is the VB declaration.
> > > > ~~~~~~~~~~~~~~~~~~
> > > > Declare Function trm_Open Lib "TRM.DLL"  (PathFileName As
String,
> > > > MultiUser As Long) As Long
> > > >
> > > > Here's my code.... what am I doing wrong?
> > > >
> > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > > > include machine.e
> > > > include dll.e
> > > >
> > > > atom trm,trm_vb ,trm_Loaded, trm_Open ,lpcstr ,hFile, mode
> > > >
> > > > trm = open_dll("trm.dll")
> > > > trm_vb = open_dll("trm_vb.dll")
> > > > if trm = 0 or trm_vb = 0 then
> > > >     puts(1, "Couldn't open the dlls!\n")
> > > >     abort(1)
> > > > end if
> > > >
> > > > trm_Loaded = define_c_func(trm_vb, "trm_Loaded" ,{}, C_LONG)
> > > > trm_Open  = define_c_func(trm, "trm_Open" ,{C_POINTER, C_LONG},
> >C_LONG)
> > > >
> > > > if c_func(trm_Loaded,{}) = 0 then
> > > >     puts(1, "Not Loaded!\n")
> > > >     abort(1)
> > > > end if
> > > >
> > > > lpcstr = allocate_string("trmdemo.dat")
> > > > mode = 0
> > > >
> > > > -- it produces an application error on this call...
> > > > hFile = c_func(trm_Open,{lpcstr, mode})
> > > > puts(1,"If you can read this, it worked...\n")
> > > >
> > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > > >
> > > >
> <snip>
>
> >
>
>
>

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu