|
|
| Graham Steer 2005-12-12, 7:56 am |
| The following two statements are extracts from and API user manual. Does
anyone know if it is possible to call this dll from APL+WIN and if so how?
The API is distributed in the form of a .NET DLL that can be used as a
library to develop and run a Windows based program .........
Development can be done in any of the .NET languages (e.g. C# or VB.NET).
| |
| AA2e72E 2005-12-14, 3:56 am |
| Graham,
I did this a while back; I tried to recollect & document an example for
you but my PC has trashed. I'll send you an example: do not know when!
My understanding is: you want to write your own DLL for calling from
APL+Win: correct?
If yes, why does it have to be .NET? Why not Visual Basic (it is a lot
simpler) or WSC (also simpler than NET). With VB it is quite simple.
| |
| Graham Steer 2005-12-14, 7:55 am |
| Thanks for the reply.
> My understanding is: you want to write your own DLL for calling from
> APL+Win: correct?
No. My problem is that I want to access, via APL, a forex real time trading
system for which the trading house publishes an API which is packaged as a
..NET dll. What I want to do is the same as {quad} wcall into a standard
win32 dll but clearly this does not work directly. So far my research as
taken me down the route of "interoperability". I have installed the
microsoft .NET framework and got as far as things called "COM callable
wrappers" but that is as far as I have got. I find the documentation
difficult to find and what I've found virtually impenetrable particularly as
I have no coding knowledge outside APL.
| |
| AA2e72E 2005-12-14, 7:55 am |
| Pity my Pc is not working: I'd have found out for you.
What I remember is that the DLL must be compiled so that it is compliant
with Interop. Find out if it is.
You would still need to register it, I think for .NET you use REGASM
rather than REGSVR: if you know Excel, you can ry and see if the DLL is
already registered. In Excel, ALT + F11 then Tools | References lists all
that is available.
Alternatiely, request that the provider of the DLL supply you with code
for working it with Visual Basic (if they have tested it, they should have
the code). It is fairly easy to translatee to APL.
| |
| AA2e72E 2005-12-14, 7:55 am |
| Another thought: if your DLL is not an interop DLL, you will need to use
[]na and not []wcall.
| |
| Graham Steer 2005-12-14, 7:55 am |
|
> You would still need to register it, I think for .NET you use REGASM
> rather than REGSVR: if you know Excel, you can ry and see if the DLL is
> already registered. In Excel, ALT + F11 then Tools | References lists all
> that is available.
Excel says it is available and is located in the windows system directory as
CoesApi.tlb. I have the user manual for the API which states "Development
can be done in any of the .NET languages (e.g. C# or VB.NET). " It would
appear that they have not allowed specifically for a COM based approach but
expect everyone to use a .NET version of their development language. If I
eventually hit the buffers on this then at least with your help I will now
be able to ask the providers intelligent questions.
Thanks again.
| |
| Tracker 2005-12-14, 6:58 pm |
| AA2e72E wrote:
> Another thought: if your DLL is not an interop DLL, you will need to use
> []na and not []wcall.
>
Hm - I can't think of anything you can do with []NA that you can't do with []WCALL. And I think the advantage of []WCALL is that it provided the ability to make callbacks to APL. What am I missing about []NA???
Tracker
| |
| Graham Steer 2005-12-14, 6:58 pm |
| As the OP I will add that I need to manage call backs from the DLL so []na
is not an option
"Tracker" <null@email.net> wrote in message
news:4MYnf.12390$Jz6.10703@trnddc06...
> AA2e72E wrote:
>
> Hm - I can't think of anything you can do with []NA that you can't do with
[]WCALL. And I think the advantage of []WCALL is that it provided the
ability to make callbacks to APL. What am I missing about []NA???
>
> Tracker
| |
| AA2e72E 2005-12-15, 3:55 am |
| For []wcall to work, the function must be defined in APLWADF.INI (by
APL2000) or by you in APLW.INI in the [Call] section. I don't think this
is a requirement for []na. []wcall in the interface to Win32 DLLs.
If your DLL is an ActiveX DLL, you need another approach:
'object' []wi 'Create' 'Library.Class'
Where:
object is any valid name you specify
'Create' works with V4.0 or later, use 'New' for other versions
Library is the name of the DLL, without the DLL extension.
Class is whatever name is inside the DLL.
Try:
'#' []wi 'XInfo' 'Coes'
This will list the Library.Class, IF available.
A TLB file is a Type Library: I do not think you can use it with APL+Win;
an advantahe is that functions in TLB files need NOT be explicitly
declared. However, TLB files are based on DLL files. For APL+Win you need
to use the DLL file.
If 'object' []wi 'Create' 'Library.Class' does not generate an error:
'object' []wi 'methods' returns all the function calls available to you,
likewise for 'properties' and 'events'
To get the syntax of a method:
'object' []wi '?method'
will list the argument names and their types
'object' []wi '??method'
will invoke the help file, if it exists, on the topic for 'method'
'method' is any names returned by 'object' []wi 'methods' that befins with
X (x for properties).
| |
| Graham Steer 2005-12-15, 7:55 am |
| Thanks again for your help and patience. I have tried your suggestions
below without success. When using Create I get the error message "ActiveX
class not registered" If I run ]OBE there is an object "com.coes.CoesConn "
listed in the object browser as an Active Object. Clicking on this yields
the same "not registered" error. Here is a further extract from the manual
which might shed a little more light on the matter:
"The API is delivered as a .NET DLL file named CoesApi.dll. Typically
developers create a class in any of the .NET languages that inherits from
the com.coes.CoesConn class supplied by the DLL. The new class is then used
to implement their business logic by overwriting specific methods in
CoesConn class."
I have tried running regasm to register the dll which appeared to run
successfully but this has made no difference.
"AA2e72E" <aa2e72e@deletethisword.lycos.co.uk> wrote in message
news:7a5303be095232127e32c53bfff93cf3@lo
calhost.talkaboutprogramming.com...
> For []wcall to work, the function must be defined in APLWADF.INI (by
> APL2000) or by you in APLW.INI in the [Call] section. I don't think this
> is a requirement for []na. []wcall in the interface to Win32 DLLs.
>
> If your DLL is an ActiveX DLL, you need another approach:
>
> 'object' []wi 'Create' 'Library.Class'
>
> Where:
>
> object is any valid name you specify
> 'Create' works with V4.0 or later, use 'New' for other versions
> Library is the name of the DLL, without the DLL extension.
> Class is whatever name is inside the DLL.
>
> Try:
>
> '#' []wi 'XInfo' 'Coes'
>
> This will list the Library.Class, IF available.
>
> A TLB file is a Type Library: I do not think you can use it with APL+Win;
> an advantahe is that functions in TLB files need NOT be explicitly
> declared. However, TLB files are based on DLL files. For APL+Win you need
> to use the DLL file.
>
> If 'object' []wi 'Create' 'Library.Class' does not generate an error:
>
> 'object' []wi 'methods' returns all the function calls available to you,
> likewise for 'properties' and 'events'
>
> To get the syntax of a method:
>
> 'object' []wi '?method'
>
> will list the argument names and their types
>
> 'object' []wi '??method'
>
> will invoke the help file, if it exists, on the topic for 'method'
>
> 'method' is any names returned by 'object' []wi 'methods' that befins with
> X (x for properties).
>
>
>
| |
| AA2e72E 2005-12-15, 7:55 am |
| Graham,
I don't know what is happening.
If you can, attach the dll to a private email to me: I'll try to figure
out how to use it tonight & let you know.
| |
| AA2e72E 2005-12-15, 7:55 am |
| PS:
Have you tried:
'obj' []wi 'New' 'coes.CoesConn'
?
| |
| AA2e72E 2005-12-15, 7:55 am |
| Also try:
'obj' []wi 'New' 'CoesApi.CoesConn'
| |
|
|
| Graham Steer 2005-12-15, 7:55 am |
| Thanks I will take a look. I have sent you the dll and user manual by
private e-mail.
"AA2e72E" <aa2e72e@deletethisword.lycos.co.uk> wrote in message
news:061728748ec0bca8649da9d8bf2abbd6@lo
calhost.talkaboutprogramming.com...
> Graham,
> see if you can glean anything from his:
>
> http://support.microsoft.com/defaul...kb;en-us;817248
>
> It does not talk about apl but VB: what it says about VB is relevant for
> APL.
>
| |
| AA2e72E 2005-12-15, 6:56 pm |
| Graham,
I had a good look at the API library; unfortunately, I have been unable to
make it work.
The documentation states that it is a WIN32 API. As far as I know, you
need to use []na with such DLLs. I defined the GetVersion method
successfully but APL complained that 'Entry Point Not Found'
You are right, REGASM does something but []wcall still fails: I tried it
just in case.
I think there is something missing in the information provided.
It might be an idea for you to request information from the supplier about
using the API library with Visual Basic (not the .NEt version). It would be
fairly easy to make it work with APL then.
From the documentation, it seems that the supplier is only prepared to
support .NET: if this is indeed the case you might have to start using
NET.
By the way, the .NET language are available for free download from
Microsoft: using Google, search for Visual Studio Express.
Let me know how you get on.
I'll keep the DLL for a few days, in case I have other thoughts, before
deleting it.
|
|
|
|