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?