On Thu, 03 Mar 2011, Manuel Reimer wrote:

Hi Manuel,

[...]
 
> <http://through-the-interface.typepad.com/through_the_interface/2010/02/handling-com-calls-rejected-
> by-autocad-from-an-external-net-application.html>
> 
> This C# and so I tried to port this over to C++ to be able to add this
> to the OLE.xs file. I've attached the patch file with my proof of
> concept code.
> 
> As you see in my patch, I commented out the code, initializing OLE in
> multi threading mode, to make the CoRegisterMessageFilter call succeed.

The way to tell Win32::OLE to use OleInitialize() is to call

    Win32::OLE->Initialize(Win32::OLE::COINIT_OLEINITIALIZE());

right after you "use" Win32::OLE.  Put it inside a BEGIN block if you
may call any OLE functionality at compile time (e.g. while loading other
code).
 
> Problem with this patch: It doesn't work. Anything, it does, is crashing
> the Perl interpreter... :-(

It is not crashing for me just running the bundled test suite.  Do you have
some sample script that crashes that doesn't involve AutoCAD, as I don't
have a copy of that application available.

> Is someone here able to have a look at this and perhaps fix this code?

I haven't really looked at your code; just applied the patch, built the
module and ran the tests, with no crash in sight.

So I assume the crash only happens when the MessageFilter is actually
being invoked.  I'll try to look at your implementation to see if I can
find anything that could go wrong, but having a reproducible crash would
make this easier.

Cheers,
-Jan


_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to