v1.7.9 env--MS Word COM ifc reports spurious error when invoked from perl (ActiveState works fine)

Clark Morgan spammers.are.scum@gmail.com
Sun Aug 14 08:56:00 GMT 2011


Cygwin version: CYGWIN_NT-6.1-WOW64 I5 1.7.9(0.237/5/3) 2011-03-29
10:10 i686 Cygwin

Host:  MS Windows 7, SP1, 64Bit OS

Cygwin Perl Version: v5.10.1 (*) built for i686-cygwin-thread-multi-64int

MS Word Version:  Office 2010 or Office 2007.

==================================================

A simple Win32 COM script (included below) dies when invoked like so:

$ perl broken_with_cygwin.pl
Can't call method "PageSetup" on an undefined value at
broken_with_cygwin.pl line 23.
$ cat broken_with_cygwin.pl
#!/bin/perl

   use Win32::OLE;
   use Win32;

   my ($Word, $tmp_out_file);

   $tmp_out_file = Win32::GetCwd() . "__some_junk_temp_file__.txt";
   open(TMP_OUT_FILE, '>', $tmp_out_file) or
       die "$0: error opening temporary output file \"$tmp_out_file\": $!";
   print TMP_OUT_FILE "one line of text\n";
   close TMP_OUT_FILE;

   if (! ($Word = Win32::OLE->new('Word.Application')))
   {
       die "failed to start MS Word, aborting\n";
   }
   $Word->{Visible} = 1;     # make word visible
   $Word->Activate;          # and activate word
   $Word->Documents->Add;    # create a new, empty document
   $Word->Selection->InsertFile($tmp_out_file);
   $Word->ActiveDocument->PageSetup->{LeftMargin}  = 36;   # 0.5 in
   $Word->ActiveDocument->PageSetup->{RightMargin} = 36;   # 0.5 in

   # mark newly created document as "saved" (so it can be clicked away
   # without a prompt to save the "file").
   $Word->ActiveDocument->{Saved} = 1;
   unlink $tmp_out_file;

======================
If I run this script in a Windows XP environment (using the same
version of perl and cygwin), no errors are reported.

If I run this same script in a cmd.exe shell, no errors are reported.

If I run this same script via the ActiveState Perl interpreter, no
errors are reported.

I've attached the script and the output of "cygcheck -s" .

- Clark Morgan
-------------- next part --------------

Cygwin Configuration Diagnostics
Current System Time: Sat Aug 13 22:51:18 2011

Windows 7 Home Premium Ver 6.1 Build 7601 Service Pack 1

Running under WOW64 on AMD64

Path:	.
	C:\Perl64\bin
	C:\util
	C:\cygwin\bin
	C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common
	C:\Windows\system32
	C:\Windows
	C:\Windows\System32\Wbem
	C:\Windows\System32\WindowsPowerShell\v1.0
	C:\Program Files\Trend Micro\AMSP
	C:\Program Files (x86)\Vim\vim73
	C:\Program Files (x86)\QuickTime\QTSystem

Output from C:\cygwin\bin\id.exe
UID: 1004(cm)   GID: 513(None)
513(None)       545(Users)      1000(HomeUsers)

SysDir: C:\Windows\system32
WinDir: C:\Windows

PWD = '/cygdrive/c/cm/projects/fl/util'
HOME = '/cygdrive/c/cm/home'

Use '-r' to scan registry

obcaseinsensitive set to 1

Cygwin installations found in the registry:
  System: Key: c5e39b7a9d22bafb Path: C:\cygwin

c:  hd  NTFS    476837Mb  10% CP CS UN PA FC     
d:  cd             N/A    N/A                    
e:  fd             N/A    N/A                    
f:  fd             N/A    N/A                    
g:  fd             N/A    N/A                    
h:  fd             N/A    N/A                    

C:\cygwin        /          system  binary,auto
C:\cygwin\bin    /usr/bin   system  binary,auto
C:\cygwin\lib    /usr/lib   system  binary,auto
cygdrive prefix  /cygdrive  user    binary,auto

