wa4otj has asked for the wisdom of the Perl Monks concerning the following question:

I'm a somewhat newbie to Perl, but I have been using ActiveState a while and have progressed to downloading and installing a few packages from CPAN. I thought I was doing well, until I banged my head into Win32::OLE, which appears to have some C++ code in it that must be compiled.

The Module tutorial on Perl Monks (A Practical Guide to Compiling C based Modules under ActiveState using Microsoft C++) says "Get Visual C++ .NET"

I guess that's the only answer. But I really don't want to give $85 to Microsoft. I downloaded the free Visual C++ Toolkit 2003 instead.

I almost get there with it. It has the cl.exe compiler, and nmake, etc. It has many of the header files. I can almost compile the module. But I keep running into files like ocidl.h that don't exist in the free version.

I notice these files seem to exist in non-Microsoft places, such as Wine and Borland. But the ones I looked at don't seem to be quite the right thing. I get compile errors. .. Lots .. of .. errors.

So my question to anyone familiar with Win32::OLE under Windows, is there any way to get the package installed without buying the .NET package?? Do all these many include files exist online somewhere?

Or, is there somewhere that a pre-compiled binary version of Win32 that I can just drop into the appropriate directories and skip the compile step?

Am I overlooking something obvious?

Replies are listed 'Best First'.
Re: OLE from Perl??
by bmann (Priest) on Jun 11, 2004 at 21:54 UTC
    It's standard with AS perl, but you can build it for free if you want. You'll need the free MSVC toolkit, the .NET SDK and the platform SDK.

    In 346487 I outline the steps to complete the build environment. Steps 1-3 outline the required software and 6-8 (8 may not be necessary) outline configuring your environment.

    I meant to wrap it up more cleanly (maybe a batch file) and test it more thoroughly, but I ran out of time and motivation. An anonymous monk replied with a link to a simpler procedure, but please note that only works if you shell out the money for VS.NET.

    Good luck!

      Much thanks to all who pointed out my oversight. I now have it working, and can control an Excel spreadsheet from Perl. Terrific.

      Unfortunately, the application I want to ultimately control is not Excel, and I'm floundering a bit. Can't do a new, load, or GetActiveObject on it.

      Guess I need a bit more study.

      Thanks again to all who responded with help.

      Cheers,

      Nathan

Re: OLE from Perl??
by diotalevi (Canon) on Jun 11, 2004 at 21:50 UTC
    Win32::OLE is already in your AS perl installation. You do not need to download or install it separately.
      Hmm. I guess I *AM* missing something obvious.

      Thanks for the response.

      Gotta go back and play some more I guess.

      Thanks,

      Nathan

Re: OLE from Perl??
by Joost (Canon) on Jun 11, 2004 at 21:50 UTC