comp.lang.ada
 help / color / mirror / Atom feed
* How do I use cards.dll from Aonix OA?
@ 2001-08-30 11:08 Petter Fryklund
  2001-08-30 17:53 ` tmoran
  0 siblings, 1 reply; 9+ messages in thread
From: Petter Fryklund @ 2001-08-30 11:08 UTC (permalink / raw)


Does anybody have an Ada spec? How do I tell AO to reference the dll? I
thought that ie

with Interfaces.C;
with System;
package cdt is
function cdtInit (dx, dy : System.Address) return Interfaces.Unsigned_32;
pragma Import (C, cdtInit, External_Name => "cdtInit");
end cdt;

would do the job, but I get a linker errror, not being able to find cdtInit.
Any suggestions?





^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: How do I use cards.dll from Aonix OA?
  2001-08-30 11:08 How do I use cards.dll from Aonix OA? Petter Fryklund
@ 2001-08-30 17:53 ` tmoran
  2001-08-31  6:27   ` Petter Fryklund
  0 siblings, 1 reply; 9+ messages in thread
From: tmoran @ 2001-08-30 17:53 UTC (permalink / raw)


>pragma Import (C, cdtInit, External_Name => "cdtInit");
> ...
>would do the job, but I get a linker errror, not being able to find cdtInit.
  If it's not in one of the standard places the linker looks, then you
must tell the linker where to look for it.  I don't seem to find
anything named cdtInit in my OA installation - where is it supposed to be?
Is it something you created?



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: How do I use cards.dll from Aonix OA?
  2001-08-30 17:53 ` tmoran
@ 2001-08-31  6:27   ` Petter Fryklund
  2001-08-31 17:37     ` tmoran
  0 siblings, 1 reply; 9+ messages in thread
From: Petter Fryklund @ 2001-08-31  6:27 UTC (permalink / raw)


No, cdtInit is the initialization of cards.dll. I started with that one just
to see if I could use any routine in there. I tried to add the file
cards.dll to the files in the project, but that was obviously not right. I
couldn't fine any instructions on how to tell the linker where to look. Do
you know?


tmoran@acm.org wrote in message
<04vj7.31708$sa.16072538@news1.rdc1.sfba.home.com>...
>>pragma Import (C, cdtInit, External_Name => "cdtInit");
>> ...
>>would do the job, but I get a linker errror, not being able to find
cdtInit.
>  If it's not in one of the standard places the linker looks, then you
>must tell the linker where to look for it.  I don't seem to find
>anything named cdtInit in my OA installation - where is it supposed to be?
>Is it something you created?





^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: How do I use cards.dll from Aonix OA?
  2001-08-31  6:27   ` Petter Fryklund
@ 2001-08-31 17:37     ` tmoran
  2001-09-03 11:03       ` Petter Fryklund
  0 siblings, 1 reply; 9+ messages in thread
From: tmoran @ 2001-08-31 17:37 UTC (permalink / raw)


>No, cdtInit is the initialization of cards.dll. I started with that one just
>to see if I could use any routine in there. I tried to add the file
>cards.dll to the files in the project, but that was obviously not right. I
>couldn't fine any instructions on how to tell the linker where to look. Do
>you know?
  If cdtInit is an entry point in cards.dll then you need to call the OS
functions (LoadLibraryA et al) to *dynamically* load the DLL and give you
a pointer to cdtInit.  At *link time* cards.dll need not even exist.
You can either code your own OS calls, or find a routine in a .lib
that knows how to do it, and then statically link from that .lib   Where
did cards.dll come from and did it have an associated .lib file?



^ permalink raw reply	[flat|nested] 9+ messages in thread

* RE: How do I use cards.dll from Aonix OA?
@ 2001-08-31 17:55 Beard, Frank
  2001-08-31 18:09 ` tmoran
  0 siblings, 1 reply; 9+ messages in thread
From: Beard, Frank @ 2001-08-31 17:55 UTC (permalink / raw)
  To: 'comp.lang.ada@ada.eu.org'

You need to find cards.lib.  You add this to the project
just like you add your Ada source files, except using the
"Files of Type:" combo box to select "Library Files (*.lib)".