Found: C:\cygwin\bin\awk
 -> C:\cygwin\bin\gawk.exe
Found: C:\cygwin\bin\bash.exe
Found: C:\cygwin\bin\cat.exe
Found: C:\cygwin\bin\cp.exe
Not Found: cpp (good!)
Not Found: crontab
Found: C:\cygwin\bin\find.exe
Found: C:\Windows\system32\find.exe
Not Found: gcc
Not Found: gdb
Found: C:\cygwin\bin\grep.exe
Found: C:\cygwin\bin\kill.exe
Not Found: ld
Found: C:\cygwin\bin\ls.exe
Not Found: make
Found: C:\cygwin\bin\mv.exe
Found: C:\cygwin\bin\patch.exe
Found: C:\Perl64\bin\perl.exe
Found: C:\cygwin\bin\perl.exe
Found: C:\cygwin\bin\rm.exe
Found: C:\cygwin\bin\sed.exe
Found: C:\cygwin\bin\ssh.exe
Found: C:\cygwin\bin\sh.exe
Found: C:\cygwin\bin\tar.exe
Found: C:\cygwin\bin\test.exe
Not Found: vi
Found: C:\Program Files (x86)\Vim\vim73\vim.exe

   15k 2009/12/27 C:\cygwin\bin\cygattr-1.dll
   62k 2011/05/21 C:\cygwin\bin\cygbz2-1.dll
    7k 2003/10/19 C:\cygwin\bin\cygcrypt-0.dll
 1147k 2011/03/16 C:\cygwin\bin\cygcrypto-0.9.8.dll
  284k 2010/06/01 C:\cygwin\bin\cygcurl-4.dll
  943k 2007/12/17 C:\cygwin\bin\cygdb-4.5.dll
 1296k 2007/12/17 C:\cygwin\bin\cygdb_cxx-4.5.dll
  511k 2010/06/17 C:\cygwin\bin\cygedit-0.dll
  118k 2008/05/09 C:\cygwin\bin\cygexpat-1.dll
   43k 2010/01/02 C:\cygwin\bin\cygform-10.dll
   40k 2009/03/01 C:\cygwin\bin\cygform-8.dll
   43k 2009/11/20 C:\cygwin\bin\cygform-9.dll
   47k 2010/01/02 C:\cygwin\bin\cygformw-10.dll
   44k 2011/03/22 C:\cygwin\bin\cyggcc_s-1.dll
   19k 2009/02/26 C:\cygwin\bin\cyggdbm-4.dll
    8k 2009/02/26 C:\cygwin\bin\cyggdbm_compat-4.dll
  317k 2011/07/31 C:\cygwin\bin\cyggmp-3.dll
   24k 2009/06/23 C:\cygwin\bin\cyghistory6.dll
   25k 2011/01/26 C:\cygwin\bin\cyghistory7.dll
  358k 2011/04/29 C:\cygwin\bin\cygicons-0.dll
  980k 2011/01/28 C:\cygwin\bin\cygiconv-2.dll
  193k 2010/05/16 C:\cygwin\bin\cygidn-11.dll
   31k 2009/04/03 C:\cygwin\bin\cygintl-8.dll
   39k 2008/09/07 C:\cygwin\bin\cyglber-2-3-0.dll
  189k 2008/09/07 C:\cygwin\bin\cygldap-2-3-0.dll
  201k 2008/09/07 C:\cygwin\bin\cygldap_r-2-3-0.dll
    5k 2011/03/29 C:\cygwin\bin\cyglsa.dll
    9k 2011/03/29 C:\cygwin\bin\cyglsa64.dll
  123k 2011/05/19 C:\cygwin\bin\cyglzma-5.dll
  103k 2011/02/03 C:\cygwin\bin\cygmagic-1.dll
   25k 2010/01/02 C:\cygwin\bin\cygmenu-10.dll
   21k 2009/03/01 C:\cygwin\bin\cygmenu-8.dll
   25k 2009/11/20 C:\cygwin\bin\cygmenu-9.dll
   25k 2010/01/02 C:\cygwin\bin\cygmenuw-10.dll
   24k 2008/10/30 C:\cygwin\bin\cygminires.dll
  213k 2011/07/31 C:\cygwin\bin\cygmp-3.dll
   63k 2010/01/02 C:\cygwin\bin\cygncurses++-10.dll
   66k 2009/03/01 C:\cygwin\bin\cygncurses++-8.dll
   63k 2009/11/20 C:\cygwin\bin\cygncurses++-9.dll
   63k 2010/01/02 C:\cygwin\bin\cygncurses++w-10.dll
  195k 2010/01/02 C:\cygwin\bin\cygncurses-10.dll
  237k 2009/03/01 C:\cygwin\bin\cygncurses-8.dll
  198k 2009/11/20 C:\cygwin\bin\cygncurses-9.dll
  244k 2010/01/02 C:\cygwin\bin\cygncursesw-10.dll
   13k 2010/01/02 C:\cygwin\bin\cygpanel-10.dll
   11k 2009/03/01 C:\cygwin\bin\cygpanel-8.dll
   13k 2009/11/20 C:\cygwin\bin\cygpanel-9.dll
   13k 2010/01/02 C:\cygwin\bin\cygpanelw-10.dll
  224k 2010/06/15 C:\cygwin\bin\cygpcre-0.dll
   10k 2010/06/15 C:\cygwin\bin\cygpcreposix-0.dll
 1627k 2010/08/29 C:\cygwin\bin\cygperl5_10.dll
   22k 2002/06/09 C:\cygwin\bin\cy/usr/bin/cygrunsrv: warning: OpenService failed for 'DcomLaunch': Win32 error 5
