Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: C# calling Perl calling C#

by jand (Friar)
on Oct 15, 2008 at 22:30 UTC ( [id://717357]=note: print w/replies, xml ) Need Help??


in reply to C# calling Perl calling C#

You cannot implement a CV in C#; the CV assumes certain calling conventions that are specific to the Perl internals.

You may get this stuff working by turning the callback entry into a Win32::API object. I haven't checked if this would be supported directly, or if you would need to fake up some Win32::API internals first.

A commercial solution to your problem would be to use PerlNET from the ActiveState Perl Dev Kit. Check out the documentation for what it does.

Replies are listed 'Best First'.
Re^2: C# calling Perl calling C#
by rich41 (Initiate) on Oct 16, 2008 at 22:41 UTC

    After many more hours of searching I came to the same conclusion. The callback example that I referenced was implemented as a DLL and invoked using the Win32::API.

    Unfortunately, using PerlNET is not an option for me; although I do agree it would make things a lot simpler.

    Currently I am trying to implement a work around by defining pure-Perl intermediary functions using PerlEzEvalString, then having those functions modify magic scalars to pass data back to C. At first glance this approach appeared promising; however, providing the correct return type format for the PerlEzSetMagicScalarFunctions function pointers is proving to be rather difficult (but that is more a C problem than a Perl issue).

    I was only able to find one code example relating to magic scalars with PerlEZ (PerlEzSetMagicScalarFunctions), and the documentation at ActiveState appears to be a little thin. Do you know of any other examples?

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://717357]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (2)
As of 2024-04-19 01:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found