----- Original Message ----- 
From: "sam joseph" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; <beginners@perl.org>;
<[EMAIL PROTECTED]>
Sent: Monday, October 03, 2005 12:58 AM
Subject: Re: Urgent help in h2xs


> Hi All
>
> I appreciate your help
>
> I have MSVC++ version 6.0

Ok - did you get it set up correctly so that you can use it to build perl
modules ? Can you build (eg) Math::FFT from the source tarball on cpan ?

>
> Can you be more precise in telling how to use VC++ for h2xs as i dont have
> much prior working experience in VC++ except for some basic C++ coding.
>

'h2xs' is simply a batch file you run when you want to create your own perl
XS module. It just creates the basics of the files that you're going to
need.

Start with 'perldoc perlxstut'. Work through the examples it contains.
There's no fast way to be able to write XS code. It takes time and effort.

Another way, with a learning curve that is not so steep, is to use
Inline::C - which autogenerates the actual XS code for you, and then
compiles and runs it automatically for you, too. It comes with a cookbook of
examples (perldoc Inline::C-Cookbook) that show, among other things, how to
access functions in Windows dll's. It also requires that you have your C
compiler set up correctly. I recommend that you take that approach. (Again,
there are some things to learn.)

>
> I have made a default dll project which has a default exported method.

Probably the quickest way you'll be able to access that exported function
from perl on Win32 is to use Win32::API (which doesn't need VC++, or any
other compiler, at all). It's a quick and dirty way of getting the job
done - and I would prefer to see you use Inline::C or XS. But lots of people
use Win32::API and get good milage from it. I think it still requires that
your dll functions use the __stdcall calling conventions, which just means
that you include -Gz command line switch when building the dll. I don't know
how you invoke the __stdcall calling convention if you build the dll using
the Visual Studio IDE (point & click) - but there would be a way.

Cheers,
Rob


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to