Access is denied.
/usr/bin/cygrunsrv: warning: OpenService failed for 'ose': Win32 error 5
Access is denied.
/usr/bin/cygrunsrv: warning: OpenService failed for 'osppsvc': Win32 error 5
Access is denied.
/usr/bin/cygrunsrv: warning: OpenService failed for 'pla': Win32 error 5
Access is denied.
/usr/bin/cygrunsrv: warning: OpenService failed for 'QWAVE': Win32 error 5
Access is denied.
/usr/bin/cygrunsrv: warning: OpenService failed for 'RpcEptMapper': Win32 error 5
Access is denied.
/usr/bin/cygrunsrv: warning: OpenService failed for 'RpcSs': Win32 error 5
Access is denied.
gpopt-0.dll
  155k 2009/06/23 C:\cygwin\bin\cygreadline6.dll
  164k 2011/01/26 C:\cygwin\bin\cygreadline7.dll
   84k 2010/07/02 C:\cygwin\bin\cygsasl2-2.dll
    8k 2011/05/05 C:\cygwin\bin\cygsigsegv-2.dll
  121k 2010/06/01 C:\cygwin\bin\cygssh2-1.dll
  263k 2011/03/16 C:\cygwin\bin\cygssl-0.9.8.dll
    8k 2011/03/22 C:\cygwin\bin\cygssp-0.dll
  771k 2011/03/22 C:\cygwin\bin\cygstdc++-6.dll
   48k 2010/01/02 C:\cygwin\bin\cygtic-10.dll
   48k 2009/11/20 C:\cygwin\bin\cygtic-9.dll
   48k 2010/01/02 C:\cygwin\bin\cygticw-10.dll
   40k 2009/07/08 C:\cygwin\bin\cygusb0.dll
   28k 2010/03/28 C:\cygwin\bin\cygwrap-0.dll
   76k 2010/08/01 C:\cygwin\bin\cygz.dll
 2604k 2011/03/29 C:\cygwin\bin\cygwin1.dll
    Cygwin DLL version info:
        DLL version: 1.7.9
        DLL epoch: 19
        DLL old termios: 5
        DLL malloc env: 28
        Cygwin conv: 181
        API major: 0
        API minor: 237
        Shared data: 5
        DLL identifier: cygwin1
        Mount registry: 3
        Cygwin registry name: Cygwin
        Program options name: Program Options
        Installations name: Installations
        Cygdrive default prefix: 
        Build date: 
        Shared id: cygwin1S5


No Cygwin services found.


Cygwin Package Information
Package              Version              Status
_update-info-dir     00971-1              OK
alternatives         1.3.30c-10           OK
base-cygwin          3.0-1                OK
base-files           4.0-6                OK
bash                 4.1.10-4             OK
bc                   1.06-2               OK
byacc                1.9-1                OK
bzip2                1.0.6-2              OK
coreutils            8.10-1               OK
crypt                1.1-1                OK
csih                 0.9.4-1              OK
ctags                5.8-1                OK
cygrunsrv            1.34-1               OK
cygutils             1.4.6-1              OK
cygwin               1.7.9-1              OK
cygwin-doc           1.7-1                OK
dash                 0.5.6.1-2            OK
diffutils            2.9-1                OK
dos2unix             5.3-1                OK
editrights           1.01-2               OK
file                 5.05-1               OK
findutils            4.5.9-2              OK
flex                 2.5.35-1             OK
flip                 1.19-1               OK
gawk                 4.0.0-1              OK
gettext              0.17-11              OK
gnupg                1.4.9-2              OK
grep                 2.6.3-1              OK
groff                1.20.1-2             OK
gzip                 1.4-1                OK
ipc-utils            1.0-1                OK
less                 444-1                OK
libattr1             2.4.43-1             OK
libbz2_1             1.0.6-2              OK
libcurl4             7.20.1-1             OK
libdb4.5             4.5.20.2-2           OK
libedit0             20090923-1           OK
libexpat1            2.0.1-1              OK
libgcc1              4.3.4-4              OK
libgdbm4             1.8.3-20             OK
libgmp3              4.3.2-1              OK
libiconv2            1.13.1-2             OK
libidn11             1.18-1               OK
libintl8             0.17-11              OK
liblzma5             5.0.2_20110517-1     OK
libncurses10         5.7-18               OK
libncurses8          5.5-10               OK
libncurses9          5.7-16               OK
libncursesw10        5.7-18               OK
libopenldap2_3_0     2.3.43-1             OK
libopenssl098        0.9.8r-2             OK
libpcre0             8.02-1               OK
libpopt0             1.6.4-4              OK
libreadline6         5.2.14-12            OK
libreadline7         6.1.2-2              OK
libsasl2             2.1.23-1             OK
libsigsegv2          2.10-1               OK
libssh2_1            1.2.5-1              OK
libssp0              4.3.4-4              OK
libstdc++6           4.3.4-4              OK
libusb-win32         0.1.12.2-1           OK
libwrap0             7.6-21               OK
login                1.10-10              OK
m4                   1.4.16-1             OK
man                  1.6f-1               OK
minires              1.02-1               OK
openssh              5.8p1-1              OK
patch                2.5.8-9              OK
perl                 5.10.1-5             OK
perl-libwin32        0.28-3               OK
perl-Win32-GUI       1.06-3               OK
perl_manpages        5.10.1-5             OK
rcs                  5.7-11               OK
rebase               3.0.1-1              OK
run                  1.1.13-1             OK
sed                  4.2.1-1              OK
tar                  1.25-1               OK
terminfo             5.7_20091114-14      OK
terminfo0            5.5_20061104-12      OK
texinfo              4.13-3               OK
tzcode               2010j-1              OK
units                1.87-1               OK
which                2.20-2               OK
xz                   5.0.2_20110517-1     OK
zlib                 1.2.5-1              OK
zlib-devel           1.2.5-1              OK
zlib0                1.2.5-1              OK
Use -h to see help about each section
-------------- next part --------------
A non-text attachment was scrubbed...
Name: broken_with_cygwin.pl
Type: application/octet-stream
Size: 1024 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin/attachments/20110814/3827f32c/attachment.obj>
-------------- next part --------------
--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


More information about the Cygwin mailing list