http://qs1969.pair.com?node_id=234319


in reply to "pointers" for calling a DLL

Solo

This looks like it should work, but I've still got no joy. If I print the filename, it's still coming back as "0". Should I have to do anything to coerce $filename back into something that I can print? I'm wondering if the "Open" method is working in the first place.

UPDATE:

It looks like I can get methods that want a pointer to a long to work by initializing them with $var = Variant(VT_I4|VT_BYREF, 0);. The docs say that the BSTR variables have to be initialized to NULL. Isn't that what we're doing with the $var = Variant(VT_BSTR|VT_EMPTY, 0) statment?

chinman

Replies are listed 'Best First'.
Re^2: "pointers" for calling a DLL
by Solo (Deacon) on Feb 11, 2003 at 12:04 UTC
    Variant BSTRs should automatically print nicely.

    You say you found GetFileName in OLE View, but was it of type "Dispinterface" or something else? Do you have an automation/scripting object model for the component--or can you get one?

    COM/OLE components can contain interfaces that only C/C++ can hit. And they often contain thin wrappers, called Dispinterfaces, around these C/C++ calls that VB, vbs, Perl, et al can easily use. You may have found the wrong one. I wonder if the syntax is going to be something different... for instance:

    my $filename = $XRawFile->{Filename};

    ** /me shrugs ** But this is just a hunch.

    --
    Never tell me the odds!