For Programmers: Free Programming Magazines  


Home > Archive > PERL Beginners > December 2004 > Accessing DLL functions









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Accessing DLL functions
Robert W Sturdevant-Contractor

2004-12-23, 3:58 pm

Hi,

Am I correct in assuming that I can access functions in a .dll file using
the Win32::API module. I have a proprietary database database and C .dll
with function prototypes. I would like to write a perl pgm using the
ilibrary functions to access the DB. Am I headed in the right direction? If
not, is there another means? Thanks.

BobS




Jonathan Paton

2004-12-23, 3:58 pm

On Thu, 23 Dec 2004 13:24:47 -0500, Sturdevant-Contractor, Robert W
<robert.w.sturdevant@us.army.mil> wrote:
>
> Hi,
>
> Am I correct in assuming that I can access functions in a .dll file using
> the Win32::API module. I have a proprietary database database and C .dll
> with function prototypes. I would like to write a perl pgm using the
> ilibrary functions to access the DB. Am I headed in the right direction? If
> not, is there another means? Thanks.


Could you elaborate on what database is involved? There are many DBD
(driver) modules on CPAN:

http://search.cpan.org/search?m=mod...3A%3A&s=1&n=100

These work with DBI, providing a consistant interface. If a suitable DBD
driver does not yet exist, why not write something that fits in to the
existing DB framework?

There are many ways to reach the same objective. The difficulty ranges
from easy (if you get Win32:API or similar to do it) to hard (writing drivers
or using the XS layer).

I am not qualified to write about Win32::API.

Jonathan Paton

--
#!perl
$J=' 'x25 ;for (qq< 1+10 9+14 5-10 50-9 7+13 2-18 6+13
17+6 02+1 2-10 00+4 00+8 3-13 3+12 01-5 2-10 01+1 03+4
00+4 00+8 1-21 01+1 00+5 01-7 >=~/ \S\S \S\S /gx) {m/(
\d+) (.+) /x,, vec$ J,$p +=$2 ,8,= $c+= +$1} warn $J,,
Robert W Sturdevant-Contractor

2004-12-23, 8:56 pm


Jonathan,

Thanks for the response. The DB is unknown but designed to be accessed using
the functions contained in the .dll library when the user wants to write/use
a C pgm. Instead I'd like to access the DB using Perl. Since my last, I
discovered the Roth Win32::API::Prototype which seems to simplify things a
bit. The latter module should work and I'll experiment a bit after the
holiday.

BobS


-----Original Message-----
From: Jonathan Paton [mailto:jepaton@gmail.com]
Sent: Thursday, December 23, 2004 1:58 PM
To: Sturdevant-Contractor, Robert W; beginners@perl.org
Subject: Re: Accessing DLL functions

On Thu, 23 Dec 2004 13:24:47 -0500, Sturdevant-Contractor, Robert W
<robert.w.sturdevant@us.army.mil> wrote:
>
> Hi,
>
> Am I correct in assuming that I can access functions in a .dll file
> using the Win32::API module. I have a proprietary database database
> and C .dll with function prototypes. I would like to write a perl pgm
> using the ilibrary functions to access the DB. Am I headed in the
> right direction? If not, is there another means? Thanks.


Could you elaborate on what database is involved? There are many DBD
(driver) modules on CPAN:

http://search.cpan.org/search?m=mod...3A%3A&s=1&n=100

These work with DBI, providing a consistant interface. If a suitable DBD
driver does not yet exist, why not write something that fits in to the
existing DB framework?

There are many ways to reach the same objective. The difficulty ranges from
easy (if you get Win32:API or similar to do it) to hard (writing drivers or
using the XS layer).

I am not qualified to write about Win32::API.

Jonathan Paton

--
#!perl
$J=' 'x25 ;for (qq< 1+10 9+14 5-10 50-9 7+13 2-18 6+13
17+6 02+1 2-10 00+4 00+8 3-13 3+12 01-5 2-10 01+1 03+4
00+4 00+8 1-21 01+1 00+5 01-7 >=~/ \S\S \S\S /gx) {m/(
\d+) (.+) /x,, vec$ J,$p +=$2 ,8,= $c+= +$1} warn $J,,

--
To unsubscribe, e-mail: beginners-unsubscribe@perl.org For additional
commands, e-mail: beginners-help@perl.org <http://learn.perl.org/>
<http://learn.perl.org/first-response>

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com