cards.lib defines the interface to cards.dll.  Once you link
it, the DLL has to be in the same directory as the executable
that loads it, or in the PATH defined in the System Properties
Environment tab (assuming Windows NT/2000).

If you can't find cards.lib, I think your only option is to 
use the LoadLibrary API, but I can't remember.


Running dumpbin on cards.dll produced the following:

C:\WINNT\system32>dumpbin /EXPORTS cards.dll

Microsoft (R) COFF Binary File Dumper Version 5.00.7022
Copyright (C) Microsoft Corp 1992-1997. All rights reserved.


Dump of file cards.dll

File Type: DLL

         Section contains the following Exports for CARDS.dll

                   0 characteristics
            31EC71A6 time date stamp Wed Jul 17 00:52:54 1996
                0.00 version
                   1 ordinal base
                   6 number of functions
                   6 number of names

            ordinal hint   name

                  1    0   WEP  (0000191E)
                  2    1   cdtAnimate  (00001579)
                  3    2   cdtDraw  (0000144A)
                  4    3   cdtDrawExt  (000010F1)
                  5    4   cdtInit  (00001011)
                  6    5   cdtTerm  (000018C9)

     Summary

        1000 .data
        1000 .rdata
        1000 .reloc
       24000 .rsrc
        1000 .text


The exported names appear not to be mangled, so you don't have
to worry about leading underscores or trailing "@#'s".

Frank

-----Original Message-----
From: Petter Fryklund [mailto:qsbpefr@esavionics.se]

No, cdtInit is the initialization of cards.dll. I started with that one just
to see if I could use any routine in there. I tried to add the file
cards.dll to the files in the project, but that was obviously not right. I
couldn't fine any instructions on how to tell the linker where to look. Do
you know?




^ permalink raw reply	[flat|nested] 9+ messages in thread

* RE: How do I use cards.dll from Aonix OA?
  2001-08-31 17:55 Beard, Frank
@ 2001-08-31 18:09 ` tmoran
  0 siblings, 0 replies; 9+ messages in thread
From: tmoran @ 2001-08-31 18:09 UTC (permalink / raw)


>If you can't find cards.lib, I think your only option is to
>use the LoadLibrary API, but I can't remember.
  Can Gnatcom (www.adapower.com) help here?



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: How do I use cards.dll from Aonix OA?
  2001-08-31 17:37     ` tmoran
@ 2001-09-03 11:03       ` Petter Fryklund
  2001-09-07 10:44         ` Petter Fryklund
  0 siblings, 1 reply; 9+ messages in thread
From: Petter Fryklund @ 2001-09-03 11:03 UTC (permalink / raw)


cards.dll is used by ie solitaire and others games needing a card deck ;-)
It's probably present in most WIndows systems. I'm trying to learn Windows
programming and having some fun while I'm doing it :-) I'm a bridge fanatic.
I have a command line deal generator that I'd like to convert graphics.

tmoran@acm.org wrote in message ...
>>No, cdtInit is the initialization of cards.dll. I started with that one
just
>>to see if I could use any routine in there. I tried to add the file
>>cards.dll to the files in the project, but that was obviously not right. I
>>couldn't fine any instructions on how to tell the linker where to look. Do
>>you know?
>  If cdtInit is an entry point in cards.dll then you need to call the OS
>functions (LoadLibraryA et al) to *dynamically* load the DLL and give you
>a pointer to cdtInit.  At *link time* cards.dll need not even exist.
>You can either code your own OS calls, or find a routine in a .lib
>that knows how to do it, and then statically link from that .lib   Where
>did cards.dll come from and did it have an associated .lib file?





