Ryan Jendoubi wrote:

  Hi,

I've narrowed down the error about not being able to call C++ methods using a different package name in Perl.

The C++ class is called wxWebView, but I want to access it in Perl with Wx::WebKit->new() as this would be more intuitive for people.
>
I've set the Wx::WebKit as the package name in the xs and the module name, but it always leads to the error 'variable is not of type Wx::WebView'.

Everything in wxPerl assumes that the C++ class name matches the Perl name...

I'm using the O_WXOBJECT typemap for WebView *, and I can see that I must be failing the assertion "if( !classname || sv_derived_from( scalar, CHAR_P classname ) )" in helpers.cpp line 371.

Since sv_derived_from() checks inheritance at the C level, I don't know why this is failing.

  sv_derived_from checks inheritance at the Perl level.

It only fails when I try to invoke methods on the object in Perl, not when creating it.

Invoking uses the input typemap, which checks the class name, while the output typemap does not.

What do I need to do to use the package name I want in Perl?

Wrap the class with the C++ name and subclass it in Perl with the name you want?

Regards,
Mattia

Reply via email to