Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much

Re: DLL or VB to Perl

by xiaoyafeng (Chaplain)
on Jun 11, 2014 at 02:45 UTC ( #1089469=note: print w/replies, xml ) Need Help??

in reply to DLL or VB to Perl

Your English is as bad as me, so i don't be sure if my answer is for you.;)

first you need use enumobject to check if com library installed correctly
$Count = Win32::OLE->EnumAllObjects(sub { my $Object = shift; my $Class = Win32::OLE->QueryObjectType($Object); printf "# Object=%s Class=%s\n", $Object, $Class; });
if the library name you want to use does show in above list, you must recheck your perlcode.

in the other hand, you can use ole_viewer, and other M$ tools to export function declaration, and use it in XS/Inline C. I've tried but it's really tedious work.

I am trying to improve my English skills, if you see a mistake please feel free to reply or /msg me a correction

Replies are listed 'Best First'.
Re^2: DLL or VB to Perl
by joago (Initiate) on Jun 16, 2014 at 08:52 UTC

    I have made VBS:

    Set objLib = CreateObject("CortalConsors.TradingAPI.VersionInfo") name = objLib.GetAssemblyFullname() MsgBox name

    The VBScript Converter translate this:

    #!perl use Win32; use Win32::OLE; $objLib = Win32::OLE->new('CortalConsors.TradingAPI.VersionInfo'); #### Error: Can't resolve progID CortalConsors.TradingAPI.VersionInfo $name = $objLib->GetAssemblyFullname(); Win32::MsgBox($name);

    The VBScript work fine --> The perl not !!

    I have install "SystemScripter" --> This tell me (If I want load the

    COM-Object 'CortalConsors.TradingAPI.VersionInfo'):"Typelibrary Missing"

    and can not resolve the details from COM.

    In "SystemScripter" can I give the path of TLB by hand and it's work

    Both (DLL and TLB) are in registry --> maybe not right !?

    What can I do in perl ???

      In "SystemScripter" can I give the path of TLB by hand and it's work...

      What does that mean? What does that mean in terms of API calls? Why don't you try a "class id" instead?

        I have in "SystemScripter" the list of all registered COM-Objects. I can make program lines with drag and drop. With doble click by the COM-Object its open a window with desccription of the object. For my object the "SystemScripter" tell me "the TLB is missing". The new window has 2 lines with empty information for the TLB (CLSID and adress) at the end of window and the next window with the information from inside the COM (class,method,interfaces ...) not work. If I fill the adress line for the TLB by hand then I can open this information and give it to the program lines with drag and drop.

        I have with "class id" the same problem as with the name:the COM can not open and I have no idee in which manner I sold give the CLSID from TLB to perl.

        NEW INFORMATION: If I want add the COM in old SDK then I have:

        No reference on <assembly> could be added. The ActiveX-type library <link to the library> was exported from a .NET-Assembly and cannot be added as a reference. Add, instead, a reference to the .NET-Assembly.

        In which manner can I do this in perl ??

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1089469]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (3)
As of 2017-07-21 05:46 GMT
Find Nodes?
    Voting Booth?
    I came, I saw, I ...

    Results (319 votes). Check out past polls.