^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: How do I use cards.dll from Aonix OA?
  2001-09-03 11:03       ` Petter Fryklund
@ 2001-09-07 10:44         ` Petter Fryklund
  2001-09-08  3:26           ` DuckE
  0 siblings, 1 reply; 9+ messages in thread
From: Petter Fryklund @ 2001-09-07 10:44 UTC (permalink / raw)


I tried to use LoadLibrary in the following example:

cdt_Str : constant String := "C:\WINDOWS\SYSTEM\CARDS.DLL" &
Character'First;

DLL : Hinstance;

....

DLL := LoadLIbrary (cdt_Str);

but this only returned 0, which I assume is no good.

Any suggestions?


Petter Fryklund wrote in message <9mvmsf$ld1$1@newstoo.ericsson.se>...
>cards.dll is used by ie solitaire and others games needing a card deck ;-)
>It's probably present in most WIndows systems. I'm trying to learn Windows
>programming and having some fun while I'm doing it :-) I'm a bridge
fanatic.
>I have a command line deal generator that I'd like to convert graphics.
>
>tmoran@acm.org wrote in message ...
>>>No, cdtInit is the initialization of cards.dll. I started with that one
>just
>>>to see if I could use any routine in there. I tried to add the file
>>>cards.dll to the files in the project, but that was obviously not right.
I
>>>couldn't fine any instructions on how to tell the linker where to look.
Do
>>>you know?
>>  If cdtInit is an entry point in cards.dll then you need to call the OS
>>functions (LoadLibraryA et al) to *dynamically* load the DLL and give you
>>a pointer to cdtInit.  At *link time* cards.dll need not even exist.
>>You can either code your own OS calls, or find a routine in a .lib
>>that knows how to do it, and then statically link from that .lib   Where
>>did cards.dll come from and did it have an associated .lib file?
>
>





^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: How do I use cards.dll from Aonix OA?
  2001-09-07 10:44         ` Petter Fryklund
@ 2001-09-08  3:26           ` DuckE
  0 siblings, 0 replies; 9+ messages in thread
From: DuckE @ 2001-09-08  3:26 UTC (permalink / raw)


I don't know if it's the most direct way, but try this:

  DECLARE
    cdt_Str : Interaces.C.Char_Array := Interfaces.C.To_C(
"C:\WINDOWS\SYSTEM\CARDS.DLL"  );
  BEGIN
    DLL := LoadLibrary( cdt_str(0)'UNCHECKED_ACCESS );
  END;

I haven't tested this, but it is very similar to other code that I use which
does work.

SteveD


"Petter Fryklund" <qsbpefr@esavionics.se> wrote in message
news:9na792$iqi$1@newstoo.ericsson.se...
> I tried to use LoadLibrary in the following example:
>
> cdt_Str : constant String := "C:\WINDOWS\SYSTEM\CARDS.DLL" &
> Character'First;
>
> DLL : Hinstance;
>
> ....
>
> DLL := LoadLIbrary (cdt_Str);
>
> but this only returned 0, which I assume is no good.
>
> Any suggestions?
>
>
> Petter Fryklund wrote in message <9mvmsf$ld1$1@newstoo.ericsson.se>...
> >cards.dll is used by ie solitaire and others games needing a card deck
;-)
> >It's probably present in most WIndows systems. I'm trying to learn
Windows
> >programming and having some fun while I'm doing it :-) I'm a bridge
> fanatic.
> >I have a command line deal generator that I'd like to convert graphics.
> >
> >tmoran@acm.org wrote in message ...
> >>>No, cdtInit is the initialization of cards.dll. I started with that one
> >just
> >>>to see if I could use any routine in there. I tried to add the file
> >>>cards.dll to the files in the project, but that was obviously not
right.
> I
> >>>couldn't fine any instructions on how to tell the linker where to look.
> Do
> >>>you know?
> >>  If cdtInit is an entry point in cards.dll then you need to call the OS
> >>functions (LoadLibraryA et al) to *dynamically* load the DLL and give
you
> >>a pointer to cdtInit.  At *link time* cards.dll need not even exist.
> >>You can either code your own OS calls, or find a routine in a .lib
> >>that knows how to do it, and then statically link from that .lib   Where
> >>did cards.dll come from and did it have an associated .lib file?
> >
> >
>
>





^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2001-09-08  3:26 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-08-30 11:08 How do I use cards.dll from Aonix OA? Petter Fryklund
2001-08-30 17:53 ` tmoran
2001-08-31  6:27   ` Petter Fryklund
2001-08-31 17:37     ` tmoran
2001-09-03 11:03       ` Petter Fryklund
2001-09-07 10:44         ` Petter Fryklund
2001-09-08  3:26           ` DuckE
  -- strict thread matches above, loose matches on Subject: below --
2001-08-31 17:55 Beard, Frank
2001-08-31 18:09 ` tmoran

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox