RE: Win32::OLE Module - Excel chart Generation Problem

2013-04-17 Thread Steven Manross
While I don't have your exact setup, this script works fine in perl 5.8
(32-bit), Excel 2003 (32-bit) on Win Server 2003 (32-bit)..  Yes, it's a
dated config..  But it's running fine for now.

As well, I ran this on Win7 (x64), Perl 5.8 (32-bit), Excel 2010
(32-bit).  it worked fine again.  (Which seems to point to the version
of office not being an issue --  2003 - 2010 should work fine if 2003
and 2010 do.
 
I'd suspect that the Office you have might be 32-bit and you are trying
to use Perl64 which may have issues calling a 32-bit object (64-bit
calls to a 32-bit COM object) although I can't guarantee that ..  I just
know that I run into this particualr problem in VBScript unless I use
the 32-bit VBScript engine in %SYSTEMROOT%\syswow64\cscript.exe when
invoking 32-bit COM objects (like my office apps).

If the script you provided is the exact script you used to generate the
error, it seems as though it's complaining about this line...  Which
somewhat points to charting being a suspect for a 32-bit COM object.
 
Line 20 = $Chart->{ChartType} = xlAreaStacked;

But again, I've ignored the possibility of Perl having an issue as I
don't have v5.16 or perl64 handy to test in your particular config, nor
did you tell us if the Office you have is 64 or 32-bit (which would add
to the troubleshooting of this issue).

FYI and HTH

Steven


From: perl-win32-users-boun...@listserv.activestate.com
[mailto:perl-win32-users-boun...@listserv.activestate.com] On Behalf Of
ketan patel
Sent: Tuesday, April 09, 2013 2:21 PM
To: perl-win32-users@listserv.ActiveState.com
Subject: Win32::OLE Module - Excel chart Generation Problem


Hello All,
I am running following simple script on perl64 to generate chart on
excel but I am getting following errors without generating any chart.
It opens excel sheet, write data into sheet but no chart.

Win32::OLE(0.1709) error 0x80020003: "Member not found"
in PROPERTYPUT "ChartType" at C:\path\test.pl line 20.

Here is my system spec


PERL version : Perl 64 v5.16.3
WIN32 OLE : 0.1709
Excel Version : Excel 2007 SP3

Can anyone please give me some input on how I can remove this error and
generate chart ?

Thank you,
==Script ===

use strict;
use Win32::OLE;
use Win32::OLE::Const 'Microsoft Excel';

my $Excel = Win32::OLE->new("Excel.Application");
$Excel->{Visible} = 1;
$Win32::OLE::Warn = 3;
my $Book = $Excel->Workbooks->Add;
my $Sheet = $Book->Worksheets(1);
my $Range = $Sheet->Range("A2:C7");
$Range->{Value} =
[['Delivered', 'En route', 'To be shipped'],
 [504, 102, 86],
 [670, 150, 174],
 [891, 261, 201],
 [1274, 471, 321],
 [1563, 536, 241]];

my $Chart = $Excel->Charts->Add;
$Chart->{ChartType} = xlAreaStacked;
$Chart->SetSourceData({Source => $Range, PlotBy => xlColumns});
$Chart->{HasTitle} = 1;

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


Re: Win32::Fileop choose multiple directories

2012-07-30 Thread Jenda Krynicky
From:   Arjun Roychowdhury 
Date sent:  Mon, 23 Jul 2012 16:47:08 -0400
Subject:Re: Win32::Fileop choose multiple directories
To: perl-win32-users@listserv.activestate.com

> Thank you. That's unfortunate.
> Is multiple directory selection all that strange? My usecase is that I
> am writing a tool to upload a whole bunch of folders to a cloud
> service and they are not necessarily inside one neat directory...
> 
> regds

In such case you usually select each directory separately as you 
browse the filesystem. The thing is that to be able to select several 
directories that do not reside in the same directory, you'd have to 
see the whole directory tree and it could be huge.

I'd let them select the directories one after another and attempt to 
transfer them even while the user is browsing for more.

Jenda
= je...@krynicky.cz === http://Jenda.Krynicky.cz =
When it comes to wine, women and song, wizards are allowed 
to get drunk and croon as much as they like.
-- Terry Pratchett in Sourcery

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


Re: Win32::Fileop choose multiple directories

2012-07-24 Thread Arjun Roychowdhury
Thanks Jenda. It seems CommonDialog is only from Vista onwards. I
unfortunately have a lot of XP users as well.
I think the only way is for me to create a custom widget, or revert to
the less intuitive Tk FileSelect family.

regds

On Mon, Jul 23, 2012 at 4:43 PM, Jenda Krynicky  wrote:
> From: Arjun Roychowdhury 
>> Hi, I am looking for a perl API that presents a windows style dialog
>> to users and allows them to select multiple folders. While perl::Tk
>> has FileSelect and DirTree etc they don't have the native windows look
>> and feel.
>> In reading 
>> http://search.cpan.org/~jenda/Win32-FileOp-0.16.00-withoutworldwriteables/FileOp.pm
>> I noticed two APIs:
>>
>> a) OpenDialog
>> b) BrowserForFolder
>>
>> a) seems to allow multiple selections (OFN_ALLOW_MULTISELECT) but I
>> can't get it to select folders only
>> b) seems to allow folder selections, but there is no BFI_ equivalent
>> of multiselect.
>>
>> I've gone through many iterations of folder select dialogs
>> (chooseDirectory, etc etc) but I seem to be stuck with either a old Tk
>> looking dialog or a windows looking dialog that doesn't allow both
>> multi-select + folder select
>
> Win32::FileOp just wraps a few Win32 calls. I checked the
> SHBrowseForFolder and there doesn't seem to be a way to allow it to
> select several folders and seems the GetOpenFileName
> (http://msdn.microsoft.com/en-
> us/library/windows/desktop/ms646927(v=vs.85).aspx) cannot be
> convinced to select folders.
>
> I actually doubt there is a predefined dialog that'd allow you to do
> this as it sounds like a rather strange request.
>
> Jenda
> = je...@krynicky.cz === http://Jenda.Krynicky.cz =
> When it comes to wine, women and song, wizards are allowed
> to get drunk and croon as much as they like.
> -- Terry Pratchett in Sourcery
>
> ___
> Perl-Win32-Users mailing list
> Perl-Win32-Users@listserv.ActiveState.com
> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



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


Re: Win32::Fileop choose multiple directories

2012-07-23 Thread Arjun Roychowdhury
Thank you. That's unfortunate.
Is multiple directory selection all that strange? My usecase is that I
am writing a tool to upload a whole bunch of folders to a cloud
service and they are not necessarily inside one neat directory...

regds


On Mon, Jul 23, 2012 at 4:43 PM, Jenda Krynicky  wrote:
> From: Arjun Roychowdhury 
>> Hi, I am looking for a perl API that presents a windows style dialog
>> to users and allows them to select multiple folders. While perl::Tk
>> has FileSelect and DirTree etc they don't have the native windows look
>> and feel.
>> In reading 
>> http://search.cpan.org/~jenda/Win32-FileOp-0.16.00-withoutworldwriteables/FileOp.pm
>> I noticed two APIs:
>>
>> a) OpenDialog
>> b) BrowserForFolder
>>
>> a) seems to allow multiple selections (OFN_ALLOW_MULTISELECT) but I
>> can't get it to select folders only
>> b) seems to allow folder selections, but there is no BFI_ equivalent
>> of multiselect.
>>
>> I've gone through many iterations of folder select dialogs
>> (chooseDirectory, etc etc) but I seem to be stuck with either a old Tk
>> looking dialog or a windows looking dialog that doesn't allow both
>> multi-select + folder select
>
> Win32::FileOp just wraps a few Win32 calls. I checked the
> SHBrowseForFolder and there doesn't seem to be a way to allow it to
> select several folders and seems the GetOpenFileName
> (http://msdn.microsoft.com/en-
> us/library/windows/desktop/ms646927(v=vs.85).aspx) cannot be
> convinced to select folders.
>
> I actually doubt there is a predefined dialog that'd allow you to do
> this as it sounds like a rather strange request.
>
> Jenda
> = je...@krynicky.cz === http://Jenda.Krynicky.cz =
> When it comes to wine, women and song, wizards are allowed
> to get drunk and croon as much as they like.
> -- Terry Pratchett in Sourcery
>
> ___
> Perl-Win32-Users mailing list
> Perl-Win32-Users@listserv.ActiveState.com
> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



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


Re: Win32::Fileop choose multiple directories

2012-07-23 Thread Jenda Krynicky
From: Arjun Roychowdhury 
> Hi, I am looking for a perl API that presents a windows style dialog
> to users and allows them to select multiple folders. While perl::Tk
> has FileSelect and DirTree etc they don't have the native windows look
> and feel.
> In reading 
> http://search.cpan.org/~jenda/Win32-FileOp-0.16.00-withoutworldwriteables/FileOp.pm
> I noticed two APIs:
> 
> a) OpenDialog
> b) BrowserForFolder
> 
> a) seems to allow multiple selections (OFN_ALLOW_MULTISELECT) but I
> can't get it to select folders only
> b) seems to allow folder selections, but there is no BFI_ equivalent
> of multiselect.
> 
> I've gone through many iterations of folder select dialogs
> (chooseDirectory, etc etc) but I seem to be stuck with either a old Tk
> looking dialog or a windows looking dialog that doesn't allow both
> multi-select + folder select

Win32::FileOp just wraps a few Win32 calls. I checked the 
SHBrowseForFolder and there doesn't seem to be a way to allow it to 
select several folders and seems the GetOpenFileName 
(http://msdn.microsoft.com/en-
us/library/windows/desktop/ms646927(v=vs.85).aspx) cannot be 
convinced to select folders.

I actually doubt there is a predefined dialog that'd allow you to do 
this as it sounds like a rather strange request.

Jenda
= je...@krynicky.cz === http://Jenda.Krynicky.cz =
When it comes to wine, women and song, wizards are allowed 
to get drunk and croon as much as they like.
-- Terry Pratchett in Sourcery

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


RE: Win32::LookupAccountSID()

2012-07-10 Thread Barry Brevik
Thanks for posting!!

-Original Message-
From: Ken Cornetet [mailto:ken.corne...@kimball.com] 
Sent: Tuesday, July 10, 2012 11:39 AM
To: Barry Brevik; perl Win32-users
Subject: RE: Win32::LookupAccountSID()

http://code.activestate.com/lists/perl-win32-users/26301/

-Original Message-
From: perl-win32-users-boun...@listserv.activestate.com
[mailto:perl-win32-users-boun...@listserv.activestate.com] On Behalf Of
Barry Brevik
Sent: Tuesday, July 10, 2012 2:28 PM
To: perl Win32-users
Subject: Win32::LookupAccountSID()

I'm having trouble with Win32::LookupAccountSID() and I was hoping
someone has experience with this function. I'm dragging user SIDs out of
the registry under HKEY_USERS. Then I specify our domain controller as
the "system" parameter (though I've tried both using a local machine,
empty string and undef). I've tried taking out the {} and the dashes in
every permutation and I still get the error "The security ID structure
is invalid."

Here is what I'm doing:

use strict;
use warnings;
use Win32;

my $usersid = '{S-1-5-21-1406052347-744958519-1677701-1424}';

my $accountname = '';
my $siddomain   = '';
my $sidtype = '';
Win32::LookupAccountSID("qbert", $usersid, $accountname, $siddomain,
$sidtype); print "error..: ",
Win32::FormatMessage(Win32::GetLastError()),
"\n";

Barry Brevik

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

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


RE: Win32::LookupAccountSID()

2012-07-10 Thread Ken Cornetet
http://code.activestate.com/lists/perl-win32-users/26301/

-Original Message-
From: perl-win32-users-boun...@listserv.activestate.com 
[mailto:perl-win32-users-boun...@listserv.activestate.com] On Behalf Of Barry 
Brevik
Sent: Tuesday, July 10, 2012 2:28 PM
To: perl Win32-users
Subject: Win32::LookupAccountSID()

I'm having trouble with Win32::LookupAccountSID() and I was hoping someone has 
experience with this function. I'm dragging user SIDs out of the registry under 
HKEY_USERS. Then I specify our domain controller as the "system" parameter 
(though I've tried both using a local machine, empty string and undef). I've 
tried taking out the {} and the dashes in every permutation and I still get the 
error "The security ID structure is invalid."

Here is what I'm doing:

use strict;
use warnings;
use Win32;

my $usersid = '{S-1-5-21-1406052347-744958519-1677701-1424}';

my $accountname = '';
my $siddomain   = '';
my $sidtype = '';
Win32::LookupAccountSID("qbert", $usersid, $accountname, $siddomain, $sidtype); 
print "error..: ", Win32::FormatMessage(Win32::GetLastError()),
"\n";

Barry Brevik

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


RE: win32 and modifying a file

2012-06-08 Thread Brian Raven
From: perl-win32-users-boun...@listserv.activestate.com 
[mailto:perl-win32-users-boun...@listserv.activestate.com] On Behalf Of Greg 
Aiken
Sent: 07 June 2012 23:08
To: Perl-Win32-Users@listserv.activestate.com
Subject: win32 and modifying a file

> dear win32 perl users, ive never actually known how to 'modfiy' a file using 
> perl on win32.  up till now, ive > always read file1, found the data i 
> intended to change, and have always created a new file 2 containing the
> changes.  if i wanted to 'simulate' changing file1, when done i could rename 
> file2 to file1.  in other words, > ive never learned how to modify a file 
> directly.
>
> ive read win32 makes it more difficult to do this than on unix os's.
>
> but in any case, today i wanted to ask the group.
>
> assumming 'file1' exists with the following 3 records in it:
>
> A
> B
> C
>
> is there a 'simple' code fragment someone could post that would demonstrate 
> iterating through this file and
> when record 'B' is encountered, we want to change 'B' to 'B_modified' - done 
> in a way where we only access
> 'file1'.  maybe this cant be done, but im asking.
>
> yes i do realize there is another approach, upserp contents of 'file1' modify 
> in memory, delete 'file1', then > recreate it by dumping the in-memory 
> modified contents.  this seems more like a 'hack' than a direct
> manipulation of the original file.

I would call editing a file in place, without a backup, more of a hack. 
Depending on how valuable your data is, making it possible to perform a 
rollback in the event of a problem seems sensible. So, however you do it, 
keeping a backup of the original may be a good idea.

As for the how to do it part, Tie::File has already been suggested, which may 
be a good fit for what you want to do. If your file is small enough to fit in 
memory, then File::Slurp may be worth a look, particularly the edit functions.

HTH

--
Brian Raven



Please consider the environment before printing this e-mail.

This e-mail may contain confidential and/or privileged information. If you are 
not the intended recipient or have received this e-mail in error, please advise 
the sender immediately by reply e-mail and delete this message and any 
attachments without retaining a copy.

Any unauthorised copying, disclosure or distribution of the material in this 
e-mail is strictly forbidden.
___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: win32 and modifying a file

2012-06-08 Thread Angelos Karageorgiou
 

Forgive me for being dense here for a moment, but isn't it the case
that in any text file, or any kind of file for that matter, editing in
place is overwriting data in subsequent bytes ? So every single time I
had to modify the middle of a file I had to do exactly what you
describe. 

It has nothing to do with Unix vs Windows, more with linear
files. 

Angelos 

On 2012-06-08 00:08, Greg Aiken wrote: 

> dear win32
perl users, ive never actually known how to 'modfiy' a file using perl
on win32. up till now, ive always read file1, found the data i intended
to change, and have always created a new file 2 containing the changes.
if i wanted to 'simulate' changing file1, when done i could rename file2
to file1. in other words, ive never learned how to modify a file
directly. 
> ive read win32 makes it more difficult to do this than on
unix os's. 
> but in any case, today i wanted to ask the group. 
>
assumming 'file1' exists with the following 3 records in it: 
> A 
> B

> C 
> is there a 'simple' code fragment someone could post that would
demonstrate iterating through this file and when record 'B' is
encountered, we want to change 'B' to 'B_modified' - done in a way where
we only access 'file1'. maybe this cant be done, but im asking. 
> yes i
do realize there is another approach, upserp contents of 'file1' modify
in memory, delete 'file1', then recreate it by dumping the in-memory
modified contents. this seems more like a 'hack' than a direct
manipulation of the original file. 
> anyways, thanks to any who might
be willing to enlighten me about this topic. 
> greg

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


RE: win32 and modifying a file

2012-06-07 Thread bulk 88




> Date: Thu, 7 Jun 2012 15:08:08 -0700 
> Subject: win32 and modifying a file 
> From: gai...@visioninfosoft.com 
> To: Perl-Win32-Users@listserv.activestate.com 
>  
> dear win32 perl users, ive never actually known how to 'modfiy' a file  
> using perl on win32.  up till now, ive always read file1, found the  
> data i intended to change, and have always created a new file 2  
> containing the changes.  if i wanted to 'simulate' changing file1, when  
> done i could rename file2 to file1.  in other words, ive never learned  
> how to modify a file directly. 
>  
> ive read win32 makes it more difficult to do this than on unix os's. 
>  
> but in any case, today i wanted to ask the group. 
>  
> assumming 'file1' exists with the following 3 records in it: 
>  
> A 
> B 
> C 
>  
> is there a 'simple' code fragment someone could post that would  
> demonstrate iterating through this file and when record 'B' is  
> encountered, we want to change 'B' to 'B_modified' - done in a way  
> where we only access 'file1'.  maybe this cant be done, but im asking. 
>  
> yes i do realize there is another approach, upserp contents of 'file1'  
> modify in memory, delete 'file1', then recreate it by dumping the  
> in-memory modified contents.  this seems more like a 'hack' than a  
> direct manipulation of the original file. 
>  
> anyways, thanks to any who might be willing to enlighten me about this topic. 


I'm not sure what the problem is, perl can't open a file for sysread and 
syswrite at the same time? Maybe you want a MMF? 
http://code.activestate.com/lists/perl-win32-users/33260/
  
___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: win32 and modifying a file

2012-06-07 Thread Justin Allegakoen
-8<---
> PS. Not sure that this is of any help to you as I ended up having two files. 
> But at least it may illustrate some more power in Perl.
-8<---


Windows doesn't allow in place editing, so on DOS you're left with an
extra move command.

What I like using for this problem is Tie::File

So long as the input file isnt too large (it trades memory for speed)
this module works a treat.

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


RE: win32 and modifying a file

2012-06-07 Thread Arms, Mike
> -Original Message-
> From: perl-win32-users-boun...@listserv.activestate.com [mailto:perl-
> win32-users-boun...@listserv.activestate.com] On Behalf Of Greg Aiken
> Sent: Thursday, June 07, 2012 4:08 PM
> To: Perl-Win32-Users@listserv.activestate.com
> Subject: [EXTERNAL] win32 and modifying a file
> 
> dear win32 perl users, ive never actually known how to 'modfiy' a file using
> perl on win32.  up till now, ive always read file1, found the data i intended 
> to
> change, and have always created a new file 2 containing the changes.  if i
> wanted to 'simulate' changing file1, when done i could rename file2 to file1.
> in other words, ive never learned how to modify a file directly.
> 
> ive read win32 makes it more difficult to do this than on unix os's.
> 
> but in any case, today i wanted to ask the group.
> 
> assumming 'file1' exists with the following 3 records in it:
> 
> A
> B
> C
> 
> is there a 'simple' code fragment someone could post that would
> demonstrate iterating through this file and when record 'B' is encountered,
> we want to change 'B' to 'B_modified' - done in a way where we only access
> 'file1'.  maybe this cant be done, but im asking.
> 
> yes i do realize there is another approach, upserp contents of 'file1' modify 
> in
> memory, delete 'file1', then recreate it by dumping the in-memory modified
> contents.  this seems more like a 'hack' than a direct manipulation of the
> original file.
> 
> anyways, thanks to any who might be willing to enlighten me about this
> topic.
> 
> greg

Possibly you want the Perl command line options:

   -i[extension]
specifies that files processed by the "<>" construct are to be
edited in-place.  It does this by renaming the input file, opening
the output file by the original name, and selecting that output
file as the default for print() statements.  The extension, if
supplied, is used to modify the name of the old file to make a
backup copy, following these rules:

If no extension is supplied, no backup is made and the current
file is overwritten.

If the extension doesn't contain a "*", then it is appended to the
end of the current filename as a suffix.  If the extension does
contain one or more "*" characters, then each "*" is replaced with
the current filename.  In Perl terms, you could think of this as:

($backup = $extension) =~ s/\*/$file_name/g;

This allows you to add a prefix to the backup file, instead of (or
in addition to) a suffix:

$ perl -pi'orig_*' -e 's/bar/baz/' fileA# backup to 
'orig_fileA'

Or even to place backup copies of the original files into another
directory (provided the directory already exists):

$ perl -pi'old/*.orig' -e 's/bar/baz/' fileA # backup to 
'old/fileA.orig'

But, when I try the following one-liner attempting to overwrite my file under 
Windows7 CMD shell, I get an error:

perl -pi -e "s/^B$/B_modified/" file1
Can't do inplace edit without backup.

Note: This was run with ActivePerl v5.12.4 build 1205.

---

Also, when I tried running a similar command under Cygwin's Perl (v5.10.1), it 
behaves differently. It apparently defaults to assuming a ".bak" backup:

perl -pi -e 's/^B$/B_modified/' file1

produces:
file1   <-- the new file
file1.bak   <-- the original file

If I try using the "*" construct referred to in the perldoc:

perl -pi'*' -e 's/^B$/B_modified/' file1

it pretty much fails quietly as file1 ends up truncated as a zero length file 
(and there is no backup file).

---

So, maybe you can just live with this:

perl -pi.bak -e "s/^B$/B_modified/" file1

It will first rename file1 to file1.bak, then process the file outputting each 
line into the output file, "file1". You will end up with two files though.

Note: I did not code any guard to only do this action if the file name was 
"file1". So you could pass any number of files to it, and it would iterate on 
each of them in similar fashion.

PS. Not sure that this is of any help to you as I ended up having two files. 
But at least it may illustrate some more power in Perl.

--
Mike Arms
ma...@sandia.gov


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


Re: Win32::MMF help needed

2012-05-04 Thread bulk 88

After an IRC chat with haratron I made this sample code of how to use 
Win32::MMF raw C style. Without the proprietary Storeable cough cough RPC layer 
that doesn't let you normally use Win32::MMF for non Perl to Perl IPC 
communications. The 2 scripts must be in the same folder for them to work. 
Watch out for buffer overflows, I ALMOST have one in this line 
"$function->Call($ptr, ("hello MMF".("\x00" x 256)), 256);".
mmfwrite.pl
__
use strict;
use Win32::MMF qw/ MapViewOfFile CreateFileMapping CloseHandle UnmapViewOfFile 
/;
use Win32;
use Win32::API;

*GetLastError = *Win32::GetLastError;
our $hnd = CreateFileMapping(undef, 256, 'MyFileMappingObject');
if( !$hnd ) { die "CFM failed  GLR=".GetLastError()."\n";}
our $ptr = MapViewOfFile($hnd, 0,256);
if( !$ptr ) { die "MVOF failed  GLR=".GetLastError()."\n";}


my $function = Win32::API->new(
  'kernel32.dll', 'VOID RtlMoveMemory( DWORD Destination, LPSTR Source, 
SIZE_T Length)',
);

$function->Call($ptr, ("hello MMF".("\x00" x 256)), 256);

system($^X." mmfread.pl ");
END{
    if($ptr) {UnmapViewOfFile($ptr);}
    if($hnd) {CloseHandle($hnd);}
}

___
mmfread.pl
___
use strict;
use Win32::MMF qw/ MapViewOfFile CreateFileMapping CloseHandle UnmapViewOfFile 
/;
use Win32;
use Data::Dumper 'Dumper';

*GetLastError = *Win32::GetLastError;
our $hnd = CreateFileMapping(undef, 256, 'MyFileMappingObject');
if( !$hnd ) { die "CFM failed  GLR=".GetLastError()."\n";}
our $ptr = MapViewOfFile($hnd, 0,256);
if( !$ptr ) { die "MVOF failed  GLR=".GetLastError()."\n";}

my $memblock = unpack('P[256]', pack('J', $ptr));
print "In mmfread.pl\n";
print Dumper($memblock);
print "end of mmfread.pl\n";
END{
    if($ptr) {UnmapViewOfFile($ptr);}
    if($hnd) {CloseHandle($hnd);}
}

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


Re: Win32::OLE events callback not executed

2012-04-12 Thread haratron
I'm willing to pay anyone that can make this work.
If anyone is interested, send me a personal email.

Thanks

On Sun, Mar 25, 2012 at 12:52 AM, haratron  wrote:
> I'm so desperate about this. Could anyone at least point in the right
> direction? Is WithEvents broken?
> There's the pyTTS module in Python that succeeds in firing the events.
> Yet I can't figure out how to port it.
>
> On Mon, Mar 19, 2012 at 9:46 PM, Howard Tanner  wrote:
>> Thanks anyway Jan.
>>
>> -Original Message-
>> From: perl-win32-users-boun...@listserv.activestate.com
>> [mailto:perl-win32-users-boun...@listserv.activestate.com] On Behalf Of Jan
>> Dubois
>> Sent: Monday, March 19, 2012 3:45 PM
>> To: 'Howard Tanner'; 'haratron'
>> Cc: perl-win32-users@listserv.activestate.com
>> Subject: RE: Win32::OLE events callback not executed
>>
>> On Mon, 19 Mar 2012, Howard Tanner wrote:
>>>
>>> I couldn't get any events to be fired either. Perhaps Jan can weigh in
>>> since he seems to be around today.
>>
>> Sorry, I don't know _why_ it isn't working, but I've seen others run into
>> the same problem with SAPI.  Unfortunately I don't have time to play with
>> SAPI stuff myself, so I won't be able to help much.
>>
>> Cheers,
>> -Jan
>>
>>
>> ___
>> Perl-Win32-Users mailing list
>> Perl-Win32-Users@listserv.ActiveState.com
>> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
>>
___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: Win32::OLE events callback not executed

2012-03-24 Thread haratron
I'm so desperate about this. Could anyone at least point in the right
direction? Is WithEvents broken?
There's the pyTTS module in Python that succeeds in firing the events.
Yet I can't figure out how to port it.

On Mon, Mar 19, 2012 at 9:46 PM, Howard Tanner  wrote:
> Thanks anyway Jan.
>
> -Original Message-
> From: perl-win32-users-boun...@listserv.activestate.com
> [mailto:perl-win32-users-boun...@listserv.activestate.com] On Behalf Of Jan
> Dubois
> Sent: Monday, March 19, 2012 3:45 PM
> To: 'Howard Tanner'; 'haratron'
> Cc: perl-win32-users@listserv.activestate.com
> Subject: RE: Win32::OLE events callback not executed
>
> On Mon, 19 Mar 2012, Howard Tanner wrote:
>>
>> I couldn't get any events to be fired either. Perhaps Jan can weigh in
>> since he seems to be around today.
>
> Sorry, I don't know _why_ it isn't working, but I've seen others run into
> the same problem with SAPI.  Unfortunately I don't have time to play with
> SAPI stuff myself, so I won't be able to help much.
>
> Cheers,
> -Jan
>
>
> ___
> Perl-Win32-Users mailing list
> Perl-Win32-Users@listserv.ActiveState.com
> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
>
___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: Win32::OLE events callback not executed

2012-03-19 Thread Jan Dubois
On Mon, 19 Mar 2012, Howard Tanner wrote:
> 
> I couldn't get any events to be fired either. Perhaps Jan can weigh in since
> he seems to be around today.

Sorry, I don't know _why_ it isn't working, but I've seen
others run into the same problem with SAPI.  Unfortunately
I don't have time to play with SAPI stuff myself, so I
won't be able to help much.

Cheers,
-Jan


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


RE: Win32::OLE events callback not executed

2012-03-19 Thread Howard Tanner
I couldn't get any events to be fired either. Perhaps Jan can weigh in since
he seems to be around today.

Here's my test code:

use strict;
use Win32::OLE qw(EVENTS);

my $vox = Win32::OLE->new ('SAPI.SpVoice')
  || die "Unable to create SAPI object\n";

sub Event {
  my ($Obj, $Event, @Args) = @_;
  print "Event: $Event\n";
}

Win32::OLE->WithEvents ($vox, \&Event);
$vox->{'EventInterests'} = 32; #Fire only new word events

my $text = "This is the Microsoft Speech Library.";

$vox->Speak ($text, 1); #Read text asynchronously

Win32::OLE->MessageLoop ();

-Original Message-
From: perl-win32-users-boun...@listserv.activestate.com
[mailto:perl-win32-users-boun...@listserv.activestate.com] On Behalf Of
haratron
Sent: Monday, March 19, 2012 1:54 PM
To: Howard Tanner
Cc: perl-win32-users@listserv.activestate.com
Subject: Re: Win32::OLE events callback not executed

Thanks for the answer.

I've also found these links that can help maybe:
http://code.activestate.com/lists/activeperl/13161/  <-- tried it, callback
still doesn't get executed
http://www.perlmonks.org/?node_id=429272 <-- tried it, doesn't work

I'm finding it difficult to translate that VB code to Perl.
If anyone can help, much appreciated.


On Mon, Mar 19, 2012 at 7:01 PM, Howard Tanner  wrote:
> From: perl-win32-users-boun...@listserv.activestate.com
> [mailto:perl-win32-users-boun...@listserv.activestate.com] On Behalf 
> Of haratron
> Sent: Monday, March 19, 2012 11:21 AM
> To: perl-win32-users@listserv.ActiveState.com
> Subject: Win32::OLE events callback not executed
>
> Hello,
>
> I want to implement "karaoke" functionality on my TTS (text to speech) 
> editor. Meaning that I want to highlight words the moment they are 
> spoken by the TTS system.
>
> I read that I need to watch for the onWord event.
>
> I have the same problem with this person:
> http://www.mail-archive.com/perl-win32-users@listserv.activestate.com/
> msg275
> 30.html
>
> The callback never gets executed.
>
> How can I fix this?
>
> Thank you,
> haratron
> ___
>
> Here's the dox from M$ on the Word event:
>
> http://msdn.microsoft.com/en-us/library/ms723593(v=vs.85).aspx
>
> It includes a VB example that does exactly what you want. Perhaps 
> someone here better at Perl than me can help you translate it.
>
> I don't know where Mr. "James Brown" got his ordinal from, but I 
> suspect the number "32", if that's correct at all, will be O/S version 
> dependent, since different versions of Windows have slightly different
versions of SAPI.
> Perhaps there's a better way in Perl to trap the Word event than using 
> the ordinal. And note that the event is Word, not onWord.
>
___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

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


Re: Win32::OLE events callback not executed

2012-03-19 Thread haratron
Thanks for the answer.

I've also found these links that can help maybe:
http://code.activestate.com/lists/activeperl/13161/  <-- tried it,
callback still doesn't get executed
http://www.perlmonks.org/?node_id=429272 <-- tried it, doesn't work

I'm finding it difficult to translate that VB code to Perl.
If anyone can help, much appreciated.


On Mon, Mar 19, 2012 at 7:01 PM, Howard Tanner  wrote:
> From: perl-win32-users-boun...@listserv.activestate.com
> [mailto:perl-win32-users-boun...@listserv.activestate.com] On Behalf Of
> haratron
> Sent: Monday, March 19, 2012 11:21 AM
> To: perl-win32-users@listserv.ActiveState.com
> Subject: Win32::OLE events callback not executed
>
> Hello,
>
> I want to implement "karaoke" functionality on my TTS (text to speech)
> editor. Meaning that I want to highlight words the moment they are spoken by
> the TTS system.
>
> I read that I need to watch for the onWord event.
>
> I have the same problem with this person:
> http://www.mail-archive.com/perl-win32-users@listserv.activestate.com/msg275
> 30.html
>
> The callback never gets executed.
>
> How can I fix this?
>
> Thank you,
> haratron
> ___
>
> Here's the dox from M$ on the Word event:
>
> http://msdn.microsoft.com/en-us/library/ms723593(v=vs.85).aspx
>
> It includes a VB example that does exactly what you want. Perhaps someone
> here better at Perl than me can help you translate it.
>
> I don't know where Mr. "James Brown" got his ordinal from, but I suspect the
> number "32", if that's correct at all, will be O/S version dependent, since
> different versions of Windows have slightly different versions of SAPI.
> Perhaps there's a better way in Perl to trap the Word event than using the
> ordinal. And note that the event is Word, not onWord.
>
___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: Win32::OLE events callback not executed

2012-03-19 Thread Howard Tanner
From: perl-win32-users-boun...@listserv.activestate.com
[mailto:perl-win32-users-boun...@listserv.activestate.com] On Behalf Of
haratron
Sent: Monday, March 19, 2012 11:21 AM
To: perl-win32-users@listserv.ActiveState.com
Subject: Win32::OLE events callback not executed

Hello,

I want to implement "karaoke" functionality on my TTS (text to speech)
editor. Meaning that I want to highlight words the moment they are spoken by
the TTS system.

I read that I need to watch for the onWord event.

I have the same problem with this person:
http://www.mail-archive.com/perl-win32-users@listserv.activestate.com/msg275
30.html

The callback never gets executed.

How can I fix this?

Thank you,
haratron
___

Here's the dox from M$ on the Word event:

http://msdn.microsoft.com/en-us/library/ms723593(v=vs.85).aspx

It includes a VB example that does exactly what you want. Perhaps someone
here better at Perl than me can help you translate it.

I don't know where Mr. "James Brown" got his ordinal from, but I suspect the
number "32", if that's correct at all, will be O/S version dependent, since
different versions of Windows have slightly different versions of SAPI.
Perhaps there's a better way in Perl to trap the Word event than using the
ordinal. And note that the event is Word, not onWord.

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


RE: Win32::GUI, minimize, and window resize

2011-12-16 Thread Ken Cornetet
For future googlers, the answer to the problem is get rid of the $mw->Show() 
call in the resize routine.

Ken Cornetet 812.482.8499
To err is human - to moo, bovine.

From: Ken Cornetet
Sent: Thursday, December 15, 2011 10:02 AM
To: perl-win32-users@listserv.activestate.com
Subject: Win32::GUI, minimize, and window resize

Here's an odd problem.

I've written a win32::GUI application, but it will not maximize or minimize. 
When I try, I see the window sort of blink, and I can see that the "resize" sub 
has been called. If I comment out the Main_Resize sub, the program maximizes 
and minimizes as expected.

Any ideas?

Here's the applicable bits of code:

my $menu = Win32::GUI::Menu->new(
'&File' => 'menuUP',
' > E&xit'   => 'menuExit',
'&Control'   => 'menuControl',
' > &Up' => 'menuUp',
'&Help' => 
'menuHelp',
' > &Help'   => 'menuHelp',
);

my $mw = Win32::GUI::Window->new( -name => 'Main', -menu => $menu, -text => 
"Xen Mon", -size => [ 900, 900 ], -pos => [ 200, 200 ] );
my $sb = $mw->AddStatusBar();

my $lv = $mw->AddListView(-pos => [ 0, 0 ], -width => $mw->ScaleWidth(), 
-height => $mw->ScaleHeight(), -hscroll => 1, -vscroll => 1);

$lv->InsertColumn( -item => 0, -text => "SILO/SERVER",  -width => 120, -align 
=>'left');
$lv->InsertColumn( -item => 1, -text => "USERS",-width => 50, -align 
=>'right');
$lv->InsertColumn( -item => 2, -text => "SESS/DISC",-width => 75, -align 
=>'right');
$lv->InsertColumn( -item => 3, -text => "MEM/TOT",  -width => 75, -align 
=>'right');
$lv->InsertColumn( -item => 4, -text => "UP",   -width => 60, -align 
=>'right');
$lv->InsertColumn( -item => 5, -text => 'LOAD%',-width => 50, -align 
=>'right');
$lv->InsertColumn( -item => 6, -text => 'CPU%', -width => 50, -align 
=>'right');
$lv->InsertColumn( -item => 7, -text => "", -width => 300, -align 
=>'left');

$lv->Hook(NM_CUSTOMDRAW, \&lv_CustomDraw);

sub Main_Resize {

print "*** resize ***\n";
$sb->Move(0, $mw->ScaleHeight - $sb->Height);
$sb->Resize($mw->ScaleWidth, $sb->Height);

$lv->Resize($mw->ScaleWidth, $mw->ScaleHeight - $sb->Height - 
$menu->Height);

$mw->Show;

return 1;
}



Ken Cornetet 812.482.8499
To err is human - to moo, bovine.

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


Re: Win32::GUI, WMI, and threads

2011-10-27 Thread Jonathan Epstein
I'd try putting all the Win32::OLE stuff into its own (single) thread, 
separate from the GUI thread.  Some creative use of variables (and e.g. 
a Tk Progress bar) can allow you to provide a GUI which indicates how 
long you've been waiting for a WMI call to respond.


HTH,

Jonathan


On 10/27/2011 5:24 PM, Ken Cornetet wrote:


I am writing a Win32::GUI app to monitor a Citrix farm of servers and 
I’ve got things going pretty well. The problem is that I make a lot of 
WMI calls (via Win32::OLE) and they can take anywhere from a second to 
a couple of minutes to complete. This prevents the GUI code from doing 
its normal event loop processing and results in a non-responsive 
windows interface.


I’m thinking that threads are the answer, but any time I’ve mixed 
threads and Win32::OLE, the results have been less than satisfactory. 
Does anyone know how to make Win32::OLE (WMI specifically) and threads 
work together?


Or, is there any way to do async WMI calls?

Ken Cornetet 812.482.8499

To err is human - to moo, bovine.

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


Re: Win32::OLE

2011-06-29 Thread John Harrington
Hi Leo,

Yes, it turns out the security setting is the issue.  On machines where this
didn't work, the security settings were different than on the machines where
it did work.  Thank you very much for your help with this puzzling issue.
 It is very much appreciated.

For any other users who may find this thread on Google, it was necessary to
modify the Access security settings to get automation to run.

To do that in Access 2007:

1. Open Access.
2. Click the "Office button" (the circle in the extreme upper right).
3. Select the "Access Options..." button.
4. On the "Access Options" dialog, click "Trust Center".
5. Click "Trust Center Settings...".
6. On the "Trust Center" dialog, click "Macro Settings".
7. Select "Enable all macros" (last option).


Best regards,
John

On Wed, Jun 29, 2011 at 11:06 AM, Leo Susanto  wrote:

> Try this:
> http://stackoverflow.com/questions/837754/call-routine-in-access-module-from-net
>
> On Wed, Jun 29, 2011 at 10:19 AM, John Harrington 
> wrote:
> > Hi Leo,
> > Thanks for this.
> > I tried this script on one of the machines that wasn't working yesterday
> and
> > received only this error:
> >  Last OLE32 error: Win32::OLE(0.1709) error 0x800a9d9f in
> > METHOD/PROPERTYGET "Run"
> > Any suggestions?
> > So far I've tried automation on four separate machines:
> > All with Access 2007 12.0.6535.5005  SP2 MSO 12.0.6554.5001
> > OS   bits  Perl version  Works?
> > XP   32 5.10.1 yes
> > XP   32 5.12.4 no
> > W7   64 5.12.4 yes
> > W7?  64?5.10.1no
> > I believe OS, bits, Perl version, and Access version can be ruled out as
> the
> > explanation.
> > Thank you again,
> > John
> >
> > On Tue, Jun 28, 2011 at 5:35 PM, Leo Susanto 
> wrote:
> >>
> >> Thank, so Access 2007 is installed in all of the machine
> >>
> >> Could you please run this and see if there is any error?
> >>
> >> use strict;
> >> use warnings;
> >> use Win32::OLE;
> >> my $oAccess;
> >> eval {$oAccess = Win32::OLE->GetActiveObject("Access.Application")};
> >> if ($@) {
> >>die "Access.Application is not installed\n";
> >> }
> >> unless (defined $oAccess) {
> >>unless ($oAccess = Win32::OLE->new("Access.Application", sub
> >> {$_[0]->Quit;})) {
> >>die "Can not start Access.Application\n";
> >>}
> >> }
> >>
> >>
> $oAccess->OpenCurrentDatabase("C:\\vpdb\\depot\\VProject\\Database\\xdb.accdb");
> >> print "Last OLE32 error: ". Win32::OLE->LastError() if
> >> (Win32::OLE->LastError());
> >> $oAccess->Run("AutomationTest");
> >> print "Last OLE32 error: ". Win32::OLE->LastError() if
> >> (Win32::OLE->LastError());
> >>
> >> On Tue, Jun 28, 2011 at 4:36 PM, John Harrington 
> >> wrote:
> >> > I have a very simple script using Win32::OLE that works perfectly on
> my
> >> > machine but not on other people's machines and I can't figure out why.
> >> > The script is as follows:
> >> >
> >> > use strict;
> >> > use warnings;
> >> > use Win32::OLE;
> >> > my $oAccess;
> >> > $oAccess = Win32::OLE->new('Access.Application') or die "Unable to
> start
> >> > Access";
> >> >
> >> >
> $oAccess->OpenCurrentDatabase("C:\\vpdb\\depot\\VProject\\Database\\xdb.accdb");
> >> > $oAccess->Run("AutomationTest")
> >> >
> >> > When I run it on my machine, it successfully runs a Public Function
> >> > called
> >> > AutomationTest in my database.  This function writes two files to the
> >> > cwd, a
> >> > text file and a simple Excel spreadsheet.
> >> > When I run this script on other people's machines, the script executes
> >> > (same
> >> > OS, same version of ActiveState Perl (5.10.1), same database, same
> >> > permissions) but the files are not written, which suggests the
> >> > automation is
> >> > not working.  No errors are generated.  The script runs, but there are
> >> > no
> >> > files produced.
> >> > Again, it works on my machine, not on theirs, with apparently the very
> >> > same
> >> > conditions.  I even tried sharing my Perl folder so another user could
> >> > be
> >> > assured he was running the same version of the module and Perl.
> >> > I am at my wit's end.  Any help would be appreciated.
> >> > Can you think of any reason such a simple application of the
> Win32::OLE
> >> > module would work on one machine and not on another?
> >> >
> >> > Thanks,
> >> > John
> >> >
> >> >
> >> >
> >> >
> >> > ___
> >> > Perl-Win32-Users mailing list
> >> > Perl-Win32-Users@listserv.ActiveState.com
> >> > To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
> >> >
> >> >
> >
> >
>
___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: Win32::OLE

2011-06-29 Thread Leo Susanto
Try this: 
http://stackoverflow.com/questions/837754/call-routine-in-access-module-from-net

On Wed, Jun 29, 2011 at 10:19 AM, John Harrington  wrote:
> Hi Leo,
> Thanks for this.
> I tried this script on one of the machines that wasn't working yesterday and
> received only this error:
>      Last OLE32 error: Win32::OLE(0.1709) error 0x800a9d9f in
> METHOD/PROPERTYGET "Run"
> Any suggestions?
> So far I've tried automation on four separate machines:
> All with Access 2007 12.0.6535.5005  SP2 MSO 12.0.6554.5001
> OS   bits  Perl version  Works?
> XP   32     5.10.1         yes
> XP   32     5.12.4         no
> W7   64     5.12.4         yes
> W7?  64?    5.10.1        no
> I believe OS, bits, Perl version, and Access version can be ruled out as the
> explanation.
> Thank you again,
> John
>
> On Tue, Jun 28, 2011 at 5:35 PM, Leo Susanto  wrote:
>>
>> Thank, so Access 2007 is installed in all of the machine
>>
>> Could you please run this and see if there is any error?
>>
>> use strict;
>> use warnings;
>> use Win32::OLE;
>> my $oAccess;
>> eval {$oAccess = Win32::OLE->GetActiveObject("Access.Application")};
>> if ($@) {
>>        die "Access.Application is not installed\n";
>> }
>> unless (defined $oAccess) {
>>        unless ($oAccess = Win32::OLE->new("Access.Application", sub
>> {$_[0]->Quit;})) {
>>                die "Can not start Access.Application\n";
>>        }
>> }
>>
>> $oAccess->OpenCurrentDatabase("C:\\vpdb\\depot\\VProject\\Database\\xdb.accdb");
>> print "Last OLE32 error: ". Win32::OLE->LastError() if
>> (Win32::OLE->LastError());
>> $oAccess->Run("AutomationTest");
>> print "Last OLE32 error: ". Win32::OLE->LastError() if
>> (Win32::OLE->LastError());
>>
>> On Tue, Jun 28, 2011 at 4:36 PM, John Harrington 
>> wrote:
>> > I have a very simple script using Win32::OLE that works perfectly on my
>> > machine but not on other people's machines and I can't figure out why.
>> > The script is as follows:
>> >
>> > use strict;
>> > use warnings;
>> > use Win32::OLE;
>> > my $oAccess;
>> > $oAccess = Win32::OLE->new('Access.Application') or die "Unable to start
>> > Access";
>> >
>> > $oAccess->OpenCurrentDatabase("C:\\vpdb\\depot\\VProject\\Database\\xdb.accdb");
>> > $oAccess->Run("AutomationTest")
>> >
>> > When I run it on my machine, it successfully runs a Public Function
>> > called
>> > AutomationTest in my database.  This function writes two files to the
>> > cwd, a
>> > text file and a simple Excel spreadsheet.
>> > When I run this script on other people's machines, the script executes
>> > (same
>> > OS, same version of ActiveState Perl (5.10.1), same database, same
>> > permissions) but the files are not written, which suggests the
>> > automation is
>> > not working.  No errors are generated.  The script runs, but there are
>> > no
>> > files produced.
>> > Again, it works on my machine, not on theirs, with apparently the very
>> > same
>> > conditions.  I even tried sharing my Perl folder so another user could
>> > be
>> > assured he was running the same version of the module and Perl.
>> > I am at my wit's end.  Any help would be appreciated.
>> > Can you think of any reason such a simple application of the Win32::OLE
>> > module would work on one machine and not on another?
>> >
>> > Thanks,
>> > John
>> >
>> >
>> >
>> >
>> > ___
>> > Perl-Win32-Users mailing list
>> > Perl-Win32-Users@listserv.ActiveState.com
>> > To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
>> >
>> >
>
>
___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: Win32::OLE

2011-06-28 Thread Leo Susanto
Thank, so Access 2007 is installed in all of the machine

Could you please run this and see if there is any error?

use strict;
use warnings;
use Win32::OLE;
my $oAccess;
eval {$oAccess = Win32::OLE->GetActiveObject("Access.Application")};
if ($@) {
die "Access.Application is not installed\n";
}
unless (defined $oAccess) {
unless ($oAccess = Win32::OLE->new("Access.Application", sub
{$_[0]->Quit;})) {
die "Can not start Access.Application\n";
}
}
$oAccess->OpenCurrentDatabase("C:\\vpdb\\depot\\VProject\\Database\\xdb.accdb");
print "Last OLE32 error: ". Win32::OLE->LastError() if
(Win32::OLE->LastError());
$oAccess->Run("AutomationTest");
print "Last OLE32 error: ". Win32::OLE->LastError() if
(Win32::OLE->LastError());

On Tue, Jun 28, 2011 at 4:36 PM, John Harrington  wrote:
> I have a very simple script using Win32::OLE that works perfectly on my
> machine but not on other people's machines and I can't figure out why.
> The script is as follows:
>
> use strict;
> use warnings;
> use Win32::OLE;
> my $oAccess;
> $oAccess = Win32::OLE->new('Access.Application') or die "Unable to start
> Access";
> $oAccess->OpenCurrentDatabase("C:\\vpdb\\depot\\VProject\\Database\\xdb.accdb");
> $oAccess->Run("AutomationTest")
>
> When I run it on my machine, it successfully runs a Public Function called
> AutomationTest in my database.  This function writes two files to the cwd, a
> text file and a simple Excel spreadsheet.
> When I run this script on other people's machines, the script executes (same
> OS, same version of ActiveState Perl (5.10.1), same database, same
> permissions) but the files are not written, which suggests the automation is
> not working.  No errors are generated.  The script runs, but there are no
> files produced.
> Again, it works on my machine, not on theirs, with apparently the very same
> conditions.  I even tried sharing my Perl folder so another user could be
> assured he was running the same version of the module and Perl.
> I am at my wit's end.  Any help would be appreciated.
> Can you think of any reason such a simple application of the Win32::OLE
> module would work on one machine and not on another?
>
> Thanks,
> John
>
>
>
>
> ___
> Perl-Win32-Users mailing list
> Perl-Win32-Users@listserv.ActiveState.com
> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
>
>
___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: Win32 modules crash over the network

2010-11-08 Thread Sisyphus

- Original Message - 
From: "Charles Manafa"
Subject: Win32 modules crash over the network


Folks, I seem to be having difficulties loading any Win32 module, when Perl 
is executed from a remote server. I basically copied a working local Perl 
installation to a server, so it can be run from any machine.

Other modules load fine, but Win32 modules seem to crash. The client PCs are 
XP running SP3.

Any assistance will be greatly appreciated.

===

Do you get any meaningful error messages anywhere ?

Of the non-Win32 modules that you've tried loading, have they all been 
pure-perl ? If so, try loading an extension  - eg Devel::Peek (which uses 
XSLoader) and Digest::SHA (which uses DynaLoader).

Can't really think of any reason that Win32 modules should be the only ones 
affected. Perhaps they all rely on some  particular Windows dll(s) that none 
of the other modules need, and that there's some problem relating to the 
"particular Windows dll(s)"  but nothing specific comes to mind.

Cheers,
Rob 

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


RE: Win32::Pipe::CallNamedPipe does this function normally work?

2010-10-20 Thread Jan Dubois
The version of Win32::Pipe on CPAN (and in ActivePerl) may be a different 
version than the one mentioned on Dave’s website.  You
should check out the sample program included in Win32-Pipe to see how it works:

 

http://cpansearch.perl.org/src/JDB/Win32-Pipe-0.024/eg/

 

Cheers,

-Jan

 

 

From: perl-win32-users-boun...@listserv.activestate.com 
[mailto:perl-win32-users-boun...@listserv.activestate.com] On Behalf Of Greg
Aiken
Sent: Wednesday, October 20, 2010 1:50 PM
To: perl-win32-users@listserv.activestate.com
Subject: Win32::Pipe::CallNamedPipe does this function normally work?

 

when I run this simple client program

 

use strict;

use warnings;

use Win32::Pipe;

my $Data;

Win32::Pipe::CallNamedPipe(".\\Pipe\\EPICIPCDPLX 
 ", "3", $Data);

print "data read from epic = $Data\n";

 

I get this error;

 

Can't locate auto/Win32/Pipe/CallNamedPi.al in @INC (@INC contains: C:/Perl/site

/lib C:/Perl/lib .) at C:\perlsrc\pipe\epic_item_import2.pl line 5

 

the online documentation 

http://www.roth.net/perl/pipe/#new() 

says;

 


CallNamedPipe( $PipeName, $SendData, $RecieveData [, $TimeOut ] )


This function will connect to the specified named pipe ($PipeName) then it will 
send the the specified data ($TimeOut parameter is a
value in milliseconds indicating how long the function waits to connect, to 
send and to recieve data.

NOTE:
This is not an object method. It can only be used as a function call as in:
Win32::Pipe::CallNamedPipe( "server\\pipe\\My Named Pipe 
 ", "Test Data", $Data ); 

NOTE 2:
The third parameter must be a scalar variable, not a reference nor a constant.

Returns TRUE (1) if successful and FALSE (0) if it fails. 

but if I search Win32::Pipe.pm for ‘Callnamedpipe’ the string is not found 
anywhere in the c:\perl\site\lib\win32\pipe.pm file!

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


RE: Win32::OLE on MS Word using Selection.Find.Execute

2010-09-13 Thread Jan Dubois
On Sun, 12 Sep 2010, Peter Buck wrote:
> 
> Does anyone have an example of a perl script acting on MS Word
> documents using Win32::OLE and Selection.Find.Execute?

Actually, I do, and it is even part of the Win32::OLE module
distribution on CPAN.  But since it is not being installed
with the actual module itself it is somewhat hard to find:

http://cpansearch.perl.org/src/JDB/Win32-OLE-0.1709/eg/word2pod.pl

The script takes a Word document and tries to convert it
to POD.

Cheers,
-Jan

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


Re: Win32::OLE on MS Word using Selection.Find.Execute

2010-09-13 Thread Mark Leighton
Peter,

OLE needs Variant values.  Perl and the OLE modules will convert most of 
these on he fly for you, but sometimes I find I have a need to convert 
booleans explicitly.

my $false = Win32::OLE::Variant->new(VT_VARIANT, 0);
my $true = Win32::OLE::Variant->new(VT_VARIANT, 1);

Mark

On 9/12/2010 4:43 PM, Peter Buck wrote:
>Does anyone have an example of a perl script acting on MS Word
> documents using Win32::OLE and Selection.Find.Execute?  I have read the
> Win32 man page but its examples for Excel and Access don't help.  I
> found a Powershell script that does what I want but can't translate.
> The parts I'm confused on are (1) setting the parameters used in the
> Selection.Find.Execute() invocation (particularly the boolean values,
> since perl doesn't do booleans) and the actual invocation of
> Selection.Find.Execute().
>
> I did find an example using $search->  Execute() but this doesn't appear
> to allow setting all the parameters that Selection.Find.Execute() does.
> Also, it operates on $doc->  Content->Find while Selection.Find.Execute()
> operates on $doc->Selection (if I'm right).  And I'm using Homekey(6) to
> take me to the top of the document, which is linked to Selection and
> doesn't seem to work in my $doc->Content->Find attempts.
>
> Any help or direction to documentation much appreciated.
>
> Thanks - Toolsmith
>
> # ExpandAcronyms.ps1
> # read acronym list, expand acronyms in target MS Word document
> # syntax: ExpandAcronyms wordDocument
>
> function make-change {
>   $FindText = $args[0]
>   $FullText = $args[1]
>   $ReplaceText = "$FullText ($FindText)"
>
>   $ReplaceAll = 1
>   $FindContinue = 1
>   $MatchCase = $True
>   $MatchWholeWord = $True
>   $MatchWildcards = $False
>   $MatchSoundsLike = $False
>   $MatchAllWordForms = $False
>   $Forward = $True
>   $Wrap = $FindContinue# don't want it wrapping, wish I knew
> what this meant
>   $Format = $False
>
>   $objWord.Selection.HomeKey(6)>  Null
>   $result = $objSelection.Find.Execute($FindText,$MatchCase,
>   $MatchWholeWord,$MatchWildcards,$MatchSoundsLike,
>   $MatchAllWordForms,$Forward,$Wrap,$Format,
>   $ReplaceText,$ReplaceAll)
>if ( $result -eq $true ) {
>"$Findtext|$FullText"
>   }
>
> }
>
> if ( $args.count -lt 1 ) {
>   cd $env:temp
>   $strWordFile = [string](resolve-path(Read-Host "Enter Path of Word
> file to be processed"))
> } else {
>   $strWordFile = [string](resolve-path($args[0]))
> }
>
>
> $objWord = New-Object -ComObject word.application
> $objWord.Visible = $True
> $objDoc = $objWord.Documents.Open($strWordFile)
>
> $objSelection = $objWord.Selection
>
> $d = get-content "d:/temp/acronyms.txt"# read file of acronym |
> definition
> foreach ( $l in $d ) {
>   ($acro, $def) = $l.split('|')# build array
> of acronym, definition
>   make-change $acro $def
> }
> "Finished"
> $objWord.Selection.HomeKey(6)>  Null
> ___
> Perl-Win32-Users mailing list
> Perl-Win32-Users@listserv.ActiveState.com
> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: Win32::OLE on MS Word using Selection.Find.Execute

2010-09-13 Thread Brian Raven
Peter Buck <> wrote:
>   Does anyone have an example of a perl script acting on MS Word
> documents using Win32::OLE and Selection.Find.Execute?  I have read
> the  
> Win32 man page but its examples for Excel and Access don't help.  I
> found a Powershell script that does what I want but can't translate.
> The parts I'm confused on are (1) setting the parameters used in the
> Selection.Find.Execute() invocation (particularly the boolean values,
> since perl doesn't do booleans) and the actual invocation of
> Selection.Find.Execute().  
> 
> I did find an example using $search-> Execute() but this doesn't
> appear to allow setting all the parameters that
> Selection.Find.Execute() does.  
> Also, it operates on $doc-> Content->Find while
> Selection.Find.Execute() operates on $doc->Selection (if I'm right). 
> And I'm using Homekey(6) to take me to the top of the document, which
> is linked to Selection and doesn't seem to work in my
> $doc->Content->Find attempts.
> 
> Any help or direction to documentation much appreciated.

The primary documentation for OLE apps is the Visual Basic Reference.
The OLE browser supplied with Activestate Perl is also very useful, I
find. Other than that, googling for examples can be useful, followed by
an amount of trial and error. The amount of trial and error needed will
depend on how closely the results of your googling match what you are
trying to do.

> 
> Thanks - Toolsmith
> 
> # ExpandAcronyms.ps1
> # read acronym list, expand acronyms in target MS Word document #
> syntax: ExpandAcronyms wordDocument 
> 
> function make-change {
>  $FindText = $args[0]
>  $FullText = $args[1]
>  $ReplaceText = "$FullText ($FindText)"
> 
>  $ReplaceAll = 1
>  $FindContinue = 1
>  $MatchCase = $True
>  $MatchWholeWord = $True
>  $MatchWildcards = $False
>  $MatchSoundsLike = $False
>  $MatchAllWordForms = $False
>  $Forward = $True
>  $Wrap = $FindContinue# don't want it wrapping, wish I
> knew 
> what this meant
>  $Format = $False
> 
>  $objWord.Selection.HomeKey(6) > Null
>  $result = $objSelection.Find.Execute($FindText,$MatchCase,
>  $MatchWholeWord,$MatchWildcards,$MatchSoundsLike,
>  $MatchAllWordForms,$Forward,$Wrap,$Format,
>  $ReplaceText,$ReplaceAll)
>   if ( $result -eq $true ) {
>   "$Findtext|$FullText"
>  }
> 
> }
> 
> if ( $args.count -lt 1 ) {
>  cd $env:temp
>  $strWordFile = [string](resolve-path(Read-Host "Enter Path of
>  Word file to be processed")) } else { $strWordFile =
> [string](resolve-path($args[0])) } 
> 
> 
> $objWord = New-Object -ComObject word.application
> $objWord.Visible = $True
> $objDoc = $objWord.Documents.Open($strWordFile)
> 
> $objSelection = $objWord.Selection
> 
> $d = get-content "d:/temp/acronyms.txt"# read file of acronym
> | 
> definition
> foreach ( $l in $d ) {
>  ($acro, $def) = $l.split('|')# build
> array 
> of acronym, definition
>  make-change $acro $def
> }
> "Finished"
> $objWord.Selection.HomeKey(6) > Null

That looks like shell script rather than Perl (Powershell perhaps?).
Your Perl code would have been more useful.

HTH

-- 
Brian Raven 
 
Please consider the environment before printing this e-mail.

This e-mail may contain confidential and/or privileged information. If you are 
not the intended recipient or have received this e-mail in error, please advise 
the sender immediately by reply e-mail and delete this message and any 
attachments without retaining a copy.

Any unauthorised copying, disclosure or distribution of the material in this 
e-mail is strictly forbidden.
___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: WIN32::OLE WMI Out params

2009-12-05 Thread Michael
On Sat, 05 Dec 2009 05:58:48 -0800, Michael Ellery
 wrote:
> Michael wrote:
>> On Fri, 04 Dec 2009 17:10:26 -0800, Michael Ellery
>>  wrote:
>>> Michael wrote:
 Okay - Just to sum up the whole thing.

 The original VBScript <>>>
 Option Explicit

 Dim objWMIService, objOV_NodeGroup, objGetRoot, objChildGroups,
>> arrNodes,
 objItem

 Set objWMIService =
 GetObject("winmgmts:root\HewlettPackard\OpenView\data")

 Set objOV_NodeGroup = objWMIService.Get("OV_NodeGroup")
 Set objGetRoot = objOV_NodeGroup.GetRoot()
 objChildGroups = objGetRoot.GetChildNodeGroups(arrNodes, True)

 WScript.Echo "Child Group Count: " & objChildGroups & vbCrLF

 For Each objItem In arrNodes
   WScript.Echo "Name: " & objItem.Name
 Next
 EOF

 Returns the following:

 Child Group Count: 25

 Name: {36716FD8-E600-46FB-90CA-1263E0C62509}
 Name: {38FF8E8E-2DDC-4895-A7EB-0DC7DF50EC25}
 Name: {3E575181-0225-4553-9722-46F841B9FA76}
 Name: {8A412133-F571-42BC-8A66-4B242EB3BAC4}
 Name: {E14D965C-1FBB-40EC-A784-5F9F39F82281}
 Name: OpenView_AIX
 Name: OpenView_External
 Name: OpenView_HPUX
 Name: OpenView_Linux
 Name: OpenView_NNM
 Name: OpenView_OpenVMS
 Name: OpenView_OpenVMS(itanium)
 Name: OpenView_SNMP
 Name: OpenView_Solaris
 Name: OpenView_Tru64
 Name: OpenView_Unknown
 Name: OpenView_Windows2000
 Name: OpenView_WindowsNT
 Name: OpenView_WindowsServer2003
 Name: OpenView_WindowsServer2008
 Name: OpenView_WindowsVista
 Name: OpenView_WindowsXP
 Name: Root_Special
 Name: Root_Unix
 Name: Root_Windows

 And the Perl-Script with the modification <>>> #!perl
 use strict;
 use warnings;
 use Win32::OLE qw(in with);
 use Win32::OLE::Variant;
 use Data::Dumper;

 my $objWMIService =
 Win32::OLE->GetObject("winmgmts:root/HewlettPackard/OpenView/data") or
 die
 "WMI connection failed.\n";
 if (Win32::OLE-> LastError() != 0) {
print "Error calling GetObject: " . Win32::OLE->LastError() . "\n";
 exit 0;
 }

 my $objOV_NodeGroup = $objWMIService->Get("OV_NodeGroup");
 if (Win32::OLE-> LastError() != 0) {
print "Error calling Get: " . Win32::OLE->LastError() . "\n";
 exit 0;
 }

 my $objGetRoot = $objOV_NodeGroup->GetRoot();
 if (Win32::OLE-> LastError() != 0) {
print "Error calling GetRoot: " . Win32::OLE->LastError() . "\n";
 exit 0;
 }

 my $nodes = Win32::OLE::Variant->new(VT_ARRAY|VT_VARIANT, 0);
 #my $nodes = Win32::OLE::Variant->new(VT_VARIANT|VT_BYREF);
 #my $nodes = Win32::OLE::Variant->new(VT_ARRAY|VT_BSTR, 0);
 #my $nodes = Win32::OLE::Variant->new(VT_DISPATCH|VT_BYREF);
 #my $nodes = Win32::OLE::Variant->new(VT_ARRAY|VT_VARIANT|VT_BYREF,
0);
 #my $nodes = Win32::OLE::Variant->new(VT_ARRAY|VT_BSTR|VT_BYREF, 0);
 #my $nodes = Win32::OLE::Variant->new(VT_VARIANT|VT_BYREF);
 #my $nodes = Win32::OLE::Variant->new(VT_ARRAY|VT_VARIANT|VT_BYREF,
0);

 my $objChildGroups = $objGetRoot->GetChildNodeGroups($nodes, "True");
 if (Win32::OLE-> LastError() != 0) {
print "Error calling GetChildNodeGroups: " . Win32::OLE->LastError()
.
 "\n";
 exit 0;
 }
 print "Child Group Count: " . $objChildGroups . "\n";

 print Dumper($nodes);


 foreach my $objItem (in $nodes) {
 print 'Name: ' . $objItem->{Name} . "\n";
 }

 #my $nodes = Win32::OLE::Variant->new(VT_ARRAY|VT_VARIANT, 0); Returns
 ##Child Group Count: 25
 ##$VAR1 = bless( do{\(my $o = 27197068)}, 'Win32::OLE::Variant' );
 ##Not a HASH reference at GetChildNodeGroups.pl line 46.

 #my $nodes = Win32::OLE::Variant->new(VT_VARIANT|VT_BYREF); Returns
 ##Child Group Count: 25
 ##$VAR1 = bless( do{\(my $o = 27197828)}, 'Win32::OLE::Variant' );
 ##Not a HASH reference at GetChildNodeGroups.pl line 46.

 #my $nodes = Win32::OLE::Variant->new(VT_ARRAY|VT_BSTR, 0); Returns
 ##Child Group Count: 25
 ##$VAR1 = bless( do{\(my $o = 27198308)}, 'Win32::OLE::Variant' );
 ##Not a HASH reference at GetChildNodeGroups.pl line 46.

 #my $nodes = Win32::OLE::Variant->new(VT_DISPATCH|VT_BYREF); Returns
 ##Error calling GetChildNodeGroups: Win32::OLE(0.1709) error
 0x80010105:
 "The server threw an exception"
 ##in METHOD/PROPERTYGET "GetChildNodeGroups"

 #my $nodes = Win32::OLE::Variant->new(VT_ARRAY|VT_VARIANT|VT_BYREF,
0);
 Returns
 ##Child Group Count: 25
 ##$VAR1 = bless( do{\(my $o = 27199076)}, 'Win32::OLE::Variant' );
 ##Not a HASH reference at GetChildNodeGroups.pl line 46.

 #my $nodes = Win32::OLE::Variant->new(VT_ARRAY|VT_BSTR|VT_BYREF, 0);
 Returns
 ##Child Group Count: 25
 ##$VAR1 = bless( do{\(my $o = 27197684)}, 'Win32::OLE::Variant' );
 ##Not a HA

Re: WIN32::OLE WMI Out params

2009-12-05 Thread Michael Ellery
Michael wrote:
> On Fri, 04 Dec 2009 17:10:26 -0800, Michael Ellery
>  wrote:
>> Michael wrote:
>>> Okay - Just to sum up the whole thing.
>>>
>>> The original VBScript <>>
>>> Option Explicit
>>>
>>> Dim objWMIService, objOV_NodeGroup, objGetRoot, objChildGroups,
> arrNodes,
>>> objItem
>>>
>>> Set objWMIService =
>>> GetObject("winmgmts:root\HewlettPackard\OpenView\data")
>>>
>>> Set objOV_NodeGroup = objWMIService.Get("OV_NodeGroup")
>>> Set objGetRoot = objOV_NodeGroup.GetRoot()
>>> objChildGroups = objGetRoot.GetChildNodeGroups(arrNodes, True)
>>>
>>> WScript.Echo "Child Group Count: " & objChildGroups & vbCrLF
>>>
>>> For Each objItem In arrNodes
>>>   WScript.Echo "Name: " & objItem.Name
>>> Next
>>> EOF
>>>
>>> Returns the following:
>>>
>>> Child Group Count: 25
>>>
>>> Name: {36716FD8-E600-46FB-90CA-1263E0C62509}
>>> Name: {38FF8E8E-2DDC-4895-A7EB-0DC7DF50EC25}
>>> Name: {3E575181-0225-4553-9722-46F841B9FA76}
>>> Name: {8A412133-F571-42BC-8A66-4B242EB3BAC4}
>>> Name: {E14D965C-1FBB-40EC-A784-5F9F39F82281}
>>> Name: OpenView_AIX
>>> Name: OpenView_External
>>> Name: OpenView_HPUX
>>> Name: OpenView_Linux
>>> Name: OpenView_NNM
>>> Name: OpenView_OpenVMS
>>> Name: OpenView_OpenVMS(itanium)
>>> Name: OpenView_SNMP
>>> Name: OpenView_Solaris
>>> Name: OpenView_Tru64
>>> Name: OpenView_Unknown
>>> Name: OpenView_Windows2000
>>> Name: OpenView_WindowsNT
>>> Name: OpenView_WindowsServer2003
>>> Name: OpenView_WindowsServer2008
>>> Name: OpenView_WindowsVista
>>> Name: OpenView_WindowsXP
>>> Name: Root_Special
>>> Name: Root_Unix
>>> Name: Root_Windows
>>>
>>> And the Perl-Script with the modification <>> #!perl
>>> use strict;
>>> use warnings;
>>> use Win32::OLE qw(in with);
>>> use Win32::OLE::Variant;
>>> use Data::Dumper;
>>>
>>> my $objWMIService =
>>> Win32::OLE->GetObject("winmgmts:root/HewlettPackard/OpenView/data") or
>>> die
>>> "WMI connection failed.\n";
>>> if (Win32::OLE-> LastError() != 0) {
>>> print "Error calling GetObject: " . Win32::OLE->LastError() . "\n";
>>> exit 0;
>>> }
>>>
>>> my $objOV_NodeGroup = $objWMIService->Get("OV_NodeGroup");
>>> if (Win32::OLE-> LastError() != 0) {
>>> print "Error calling Get: " . Win32::OLE->LastError() . "\n";
>>> exit 0;
>>> }
>>>
>>> my $objGetRoot = $objOV_NodeGroup->GetRoot();
>>> if (Win32::OLE-> LastError() != 0) {
>>> print "Error calling GetRoot: " . Win32::OLE->LastError() . "\n";
>>> exit 0;
>>> }
>>>
>>> my $nodes = Win32::OLE::Variant->new(VT_ARRAY|VT_VARIANT, 0);
>>> #my $nodes = Win32::OLE::Variant->new(VT_VARIANT|VT_BYREF);
>>> #my $nodes = Win32::OLE::Variant->new(VT_ARRAY|VT_BSTR, 0);
>>> #my $nodes = Win32::OLE::Variant->new(VT_DISPATCH|VT_BYREF);
>>> #my $nodes = Win32::OLE::Variant->new(VT_ARRAY|VT_VARIANT|VT_BYREF, 0);
>>> #my $nodes = Win32::OLE::Variant->new(VT_ARRAY|VT_BSTR|VT_BYREF, 0);
>>> #my $nodes = Win32::OLE::Variant->new(VT_VARIANT|VT_BYREF);
>>> #my $nodes = Win32::OLE::Variant->new(VT_ARRAY|VT_VARIANT|VT_BYREF, 0);
>>>
>>> my $objChildGroups = $objGetRoot->GetChildNodeGroups($nodes, "True");
>>> if (Win32::OLE-> LastError() != 0) {
>>> print "Error calling GetChildNodeGroups: " . Win32::OLE->LastError() .
>>> "\n";
>>> exit 0;
>>> }
>>> print "Child Group Count: " . $objChildGroups . "\n";
>>>
>>> print Dumper($nodes);
>>>
>>>
>>> foreach my $objItem (in $nodes) {
>>> print 'Name: ' . $objItem->{Name} . "\n";
>>> }
>>>
>>> #my $nodes = Win32::OLE::Variant->new(VT_ARRAY|VT_VARIANT, 0); Returns
>>> ##Child Group Count: 25
>>> ##$VAR1 = bless( do{\(my $o = 27197068)}, 'Win32::OLE::Variant' );
>>> ##Not a HASH reference at GetChildNodeGroups.pl line 46.
>>>
>>> #my $nodes = Win32::OLE::Variant->new(VT_VARIANT|VT_BYREF); Returns
>>> ##Child Group Count: 25
>>> ##$VAR1 = bless( do{\(my $o = 27197828)}, 'Win32::OLE::Variant' );
>>> ##Not a HASH reference at GetChildNodeGroups.pl line 46.
>>>
>>> #my $nodes = Win32::OLE::Variant->new(VT_ARRAY|VT_BSTR, 0); Returns
>>> ##Child Group Count: 25
>>> ##$VAR1 = bless( do{\(my $o = 27198308)}, 'Win32::OLE::Variant' );
>>> ##Not a HASH reference at GetChildNodeGroups.pl line 46.
>>>
>>> #my $nodes = Win32::OLE::Variant->new(VT_DISPATCH|VT_BYREF); Returns
>>> ##Error calling GetChildNodeGroups: Win32::OLE(0.1709) error 0x80010105:
>>> "The server threw an exception"
>>> ##in METHOD/PROPERTYGET "GetChildNodeGroups"
>>>
>>> #my $nodes = Win32::OLE::Variant->new(VT_ARRAY|VT_VARIANT|VT_BYREF, 0);
>>> Returns
>>> ##Child Group Count: 25
>>> ##$VAR1 = bless( do{\(my $o = 27199076)}, 'Win32::OLE::Variant' );
>>> ##Not a HASH reference at GetChildNodeGroups.pl line 46.
>>>
>>> #my $nodes = Win32::OLE::Variant->new(VT_ARRAY|VT_BSTR|VT_BYREF, 0);
>>> Returns
>>> ##Child Group Count: 25
>>> ##$VAR1 = bless( do{\(my $o = 27197684)}, 'Win32::OLE::Variant' );
>>> ##Not a HASH reference at GetChildNodeGroups.pl line 46.
>>>
>>> #my $nodes = Win32::OLE::Variant->new(VT_VARIANT|VT_BYREF); Returns
>>> ##Child Group Count: 25
>>> ##$VAR1 = bless( do{\(my $o = 27199620)}, 'Win32

Re: WIN32::OLE WMI Out params

2009-12-05 Thread Michael
On Fri, 04 Dec 2009 17:10:26 -0800, Michael Ellery
 wrote:
> Michael wrote:
>> Okay - Just to sum up the whole thing.
>> 
>> The original VBScript <> 
>> Option Explicit
>> 
>> Dim objWMIService, objOV_NodeGroup, objGetRoot, objChildGroups,
arrNodes,
>> objItem
>> 
>> Set objWMIService =
>> GetObject("winmgmts:root\HewlettPackard\OpenView\data")
>> 
>> Set objOV_NodeGroup = objWMIService.Get("OV_NodeGroup")
>> Set objGetRoot = objOV_NodeGroup.GetRoot()
>> objChildGroups = objGetRoot.GetChildNodeGroups(arrNodes, True)
>> 
>> WScript.Echo "Child Group Count: " & objChildGroups & vbCrLF
>> 
>> For Each objItem In arrNodes
>>   WScript.Echo "Name: " & objItem.Name
>> Next
>> EOF
>> 
>> Returns the following:
>> 
>> Child Group Count: 25
>> 
>> Name: {36716FD8-E600-46FB-90CA-1263E0C62509}
>> Name: {38FF8E8E-2DDC-4895-A7EB-0DC7DF50EC25}
>> Name: {3E575181-0225-4553-9722-46F841B9FA76}
>> Name: {8A412133-F571-42BC-8A66-4B242EB3BAC4}
>> Name: {E14D965C-1FBB-40EC-A784-5F9F39F82281}
>> Name: OpenView_AIX
>> Name: OpenView_External
>> Name: OpenView_HPUX
>> Name: OpenView_Linux
>> Name: OpenView_NNM
>> Name: OpenView_OpenVMS
>> Name: OpenView_OpenVMS(itanium)
>> Name: OpenView_SNMP
>> Name: OpenView_Solaris
>> Name: OpenView_Tru64
>> Name: OpenView_Unknown
>> Name: OpenView_Windows2000
>> Name: OpenView_WindowsNT
>> Name: OpenView_WindowsServer2003
>> Name: OpenView_WindowsServer2008
>> Name: OpenView_WindowsVista
>> Name: OpenView_WindowsXP
>> Name: Root_Special
>> Name: Root_Unix
>> Name: Root_Windows
>> 
>> And the Perl-Script with the modification <> #!perl
>> use strict;
>> use warnings;
>> use Win32::OLE qw(in with);
>> use Win32::OLE::Variant;
>> use Data::Dumper;
>> 
>> my $objWMIService =
>> Win32::OLE->GetObject("winmgmts:root/HewlettPackard/OpenView/data") or
>> die
>> "WMI connection failed.\n";
>> if (Win32::OLE-> LastError() != 0) {
>>  print "Error calling GetObject: " . Win32::OLE->LastError() . "\n";
>> exit 0;
>> }
>> 
>> my $objOV_NodeGroup = $objWMIService->Get("OV_NodeGroup");
>> if (Win32::OLE-> LastError() != 0) {
>>  print "Error calling Get: " . Win32::OLE->LastError() . "\n";
>> exit 0;
>> }
>> 
>> my $objGetRoot = $objOV_NodeGroup->GetRoot();
>> if (Win32::OLE-> LastError() != 0) {
>>  print "Error calling GetRoot: " . Win32::OLE->LastError() . "\n";
>> exit 0;
>> }
>> 
>> my $nodes = Win32::OLE::Variant->new(VT_ARRAY|VT_VARIANT, 0);
>> #my $nodes = Win32::OLE::Variant->new(VT_VARIANT|VT_BYREF);
>> #my $nodes = Win32::OLE::Variant->new(VT_ARRAY|VT_BSTR, 0);
>> #my $nodes = Win32::OLE::Variant->new(VT_DISPATCH|VT_BYREF);
>> #my $nodes = Win32::OLE::Variant->new(VT_ARRAY|VT_VARIANT|VT_BYREF, 0);
>> #my $nodes = Win32::OLE::Variant->new(VT_ARRAY|VT_BSTR|VT_BYREF, 0);
>> #my $nodes = Win32::OLE::Variant->new(VT_VARIANT|VT_BYREF);
>> #my $nodes = Win32::OLE::Variant->new(VT_ARRAY|VT_VARIANT|VT_BYREF, 0);
>> 
>> my $objChildGroups = $objGetRoot->GetChildNodeGroups($nodes, "True");
>> if (Win32::OLE-> LastError() != 0) {
>>  print "Error calling GetChildNodeGroups: " . Win32::OLE->LastError() .
>> "\n";
>> exit 0;
>> }
>> print "Child Group Count: " . $objChildGroups . "\n";
>> 
>> print Dumper($nodes);
>> 
>> 
>> foreach my $objItem (in $nodes) {
>> print 'Name: ' . $objItem->{Name} . "\n";
>> }
>> 
>> #my $nodes = Win32::OLE::Variant->new(VT_ARRAY|VT_VARIANT, 0); Returns
>> ##Child Group Count: 25
>> ##$VAR1 = bless( do{\(my $o = 27197068)}, 'Win32::OLE::Variant' );
>> ##Not a HASH reference at GetChildNodeGroups.pl line 46.
>> 
>> #my $nodes = Win32::OLE::Variant->new(VT_VARIANT|VT_BYREF); Returns
>> ##Child Group Count: 25
>> ##$VAR1 = bless( do{\(my $o = 27197828)}, 'Win32::OLE::Variant' );
>> ##Not a HASH reference at GetChildNodeGroups.pl line 46.
>> 
>> #my $nodes = Win32::OLE::Variant->new(VT_ARRAY|VT_BSTR, 0); Returns
>> ##Child Group Count: 25
>> ##$VAR1 = bless( do{\(my $o = 27198308)}, 'Win32::OLE::Variant' );
>> ##Not a HASH reference at GetChildNodeGroups.pl line 46.
>> 
>> #my $nodes = Win32::OLE::Variant->new(VT_DISPATCH|VT_BYREF); Returns
>> ##Error calling GetChildNodeGroups: Win32::OLE(0.1709) error 0x80010105:
>> "The server threw an exception"
>> ##in METHOD/PROPERTYGET "GetChildNodeGroups"
>> 
>> #my $nodes = Win32::OLE::Variant->new(VT_ARRAY|VT_VARIANT|VT_BYREF, 0);
>> Returns
>> ##Child Group Count: 25
>> ##$VAR1 = bless( do{\(my $o = 27199076)}, 'Win32::OLE::Variant' );
>> ##Not a HASH reference at GetChildNodeGroups.pl line 46.
>> 
>> #my $nodes = Win32::OLE::Variant->new(VT_ARRAY|VT_BSTR|VT_BYREF, 0);
>> Returns
>> ##Child Group Count: 25
>> ##$VAR1 = bless( do{\(my $o = 27197684)}, 'Win32::OLE::Variant' );
>> ##Not a HASH reference at GetChildNodeGroups.pl line 46.
>> 
>> #my $nodes = Win32::OLE::Variant->new(VT_VARIANT|VT_BYREF); Returns
>> ##Child Group Count: 25
>> ##$VAR1 = bless( do{\(my $o = 27199620)}, 'Win32::OLE::Variant' );
>> ##Not a HASH reference at GetChildNodeGroups.pl line 46.
>> 
>> #my $nodes = Win32::OLE::Variant->new(VT_ARRAY|

Re: WIN32::OLE WMI Out params

2009-12-04 Thread Michael Ellery
Michael wrote:
> Okay - Just to sum up the whole thing.
> 
> The original VBScript < 
> Option Explicit
> 
> Dim objWMIService, objOV_NodeGroup, objGetRoot, objChildGroups, arrNodes,
> objItem
> 
> Set objWMIService = GetObject("winmgmts:root\HewlettPackard\OpenView\data")
> 
> Set objOV_NodeGroup = objWMIService.Get("OV_NodeGroup")
> Set objGetRoot = objOV_NodeGroup.GetRoot()
> objChildGroups = objGetRoot.GetChildNodeGroups(arrNodes, True)
> 
> WScript.Echo "Child Group Count: " & objChildGroups & vbCrLF
> 
> For Each objItem In arrNodes
>   WScript.Echo "Name: " & objItem.Name
> Next
> EOF
> 
> Returns the following:
> 
> Child Group Count: 25
> 
> Name: {36716FD8-E600-46FB-90CA-1263E0C62509}
> Name: {38FF8E8E-2DDC-4895-A7EB-0DC7DF50EC25}
> Name: {3E575181-0225-4553-9722-46F841B9FA76}
> Name: {8A412133-F571-42BC-8A66-4B242EB3BAC4}
> Name: {E14D965C-1FBB-40EC-A784-5F9F39F82281}
> Name: OpenView_AIX
> Name: OpenView_External
> Name: OpenView_HPUX
> Name: OpenView_Linux
> Name: OpenView_NNM
> Name: OpenView_OpenVMS
> Name: OpenView_OpenVMS(itanium)
> Name: OpenView_SNMP
> Name: OpenView_Solaris
> Name: OpenView_Tru64
> Name: OpenView_Unknown
> Name: OpenView_Windows2000
> Name: OpenView_WindowsNT
> Name: OpenView_WindowsServer2003
> Name: OpenView_WindowsServer2008
> Name: OpenView_WindowsVista
> Name: OpenView_WindowsXP
> Name: Root_Special
> Name: Root_Unix
> Name: Root_Windows
> 
> And the Perl-Script with the modification < #!perl
> use strict;
> use warnings;
> use Win32::OLE qw(in with);
> use Win32::OLE::Variant;
> use Data::Dumper;
> 
> my $objWMIService =
> Win32::OLE->GetObject("winmgmts:root/HewlettPackard/OpenView/data") or die
> "WMI connection failed.\n";
> if (Win32::OLE-> LastError() != 0) {
>   print "Error calling GetObject: " . Win32::OLE->LastError() . "\n";
> exit 0;
> }
> 
> my $objOV_NodeGroup = $objWMIService->Get("OV_NodeGroup");
> if (Win32::OLE-> LastError() != 0) {
>   print "Error calling Get: " . Win32::OLE->LastError() . "\n";
> exit 0;
> }
> 
> my $objGetRoot = $objOV_NodeGroup->GetRoot();
> if (Win32::OLE-> LastError() != 0) {
>   print "Error calling GetRoot: " . Win32::OLE->LastError() . "\n";
> exit 0;
> }
> 
> my $nodes = Win32::OLE::Variant->new(VT_ARRAY|VT_VARIANT, 0);
> #my $nodes = Win32::OLE::Variant->new(VT_VARIANT|VT_BYREF);
> #my $nodes = Win32::OLE::Variant->new(VT_ARRAY|VT_BSTR, 0);
> #my $nodes = Win32::OLE::Variant->new(VT_DISPATCH|VT_BYREF);
> #my $nodes = Win32::OLE::Variant->new(VT_ARRAY|VT_VARIANT|VT_BYREF, 0);
> #my $nodes = Win32::OLE::Variant->new(VT_ARRAY|VT_BSTR|VT_BYREF, 0);
> #my $nodes = Win32::OLE::Variant->new(VT_VARIANT|VT_BYREF);
> #my $nodes = Win32::OLE::Variant->new(VT_ARRAY|VT_VARIANT|VT_BYREF, 0);
> 
> my $objChildGroups = $objGetRoot->GetChildNodeGroups($nodes, "True");
> if (Win32::OLE-> LastError() != 0) {
>   print "Error calling GetChildNodeGroups: " . Win32::OLE->LastError() .
> "\n";
> exit 0;
> }
> print "Child Group Count: " . $objChildGroups . "\n";
> 
> print Dumper($nodes);
> 
> 
> foreach my $objItem (in $nodes) {
> print 'Name: ' . $objItem->{Name} . "\n";
> }
> 
> #my $nodes = Win32::OLE::Variant->new(VT_ARRAY|VT_VARIANT, 0); Returns
> ##Child Group Count: 25
> ##$VAR1 = bless( do{\(my $o = 27197068)}, 'Win32::OLE::Variant' );
> ##Not a HASH reference at GetChildNodeGroups.pl line 46.
> 
> #my $nodes = Win32::OLE::Variant->new(VT_VARIANT|VT_BYREF); Returns
> ##Child Group Count: 25
> ##$VAR1 = bless( do{\(my $o = 27197828)}, 'Win32::OLE::Variant' );
> ##Not a HASH reference at GetChildNodeGroups.pl line 46.
> 
> #my $nodes = Win32::OLE::Variant->new(VT_ARRAY|VT_BSTR, 0); Returns
> ##Child Group Count: 25
> ##$VAR1 = bless( do{\(my $o = 27198308)}, 'Win32::OLE::Variant' );
> ##Not a HASH reference at GetChildNodeGroups.pl line 46.
> 
> #my $nodes = Win32::OLE::Variant->new(VT_DISPATCH|VT_BYREF); Returns
> ##Error calling GetChildNodeGroups: Win32::OLE(0.1709) error 0x80010105:
> "The server threw an exception"
> ##in METHOD/PROPERTYGET "GetChildNodeGroups"
> 
> #my $nodes = Win32::OLE::Variant->new(VT_ARRAY|VT_VARIANT|VT_BYREF, 0);
> Returns
> ##Child Group Count: 25
> ##$VAR1 = bless( do{\(my $o = 27199076)}, 'Win32::OLE::Variant' );
> ##Not a HASH reference at GetChildNodeGroups.pl line 46.
> 
> #my $nodes = Win32::OLE::Variant->new(VT_ARRAY|VT_BSTR|VT_BYREF, 0);
> Returns
> ##Child Group Count: 25
> ##$VAR1 = bless( do{\(my $o = 27197684)}, 'Win32::OLE::Variant' );
> ##Not a HASH reference at GetChildNodeGroups.pl line 46.
> 
> #my $nodes = Win32::OLE::Variant->new(VT_VARIANT|VT_BYREF); Returns
> ##Child Group Count: 25
> ##$VAR1 = bless( do{\(my $o = 27199620)}, 'Win32::OLE::Variant' );
> ##Not a HASH reference at GetChildNodeGroups.pl line 46.
> 
> #my $nodes = Win32::OLE::Variant->new(VT_ARRAY|VT_VARIANT|VT_BYREF, 0);
> Returns
> ##Child Group Count: 25
> ##$VAR1 = bless( do{\(my $o = 27199524)}, 'Win32::OLE::Variant' );
> ##Not a HASH reference at GetChildNodeGroups.pl line 46.
> 
> Does any of

RE: WIN32::OLE WMI Out params

2009-12-04 Thread Michael
Okay - Just to sum up the whole thing.

The original VBScript  LastError() != 0) {
print "Error calling GetObject: " . Win32::OLE->LastError() . "\n";
exit 0;
}

my $objOV_NodeGroup = $objWMIService->Get("OV_NodeGroup");
if (Win32::OLE-> LastError() != 0) {
print "Error calling Get: " . Win32::OLE->LastError() . "\n";
exit 0;
}

my $objGetRoot = $objOV_NodeGroup->GetRoot();
if (Win32::OLE-> LastError() != 0) {
print "Error calling GetRoot: " . Win32::OLE->LastError() . "\n";
exit 0;
}

my $nodes = Win32::OLE::Variant->new(VT_ARRAY|VT_VARIANT, 0);
#my $nodes = Win32::OLE::Variant->new(VT_VARIANT|VT_BYREF);
#my $nodes = Win32::OLE::Variant->new(VT_ARRAY|VT_BSTR, 0);
#my $nodes = Win32::OLE::Variant->new(VT_DISPATCH|VT_BYREF);
#my $nodes = Win32::OLE::Variant->new(VT_ARRAY|VT_VARIANT|VT_BYREF, 0);
#my $nodes = Win32::OLE::Variant->new(VT_ARRAY|VT_BSTR|VT_BYREF, 0);
#my $nodes = Win32::OLE::Variant->new(VT_VARIANT|VT_BYREF);
#my $nodes = Win32::OLE::Variant->new(VT_ARRAY|VT_VARIANT|VT_BYREF, 0);

my $objChildGroups = $objGetRoot->GetChildNodeGroups($nodes, "True");
if (Win32::OLE-> LastError() != 0) {
print "Error calling GetChildNodeGroups: " . Win32::OLE->LastError() .
"\n";
exit 0;
}
print "Child Group Count: " . $objChildGroups . "\n";

print Dumper($nodes);


foreach my $objItem (in $nodes) {
print 'Name: ' . $objItem->{Name} . "\n";
}

#my $nodes = Win32::OLE::Variant->new(VT_ARRAY|VT_VARIANT, 0); Returns
##Child Group Count: 25
##$VAR1 = bless( do{\(my $o = 27197068)}, 'Win32::OLE::Variant' );
##Not a HASH reference at GetChildNodeGroups.pl line 46.

#my $nodes = Win32::OLE::Variant->new(VT_VARIANT|VT_BYREF); Returns
##Child Group Count: 25
##$VAR1 = bless( do{\(my $o = 27197828)}, 'Win32::OLE::Variant' );
##Not a HASH reference at GetChildNodeGroups.pl line 46.

#my $nodes = Win32::OLE::Variant->new(VT_ARRAY|VT_BSTR, 0); Returns
##Child Group Count: 25
##$VAR1 = bless( do{\(my $o = 27198308)}, 'Win32::OLE::Variant' );
##Not a HASH reference at GetChildNodeGroups.pl line 46.

#my $nodes = Win32::OLE::Variant->new(VT_DISPATCH|VT_BYREF); Returns
##Error calling GetChildNodeGroups: Win32::OLE(0.1709) error 0x80010105:
"The server threw an exception"
##in METHOD/PROPERTYGET "GetChildNodeGroups"

#my $nodes = Win32::OLE::Variant->new(VT_ARRAY|VT_VARIANT|VT_BYREF, 0);
Returns
##Child Group Count: 25
##$VAR1 = bless( do{\(my $o = 27199076)}, 'Win32::OLE::Variant' );
##Not a HASH reference at GetChildNodeGroups.pl line 46.

#my $nodes = Win32::OLE::Variant->new(VT_ARRAY|VT_BSTR|VT_BYREF, 0);
Returns
##Child Group Count: 25
##$VAR1 = bless( do{\(my $o = 27197684)}, 'Win32::OLE::Variant' );
##Not a HASH reference at GetChildNodeGroups.pl line 46.

#my $nodes = Win32::OLE::Variant->new(VT_VARIANT|VT_BYREF); Returns
##Child Group Count: 25
##$VAR1 = bless( do{\(my $o = 27199620)}, 'Win32::OLE::Variant' );
##Not a HASH reference at GetChildNodeGroups.pl line 46.

#my $nodes = Win32::OLE::Variant->new(VT_ARRAY|VT_VARIANT|VT_BYREF, 0);
Returns
##Child Group Count: 25
##$VAR1 = bless( do{\(my $o = 27199524)}, 'Win32::OLE::Variant' );
##Not a HASH reference at GetChildNodeGroups.pl line 46.

Does any of this, make any sense to you guys?

/Michael



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


RE: WIN32::OLE WMI Out params

2009-12-04 Thread Steven Manross
 

> -Original Message-
> From: perl-win32-users-boun...@listserv.activestate.com 
> [mailto:perl-win32-users-boun...@listserv.activestate.com] On 
> Behalf Of Michael Ellery
> Sent: Friday, December 04, 2009 11:59 AM
> To: Michael
> Cc: perl-win32-users@listserv.ActiveState.com
> Subject: Re: WIN32::OLE WMI Out params
> 
> I haven't followed your thread closely, but it seems like the 
> relevant bits from your first link are these:
> 
> my $objSecDescriptor = Win32::OLE::Variant-> new 
> (VT_DISPATCH|VT_BYREF); my $retval = 
> $objDirectorySecSetting->GetSecurityDescriptor($objSecDescriptor);
> 
> ..which seems to be filling the $objSecDescriptor with an out param.
> 
> If your out param is an array, you might need to add VT_ARRAY 
> to the variant flags when you create it. Does something like 
> that work for you ?
> 
> -Mike
> 
> Michael wrote:
> > Hi Steven,
> > 
> > Well I tried your suggestion and I think that the 
> Win32::OLE::Variant 
> > module might be the solution, as I have found some other examples 
> > where WMI [out] and variants are used.
> > 
> > 
> http://www.infoqu.com/dev/perl-programming/using-perl-with-wmi-to-set-
> > folder-level-permissions-16930-1/
> > http://www.perlmonks.org/?node_id=325823
> > 
> > However I'm in way over my head here, so unless someone 
> could cut it 
> > out in pieces , I don't think that I'll get any further.
> > 
> > /Michael
> > 
> > 
> > On Fri, 4 Dec 2009 02:12:03 -0700, "Steven Manross" 
> > 
> > wrote:
> >> Below...
> >>
> >>> -Original Message-
> >>> From: perl-win32-users-boun...@listserv.activestate.com
> >>> 
> [mailto:perl-win32-users-boun...@listserv.activestate.com] On Behalf 
> >>> Of Michael
> >>> Sent: Thursday, December 03, 2009 6:45 AM
> >>> To: perl-win32-users@listserv.ActiveState.com
> >>> Subject: RE: WIN32::OLE WMI Out params
> >>>
> >>>> When troubleshooting OLE issues, it is best to have the
> >>> following code
> >>>> after each OLE command...
> >>>>
> >>>> If (Win32::OLE-> LastError() != 0) {
> >>>>   print "error calling blah: " . Win32::OLE-> LastError() . "\n";
> >>>>   exit 0;
> >>>> }
> >>>>
> >>>> ...Or something similar, so you can see what OLE had issues
> >>> with (if
> >>>> anything).  It might lead you in a direction that fixes it.
> >>>>
> >>>> Steven
> >>> Added to the script, but no issues reported.
> >>>
> >>> /Michael
> >> Well, then my next guess is the use of the Variant module 
> (because no 
> >> error is thrown from OLE).
> >>
> >> Some OLE calls require to be cast of a certain type before 
> they work.
> >>
> >> my $nodes = Variant(VT_ARRAY|VT_VARIANT, 0);

My apologies here..  I think that I misstated the way to call it. 

Put this at the top somewhere...

use Win32::OLE::Variant;

Add the following before your GetChildNodes call.  Thanks go to Michael
Ellery for making me see that mistake as I did not test this code before
sending it off.

my $nodes = Win32::OLE::Variant->new(VT_ARRAY|VT_VARIANT, 0);

By adding this before your GetChildNodes call, you should be all set
(Variant-wise)

However, before you give up after trying the above call (if it does not
work as stated above), I would replace:

"VT_ARRAY|VT_VARIANT" 

With

"VT_VARIANT" 

And also try.. (if the previous does not work)

"VT_ARRAY|VT_BSTR"

And lastly try his example from the SecurityDescriptor call..

"VT_DISPATCH|VT_BYREF"

...in my code above.  

As well, you might try sticking the VT_BYREF as another ORed option to
each of the above examples like in Michael Ellery's example..  i.e.
VT_ARRAY_|VT_BSTR|VT_BYREF or VT_VARIANT|VT_BYREF or
VT_ARRAY|VT_VARIANT|VT_BYREF

HTH

Steven

> >>
> >> #I might also try VT_VARIANT or VT_ARRAY|VT_BSTR instead of 
> >> VT_ARRAY|VT_VARIANT
> >>
> >> #then
> >> my $objChildGroups = $objGetRoot->GetChildNodeGroups($nodes, TRUE);
> >>
> >> Play around with this...  I'm not the greatest Variant 
> script writer 
> >> here, to know exactly which combination will work (if this is it) 
> >> based on the object type as I've only run into this a few times 
> >> before, but you can get examples from your perl install here 
> >> (depending on your perl 

Re: WIN32::OLE WMI Out params

2009-12-04 Thread Michael Ellery
I haven't followed your thread closely, but it seems like the relevant
bits from your first link are these:

my $objSecDescriptor = Win32::OLE::Variant-> new (VT_DISPATCH|VT_BYREF);
my $retval =
$objDirectorySecSetting->GetSecurityDescriptor($objSecDescriptor);

..which seems to be filling the $objSecDescriptor with an out param.

If your out param is an array, you might need to add VT_ARRAY to the
variant flags when you create it. Does something like that work for you ?

-Mike

Michael wrote:
> Hi Steven,
> 
> Well I tried your suggestion and I think that the Win32::OLE::Variant
> module might be the solution, as I have found some other examples where WMI
> [out] and variants are used.
> 
> http://www.infoqu.com/dev/perl-programming/using-perl-with-wmi-to-set-folder-level-permissions-16930-1/
> http://www.perlmonks.org/?node_id=325823
> 
> However I'm in way over my head here, so unless someone could cut it out in
> pieces , I don't think that 
> I'll get any further.
> 
> /Michael
> 
> 
> On Fri, 4 Dec 2009 02:12:03 -0700, "Steven Manross" 
> wrote:
>> Below...
>>
>>> -Original Message-
>>> From: perl-win32-users-boun...@listserv.activestate.com 
>>> [mailto:perl-win32-users-boun...@listserv.activestate.com] On 
>>> Behalf Of Michael
>>> Sent: Thursday, December 03, 2009 6:45 AM
>>> To: perl-win32-users@listserv.ActiveState.com
>>> Subject: RE: WIN32::OLE WMI Out params
>>>
>>>> When troubleshooting OLE issues, it is best to have the 
>>> following code 
>>>> after each OLE command...
>>>>
>>>> If (Win32::OLE-> LastError() != 0) {
>>>>   print "error calling blah: " . Win32::OLE-> LastError() . "\n";
>>>>   exit 0;
>>>> }
>>>>
>>>> ...Or something similar, so you can see what OLE had issues 
>>> with (if 
>>>> anything).  It might lead you in a direction that fixes it.
>>>>
>>>> Steven
>>> Added to the script, but no issues reported.
>>>
>>> /Michael
>> Well, then my next guess is the use of the Variant module (because no
>> error is thrown from OLE).
>>
>> Some OLE calls require to be cast of a certain type before they work.
>>
>> use Win32::OLE::Variant;
>>
>> my $nodes = Variant(VT_ARRAY|VT_VARIANT, 0); 
>>
>> #I might also try VT_VARIANT or VT_ARRAY|VT_BSTR instead of
>> VT_ARRAY|VT_VARIANT
>>
>> #then
>> my $objChildGroups = $objGetRoot->GetChildNodeGroups($nodes, TRUE); 
>>
>> Play around with this...  I'm not the greatest Variant script writer
>> here, to know exactly which combination will work (if this is it) based
>> on the object type as I've only run into this a few times before, but
>> you can get examples from your perl install here (depending on your perl
>> build version) of similar options to try and all the VT_* types:
>>
>> C:\Perl\html\lib\Win32\OLE\Variant.html
>>
>> HTH
>>
>> P.S. I googled OV_NodeGroup and found someone else with your same
>> problem on an HP board (or so it seems).  :(
>>
>> Steven
>>
>>> ___
>>> Perl-Win32-Users mailing list
>>> Perl-Win32-Users@listserv.ActiveState.com
>>> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
>>>
> ___
> Perl-Win32-Users mailing list
> Perl-Win32-Users@listserv.ActiveState.com
> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
> 

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


RE: WIN32::OLE WMI Out params

2009-12-04 Thread Michael
Hi Steven,

Well I tried your suggestion and I think that the Win32::OLE::Variant
module might be the solution, as I have found some other examples where WMI
[out] and variants are used.

http://www.infoqu.com/dev/perl-programming/using-perl-with-wmi-to-set-folder-level-permissions-16930-1/
http://www.perlmonks.org/?node_id=325823

However I'm in way over my head here, so unless someone could cut it out in
pieces , I don't think that 
I'll get any further.

/Michael


On Fri, 4 Dec 2009 02:12:03 -0700, "Steven Manross" 
wrote:
> Below...
> 
>> -Original Message-
>> From: perl-win32-users-boun...@listserv.activestate.com 
>> [mailto:perl-win32-users-boun...@listserv.activestate.com] On 
>> Behalf Of Michael
>> Sent: Thursday, December 03, 2009 6:45 AM
>> To: perl-win32-users@listserv.ActiveState.com
>> Subject: RE: WIN32::OLE WMI Out params
>> 
>> > When troubleshooting OLE issues, it is best to have the 
>> following code 
>> > after each OLE command...
>> > 
>> > If (Win32::OLE-> LastError() != 0) {
>> >   print "error calling blah: " . Win32::OLE-> LastError() . "\n";
>> >   exit 0;
>> > }
>> > 
>> > ...Or something similar, so you can see what OLE had issues 
>> with (if 
>> > anything).  It might lead you in a direction that fixes it.
>> > 
>> > Steven
>> 
>> Added to the script, but no issues reported.
>> 
>> /Michael
> 
> Well, then my next guess is the use of the Variant module (because no
> error is thrown from OLE).
> 
> Some OLE calls require to be cast of a certain type before they work.
> 
> use Win32::OLE::Variant;
> 
> my $nodes = Variant(VT_ARRAY|VT_VARIANT, 0); 
> 
> #I might also try VT_VARIANT or VT_ARRAY|VT_BSTR instead of
> VT_ARRAY|VT_VARIANT
> 
> #then
> my $objChildGroups = $objGetRoot->GetChildNodeGroups($nodes, TRUE); 
> 
> Play around with this...  I'm not the greatest Variant script writer
> here, to know exactly which combination will work (if this is it) based
> on the object type as I've only run into this a few times before, but
> you can get examples from your perl install here (depending on your perl
> build version) of similar options to try and all the VT_* types:
> 
> C:\Perl\html\lib\Win32\OLE\Variant.html
> 
> HTH
> 
> P.S. I googled OV_NodeGroup and found someone else with your same
> problem on an HP board (or so it seems).  :(
> 
> Steven
> 
>> ___
>> Perl-Win32-Users mailing list
>> Perl-Win32-Users@listserv.ActiveState.com
>> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
>>
___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: WIN32::OLE WMI Out params

2009-12-04 Thread Steven Manross
Below...

> -Original Message-
> From: perl-win32-users-boun...@listserv.activestate.com 
> [mailto:perl-win32-users-boun...@listserv.activestate.com] On 
> Behalf Of Michael
> Sent: Thursday, December 03, 2009 6:45 AM
> To: perl-win32-users@listserv.ActiveState.com
> Subject: RE: WIN32::OLE WMI Out params
> 
> > When troubleshooting OLE issues, it is best to have the 
> following code 
> > after each OLE command...
> > 
> > If (Win32::OLE-> LastError() != 0) {
> >   print "error calling blah: " . Win32::OLE-> LastError() . "\n";
> >   exit 0;
> > }
> > 
> > ...Or something similar, so you can see what OLE had issues 
> with (if 
> > anything).  It might lead you in a direction that fixes it.
> > 
> > Steven
> 
> Added to the script, but no issues reported.
> 
> /Michael

Well, then my next guess is the use of the Variant module (because no
error is thrown from OLE).

Some OLE calls require to be cast of a certain type before they work.

use Win32::OLE::Variant;

my $nodes = Variant(VT_ARRAY|VT_VARIANT, 0); 

#I might also try VT_VARIANT or VT_ARRAY|VT_BSTR instead of
VT_ARRAY|VT_VARIANT

#then
my $objChildGroups = $objGetRoot->GetChildNodeGroups($nodes, TRUE); 

Play around with this...  I'm not the greatest Variant script writer
here, to know exactly which combination will work (if this is it) based
on the object type as I've only run into this a few times before, but
you can get examples from your perl install here (depending on your perl
build version) of similar options to try and all the VT_* types:

C:\Perl\html\lib\Win32\OLE\Variant.html

HTH

P.S. I googled OV_NodeGroup and found someone else with your same
problem on an HP board (or so it seems).  :(

Steven

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


RE: WIN32::OLE WMI Out params

2009-12-03 Thread Michael
> When troubleshooting OLE issues, it is best to have the following code
> after each OLE command...
> 
> If (Win32::OLE-> LastError() != 0) {
>   print "error calling blah: " . Win32::OLE-> LastError() . "\n";
>   exit 0;
> } 
> 
> ...Or something similar, so you can see what OLE had issues with (if
> anything).  It might lead you in a direction that fixes it.
> 
> Steven

Added to the script, but no issues reported.

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


RE: WIN32::OLE WMI Out params

2009-12-03 Thread Steven Manross
When troubleshooting OLE issues, it is best to have the following code
after each OLE command...

If (Win32::OLE->LastError() != 0) {
  print "error calling blah: " . Win32::OLE->LastError() . "\n";
  exit 0;
} 

...Or something similar, so you can see what OLE had issues with (if
anything).  It might lead you in a direction that fixes it.

Steven
> -Original Message-
> From: perl-win32-users-boun...@listserv.activestate.com 
> [mailto:perl-win32-users-boun...@listserv.activestate.com] On 
> Behalf Of Michael
> Sent: Thursday, December 03, 2009 6:19 AM
> To: perl-win32-users@listserv.ActiveState.com
> Subject: RE: WIN32::OLE WMI Out params
> 
> > Michael <>  wrote:
> >>  Hi,
> >>  
> >>  I'm a novice regarding Perl, and need some help converting a 
> >> VBScript  to a PerlScript.
> >>  
> >>  The following VBScript returns some data from HP OpenView. The  
> >> GetChildNodeGroups method returns the number of ChildGroups,
> >>  
> >>  and the [out] parameter NodeGroups returns an array which 
> contains a  
> >> list of OV_NodeGroup.
> >>  
> >> > From the documentation:
> >>  
> >>  sint32 GetChildNodeGroups(
> >>[out] OV_NodeGroup NodeGroups[],
> >>[in, optional] boolean IncludeSubGroups)
> >>  
> >>  Description
> >>  Returns a list of node groups (instances of OV_NodeGroup) 
> that are  
> >> children of this node group.
> >>  
> >>  Return Value
> >>  Number of node groups (children) in the out parameter NodeGroups.
> >>  
> >>  ' VBScript Begin
> >>  
> >>  Option Explicit
> >>  
> >>  Dim objWMIService, objOV_NodeGroup, objGetRoot, objChildGroups,  
> >> arrNodes, objItem
> >>  
> >>  Set objWMIService =
> >>  GetObject("winmgmts:root\HewlettPackard\OpenView\data")
> >>  
> >>  Set objOV_NodeGroup = objWMIService.Get("OV_NodeGroup") Set  
> >> objGetRoot = objOV_NodeGroup.GetRoot() objChildGroups =  
> >> objGetRoot.GetChildNodeGroups(arrNodes, True)
> >>  
> >>  WScript.Echo "Child Group Count: " & objChildGroups & vbCrLF
> >>  
> >>  For Each objItem In arrNodes
> >>WScript.Echo "Name: " & objItem.Name  Next
> >>  
> >>  ' VBScript End
> >>  
> >>  The problem is that I can't find out how to get the array 
> >> (@arrNodes)  in Perl.
> >>  
> >>  # PerlScript Begin
> >>  use strict;
> >>  use warnings;
> >>  use Win32::OLE qw(in with);
> >>  use Data::Dumper;
> >>  
> >>  my $objWMIService =
> >>  
> Win32::OLE->GetObject("winmgmts:root/HewlettPackard/OpenView/data")
> >>  or die "WMI connection failed.\n"; my $objOV_NodeGroup =  
> >> $objWMIService->Get("OV_NodeGroup"); my $objGetRoot =  
> >> $objOV_NodeGroup->GetRoot();
> >>  
> >>  my @arrNodes;
> >>  
> >>  my $objChildGroups = $objGetRoot->GetChildNodeGroups("@arrNodes",
> >>  "True");
> > 
> > And you were doing so well up to this point. I really don't 
> think that 
> > you want to pass an empty array, interpolated into a string, as an 
> > output parameter. In fact, I would expect that it might 
> even produce a 
> > run-time error. Does it?
> 
> Nope it does not. The problem is still that @arrNodes is 
> empty. The GetChildNodeGroups method does not populate the 
> variable/array like it does in VBScript. Therefore I've been 
> around "@arrNodes", \...@arrnodes, $nodes etc...
> 
> > 
> > I don't know the answer, but from my limited Perl/OLE 
> experience, my 
> > first guess would be that the function would want to return an OLE 
> > container object in the output parameter, and so would 
> expect it to be 
> > a reference to a scalar. For example:
> > 
> > my $nodes;
> > use constant TRUE =>  1;
> > my $objChildGroups = $objGetRoot-> 
> GetChildNodeGroups(\$nodes, TRUE);
> > 
> >>  
> >>  print "Child Group Count: " . $objChildGroups . "\n";
> >>  
> >>  print @arrNodes . "\n";
> > 
> > If I am right, and I may well not be, this would probably 
> need to be 
> > something like:
> > 
> > for my $obj (in $nodes) {
> > print "Name: $obj-> {Name}\n";
> > }
> > 
> 
> Yep - but because $nodes/@arrNodes is empty this does not change much.
> 
> >>  
> >>  # PerlScript End
> >>  
> >>  Any help would be appreciated.
> > 
> > HTH, in lieu of somebody coming up with a more certain answer.
> ___
> Perl-Win32-Users mailing list
> Perl-Win32-Users@listserv.ActiveState.com
> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
> 
___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: WIN32::OLE WMI Out params

2009-12-03 Thread Michael
> Michael <>  wrote:
>>  Hi,
>>  
>>  I'm a novice regarding Perl, and need some help converting a VBScript
>>  to a PerlScript. 
>>  
>>  The following VBScript returns some data from HP OpenView. The
>>  GetChildNodeGroups method returns the number of ChildGroups, 
>>  
>>  and the [out] parameter NodeGroups returns an array which contains a
>>  list of OV_NodeGroup. 
>>  
>> > From the documentation:
>>  
>>  sint32 GetChildNodeGroups(
>>  [out] OV_NodeGroup NodeGroups[],
>>  [in, optional] boolean IncludeSubGroups)
>>  
>>  Description
>>  Returns a list of node groups (instances of OV_NodeGroup) that are
>>  children of this node group. 
>>  
>>  Return Value
>>  Number of node groups (children) in the out parameter NodeGroups.
>>  
>>  ' VBScript Begin
>>  
>>  Option Explicit
>>  
>>  Dim objWMIService, objOV_NodeGroup, objGetRoot, objChildGroups,
>>  arrNodes, objItem 
>>  
>>  Set objWMIService =
>>  GetObject("winmgmts:root\HewlettPackard\OpenView\data") 
>>  
>>  Set objOV_NodeGroup = objWMIService.Get("OV_NodeGroup") Set
>>  objGetRoot = objOV_NodeGroup.GetRoot() objChildGroups =
>>  objGetRoot.GetChildNodeGroups(arrNodes, True)  
>>  
>>  WScript.Echo "Child Group Count: " & objChildGroups & vbCrLF
>>  
>>  For Each objItem In arrNodes
>>WScript.Echo "Name: " & objItem.Name
>>  Next
>>  
>>  ' VBScript End
>>  
>>  The problem is that I can't find out how to get the array (@arrNodes)
>>  in Perl. 
>>  
>>  # PerlScript Begin
>>  use strict;
>>  use warnings;
>>  use Win32::OLE qw(in with);
>>  use Data::Dumper;
>>  
>>  my $objWMIService =
>>  Win32::OLE->GetObject("winmgmts:root/HewlettPackard/OpenView/data")
>>  or die "WMI connection failed.\n"; my $objOV_NodeGroup =
>>  $objWMIService->Get("OV_NodeGroup"); my $objGetRoot =
>>  $objOV_NodeGroup->GetRoot();  
>>  
>>  my @arrNodes;
>>  
>>  my $objChildGroups = $objGetRoot->GetChildNodeGroups("@arrNodes",
>>  "True"); 
> 
> And you were doing so well up to this point. I really don't think that
> you want to pass an empty array, interpolated into a string, as an
> output parameter. In fact, I would expect that it might even produce a
> run-time error. Does it?

Nope it does not. The problem is still that @arrNodes is empty. The
GetChildNodeGroups method does not populate the variable/array like it does
in VBScript. Therefore I've been around "@arrNodes", \...@arrnodes, $nodes
etc...

> 
> I don't know the answer, but from my limited Perl/OLE experience, my
> first guess would be that the function would want to return an OLE
> container object in the output parameter, and so would expect it to be a
> reference to a scalar. For example:
> 
> my $nodes;
> use constant TRUE =>  1;
> my $objChildGroups = $objGetRoot-> GetChildNodeGroups(\$nodes, TRUE);
> 
>>  
>>  print "Child Group Count: " . $objChildGroups . "\n";
>>  
>>  print @arrNodes . "\n";
> 
> If I am right, and I may well not be, this would probably need to be
> something like:
> 
> for my $obj (in $nodes) {
> print "Name: $obj-> {Name}\n";
> }
> 

Yep - but because $nodes/@arrNodes is empty this does not change much.

>>  
>>  # PerlScript End
>>  
>>  Any help would be appreciated.
> 
> HTH, in lieu of somebody coming up with a more certain answer.
___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: WIN32::OLE WMI Out params

2009-12-03 Thread Brian Raven
Michael <> wrote:
> Hi,
> 
> I'm a novice regarding Perl, and need some help converting a VBScript
> to a PerlScript. 
> 
> The following VBScript returns some data from HP OpenView. The
> GetChildNodeGroups method returns the number of ChildGroups, 
> 
> and the [out] parameter NodeGroups returns an array which contains a
> list of OV_NodeGroup. 
> 
>> From the documentation:
> 
> sint32 GetChildNodeGroups(
>   [out] OV_NodeGroup NodeGroups[],
>   [in, optional] boolean IncludeSubGroups)
> 
> Description
> Returns a list of node groups (instances of OV_NodeGroup) that are
> children of this node group. 
> 
> Return Value
> Number of node groups (children) in the out parameter NodeGroups.
> 
> ' VBScript Begin
> 
> Option Explicit
> 
> Dim objWMIService, objOV_NodeGroup, objGetRoot, objChildGroups,
> arrNodes, objItem 
> 
> Set objWMIService =
> GetObject("winmgmts:root\HewlettPackard\OpenView\data") 
> 
> Set objOV_NodeGroup = objWMIService.Get("OV_NodeGroup") Set
> objGetRoot = objOV_NodeGroup.GetRoot() objChildGroups =
> objGetRoot.GetChildNodeGroups(arrNodes, True)  
> 
> WScript.Echo "Child Group Count: " & objChildGroups & vbCrLF
> 
> For Each objItem In arrNodes
>   WScript.Echo "Name: " & objItem.Name
> Next
> 
> ' VBScript End
> 
> The problem is that I can't find out how to get the array (@arrNodes)
> in Perl. 
> 
> # PerlScript Begin
> use strict;
> use warnings;
> use Win32::OLE qw(in with);
> use Data::Dumper;
> 
> my $objWMIService =
> Win32::OLE->GetObject("winmgmts:root/HewlettPackard/OpenView/data")
> or die "WMI connection failed.\n"; my $objOV_NodeGroup =
> $objWMIService->Get("OV_NodeGroup"); my $objGetRoot =
> $objOV_NodeGroup->GetRoot();  
> 
> my @arrNodes;
> 
> my $objChildGroups = $objGetRoot->GetChildNodeGroups("@arrNodes",
> "True"); 

And you were doing so well up to this point. I really don't think that
you want to pass an empty array, interpolated into a string, as an
output parameter. In fact, I would expect that it might even produce a
run-time error. Does it?

I don't know the answer, but from my limited Perl/OLE experience, my
first guess would be that the function would want to return an OLE
container object in the output parameter, and so would expect it to be a
reference to a scalar. For example:

my $nodes;
use constant TRUE => 1;
my $objChildGroups = $objGetRoot->GetChildNodeGroups(\$nodes, TRUE);

> 
> print "Child Group Count: " . $objChildGroups . "\n";
> 
> print @arrNodes . "\n";

If I am right, and I may well not be, this would probably need to be
something like:

for my $obj (in $nodes) {
print "Name: $obj->{Name}\n";
}

> 
> # PerlScript End
> 
> Any help would be appreciated.

HTH, in lieu of somebody coming up with a more certain answer.

-- 
Brian Raven 
This e-mail may contain confidential and/or privileged information. If you are 
not the intended recipient or have received this e-mail in error, please advise 
the sender immediately by reply e-mail and delete this message and any 
attachments without retaining a copy.

Any unauthorised copying, disclosure or distribution of the material in this 
e-mail is strictly forbidden.

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


Re: Win32::MsgBox highlight text?

2009-10-01 Thread rocku
As Rob May responded, it is possible to copy from MsgBox, the user just 
has to press CTRL+C and window's content gets copied to clipboard. That 
will do for me.

Thank you for all the other suggestions.

rocku pisze:
> Hi,
> I need to make a popup window with text that is highlightable, so the 
> user can select it and copy. Is it possible with Win32::MsgBox or any 
> other module that is delivered out of the box in ActiveState Perl 
> (Win32::GUI is not)?
> 
> --
> greets,
> rocku
> ___
> Perl-Win32-Users mailing list
> Perl-Win32-Users@listserv.ActiveState.com
> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
> 
___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: Win32::MsgBox highlight text?

2009-09-30 Thread Rob May
2009/9/30 rocku :
> Hi,
> I need to make a popup window with text that is highlightable, so the
> user can select it and copy. Is it possible with Win32::MsgBox or any
> other module that is delivered out of the box in ActiveState Perl
> (Win32::GUI is not)?

Not widely known, but Ctrl-C while a message box has focus puts the
message box title, message text and button text onto the clipboard.

E.g. while the message box from the following one-liner is displayed,
press Ctrl-C ...

C:\> perl -MWin32 -we "Win32::MsgBox('Some Text')"

 and this is what you get on the clipboard:

---
Perl
---
Some Text
---
OK
---


Any good?

Regards,
Rob.
___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: Win32::MsgBox highlight text?

2009-09-30 Thread Ken Cornetet
You could drive Internet Explorer Win32::OLE, or even simpler:

Open FILE ">temp.htm"
Print FILE "This is a message";
Close FILE
System("iexplore temp.htm");

-Original Message-
From: perl-win32-users-boun...@listserv.activestate.com 
[mailto:perl-win32-users-boun...@listserv.activestate.com] On Behalf Of rocku
Sent: Wednesday, September 30, 2009 5:52 AM
To: perl-win32-users@listserv.activestate.com
Subject: Win32::MsgBox highlight text?

Hi,
I need to make a popup window with text that is highlightable, so the 
user can select it and copy. Is it possible with Win32::MsgBox or any 
other module that is delivered out of the box in ActiveState Perl 
(Win32::GUI is not)?

--
greets,
rocku
___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: Win32::Printer print image

2009-08-18 Thread Ed Zarger
Since this discussion went off-list,
I'll summarize ...

The Win32::Printer module is available built with FreeImage, at the 
bribes repository, at least.

Mario succeeded in printing a .jpeg using the $dc->Image command,
the 3 argument version.

I found that the 5 argument version of $dc->Image allowed printing
of .tif files.

Look in the documentation of Win32::Printer, especially for the Image 
method. That should give the results you're looking for, with a little 
effort.

Ed Zarger wrote:
> I don't have my code here now, but I know that Win32::Printer can work 
> well with .tif files.
> 
> In order to print a .tif file, you need the FreeImage.dll library 
> (freely available from sourceforge).
> My first idea is that you may not have that, or your Win32::Printer may 
> not have been built with that. I'm not sure if the CPAN available 
> modules were built with FreeImage. If not, it must have been easy to 
> build them with mingw, since that's how I would have done it.
> 
> I'll look at my code at my other computer tomorrow, if I can, and let 
> you know if any other ideas jump out at me.
> 
> Ed Z
> 
> Goerres, Mario wrote:
>> Hi @ll,
>>
>>  
>>
>> I have problems with the Module Win32::Printer.
>>
>> If I print a document with write and brush, how it make in the example, 
>> I get an positve result.
>>
>>  
>>
>> Now, I will to print an image and I get an blanko paper.  Where is my 
>> mistake?
>>
>>  
>>
>> My code:
>>
>>  
>>
>> use Win32::Printer ;
>>
>>  
>>
>> $filename = "E:\\test\\09696395.tif" ; 
>>
>>  
>>
>>  my $dc = new Win32::Printer(
>>
>> papersize   => A4,
>>
>> dialog  => NOSELECTION ,
>>
>> description => ‚Test Image',
>>
>> unit=> 'mm'
>>
>> );
>>
>>
>>
>> $dc->PBegin();
>>
>>  
>>
>>   $image_handle = $dc->Image( $filename );
>>
>>  
>>
>>  ($width, $height) = $dc->Image( $filename );
>>
>>  
>>
>>  
>>
>>$dc->PEnd();
>>
>>   $dc->PDraw(  );
>>
>>  
>>
>> # $dc->End();   
>>
>>  $dc->Close();
>>
>>  
>>
>> I tried it with PBegin() and PEnd() Tags and I tried without it. The 
>> result will be a blanko paper.
>>
>>  
>>
>> I hope you could help me.
>>
>>  
>>
>>  
>>
>> Best wishes
>>
>> Mario
>>
>>  
>>
>>
>> 
>>
>> ___
>> Perl-Win32-Users mailing list
>> Perl-Win32-Users@listserv.ActiveState.com
>> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
> 
> 
> ___
> Perl-Win32-Users mailing list
> Perl-Win32-Users@listserv.ActiveState.com
> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
> 


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


Re: Win32::Printer print image

2009-08-13 Thread Ed Zarger
I don't have my code here now, but I know that Win32::Printer can work 
well with .tif files.

In order to print a .tif file, you need the FreeImage.dll library 
(freely available from sourceforge).
My first idea is that you may not have that, or your Win32::Printer may 
not have been built with that. I'm not sure if the CPAN available 
modules were built with FreeImage. If not, it must have been easy to 
build them with mingw, since that's how I would have done it.

I'll look at my code at my other computer tomorrow, if I can, and let 
you know if any other ideas jump out at me.

Ed Z

Goerres, Mario wrote:
> Hi @ll,
> 
>  
> 
> I have problems with the Module Win32::Printer.
> 
> If I print a document with write and brush, how it make in the example, 
> I get an positve result.
> 
>  
> 
> Now, I will to print an image and I get an blanko paper.  Where is my 
> mistake?
> 
>  
> 
> My code:
> 
>  
> 
> use Win32::Printer ;
> 
>  
> 
> $filename = "E:\\test\\09696395.tif" ; 
> 
>  
> 
>  my $dc = new Win32::Printer(
> 
> papersize   => A4,
> 
> dialog  => NOSELECTION ,
> 
> description => ‚Test Image',
> 
> unit=> 'mm'
> 
> );
> 
>
> 
> $dc->PBegin();
> 
>  
> 
>   $image_handle = $dc->Image( $filename );
> 
>  
> 
>  ($width, $height) = $dc->Image( $filename );
> 
>  
> 
>  
> 
>$dc->PEnd();
> 
>   $dc->PDraw(  );
> 
>  
> 
> # $dc->End();   
> 
>  $dc->Close();
> 
>  
> 
> I tried it with PBegin() and PEnd() Tags and I tried without it. The 
> result will be a blanko paper.
> 
>  
> 
> I hope you could help me.
> 
>  
> 
>  
> 
> Best wishes
> 
> Mario
> 
>  
> 
> 
> 
> 
> ___
> Perl-Win32-Users mailing list
> Perl-Win32-Users@listserv.ActiveState.com
> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


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


RE: Win32-TaskScheduler problem with remote systems

2009-05-15 Thread Brian Raven
David Evans <> wrote:
> Hey guys
> 
> I hope you can help.  Trying to create scheduled tasks on remote
> machines with Win32-TaskScheduler, the code appears to create the
> task successfully but it creates the task locally, not the specified
> remote machine.   
> 
> ***CODE***
> use Win32::TaskScheduler;
> 
> $scheduler = Win32::TaskScheduler->New();
> 
> %trig=(
> 'BeginYear' => 2009,
> 'BeginMonth' => 5,
> 'BeginDay' => 13,
> 'StartHour' => 17,
> 'StartMinute' => 37,
> 'TriggerType' =>
> $scheduler->TASK_TIME_TRIGGER_MONTHLYDOW,
> 'Type'=>{
> 'WhichWeek' => $scheduler->TASK_FIRST_WEEK |
> $scheduler->TASK_LAST_WEEK, 'DaysOfTheWeek'
> => $scheduler->TASK_FRIDAY |
> $scheduler->TASK_MONDAY, 'Months' =>
> $scheduler->TASK_JANUARY | $scheduler->TASK_APRIL |
> $scheduler->TASK_JULY | $scheduler->TASK_OCTOBER, }, );
> $tsk="wibble"; 
> 
> foreach $k (keys %trig) {print "$k=" . $trig{$k} . "\n";}
> $hostName = "remsvr";
> $usr = "remuser";
> $pwd = "rempw";
> $scheduler->NewWorkItem($tsk,\%trig);
> print($scheduler->SetTargetComputer($hostName));
> print(" set $hostName\n");
> print($scheduler->SetAccountInformation($usr,$pwd));
> print(" set $usr\n");
> $scheduler->SetApplicationName("winword.exe");
> $scheduler->Save();
> ***END CODE***
> 
> ***OUTPUT***
> C:\Scripting\File_Distro>Schedule-test.pl
> BeginYear=2009
> Type=HASH(0x22704c)
> StartHour=17
> BeginMonth=5
> StartMinute=37
> TriggerType=4
> BeginDay=13
> 1 set \\remsvr
> 1 set remuser
> ***END OUTPUT***
> 
> This is the example straight out of the docs with the
> SetAccountInformation and SetTargetComputer functions added. 
> 
> Windows XP SP2
> Perl 5.8.8 822 [280952]
> Win32-TaskScheduler 2.0.2
> 
> Any help would be greatly appreciated.

This is just a guess, but the example script
(http://cpansearch.perl.org/src/UNICOLET/Win32-TaskScheduler2.0.3/Exampl
e.pl) calls SetTargetComputer before calling Activate, so perhaps you
should try moving the call to before NewWorkItem, which creates a new
active task, in your script.

As I said, just a guess.

HTH

-- 
Brian Raven 
This e-mail may contain confidential and/or privileged information. If you are 
not the intended recipient or have received this e-mail in error, please advise 
the sender immediately by reply e-mail and delete this message and any 
attachments without retaining a copy.

Any unauthorised copying, disclosure or distribution of the material in this 
e-mail is strictly forbidden.

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


RE: Win32::ODBC

2009-05-07 Thread Schwartz, Peter (JPMC)
Yes.  The sql works fine against the DB directly.  It's a stored
procedure with output variables.  I can run the contents of the stored
proc within my perl code, but not the proc itself.  I'm wondering if
it's a driver issue.

 

 

Peter W Schwartz

Vice-President

IB Technology - Prime Brokerage / JP Morgan Chase 

(973) 793-7407

  _  

From: perl-win32-users-boun...@listserv.activestate.com
[mailto:perl-win32-users-boun...@listserv.activestate.com] On Behalf Of
Paul Rogers
Sent: Wednesday, May 06, 2009 9:18 PM
To: perl-win32-users@listserv.ActiveState.com
Subject: RE: Win32::ODBC

 

Have you attempted to execute this SQL code in DB2 prior?  In other
words skip the perl middleman altogether and see if it's something with
your SQL statement.

 

Paul ---

 

From: perl-win32-users-boun...@listserv.activestate.com
[mailto:perl-win32-users-boun...@listserv.activestate.com] On Behalf Of
Schwartz, Peter (JPMC)
Sent: Wednesday, May 06, 2009 5:45 PM
To: Paul Rogers; perl-win32-users@listserv.ActiveState.com
Subject: RE: Win32::ODBC

 

Nope.  The results are the same error.  Could it have to do with the
stored procedure having output variables?

 

 

Peter W Schwartz

Vice-President

IB Technology - Prime Brokerage / JP Morgan Chase 

 



This email is confidential and subject to important disclaimers and
conditions including on offers for the purchase or sale of
securities, accuracy and completeness of information, viruses,
confidentiality, legal privilege, and legal entity disclaimers,
available at http://www.jpmorgan.com/pages/disclosures/email.  ___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: Win32::ODBC

2009-05-06 Thread Paul Rogers
Have you attempted to execute this SQL code in DB2 prior?  In other words
skip the perl middleman altogether and see if it's something with your SQL
statement.
 
Paul ---
 
From: perl-win32-users-boun...@listserv.activestate.com
[mailto:perl-win32-users-boun...@listserv.activestate.com] On Behalf Of
Schwartz, Peter (JPMC)
Sent: Wednesday, May 06, 2009 5:45 PM
To: Paul Rogers; perl-win32-users@listserv.ActiveState.com
Subject: RE: Win32::ODBC
 
Nope.  The results are the same error.  Could it have to do with the stored
procedure having output variables?
 
 
Peter W Schwartz
Vice-President
IB Technology - Prime Brokerage / JP Morgan Chase 
 
___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: Win32::ODBC

2009-05-06 Thread Paul Rogers
> -Original Message-
> From: perl-win32-users-boun...@listserv.activestate.com [mailto:perl-
> > I'd suggest you strongly consider switching to DBI/DBD::ODBC (1.21).
> > Win32::ODBC is obfuscated.
> 
> I believe you mean "obsolete" (should not be used because something
> better is available), not "obfuscated" (made hard to read).

Yes...you're absolutely right. The word is _obsolete_, not "obfuscated". :-)
 
> With that change I generally agree. OTOH, if you want to create DSNs,
> then DBD::ODBC is not gonna help, Win32::ODBC will.

DSNs can also be created by directly writing to the registry as well (using
any number of registry editing modules).  But I digress.

Paul ---



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


RE: Win32::ODBC

2009-05-06 Thread Jenda Krynicky
From:   "Paul Rogers" 
To: 
Subject:    RE: Win32::ODBC
Date sent:  Wed, 6 May 2009 14:43:53 -0400

> I'd suggest you strongly consider switching to DBI/DBD::ODBC (1.21).
> Win32::ODBC is obfuscated.

I believe you mean "obsolete" (should not be used because something 
better is available), not "obfuscated" (made hard to read).


With that change I generally agree. OTOH, if you want to create DSNs, 
then DBD::ODBC is not gonna help, Win32::ODBC will.

Jenda
= je...@krynicky.cz === http://Jenda.Krynicky.cz =
When it comes to wine, women and song, wizards are allowed 
to get drunk and croon as much as they like.
-- Terry Pratchett in Sourcery

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


RE: Win32::ODBC

2009-05-06 Thread Schwartz, Peter (JPMC)
Nope.  The results are the same error.  Could it have to do with the
stored procedure having output variables?

 

 

Peter W Schwartz

Vice-President

IB Technology - Prime Brokerage / JP Morgan Chase 

(973) 793-7407

  _  

From: perl-win32-users-boun...@listserv.activestate.com
[mailto:perl-win32-users-boun...@listserv.activestate.com] On Behalf Of
Paul Rogers
Sent: Wednesday, May 06, 2009 2:44 PM
To: perl-win32-users@listserv.ActiveState.com
Subject: RE: Win32::ODBC

 

I'd suggest you strongly consider switching to DBI/DBD::ODBC (1.21).
Win32::ODBC is obfuscated.

 

Try with DBI/DBD::ODBC and see if results change.

 

Paul ---

 

 

From: perl-win32-users-boun...@listserv.activestate.com
[mailto:perl-win32-users-boun...@listserv.activestate.com] On Behalf Of
Schwartz, Peter (JPMC)
Sent: Wednesday, May 06, 2009 2:25 PM
To: perl-win32-users@listserv.ActiveState.com
Subject: Win32::ODBC

 

I'm having problems running  a stored procedure using the Win32::ODBC
package.  I am executing the following:

sql statement: "call BSCPROC.PHCT110 ('JAG','12345670','',.7,
'2009-05-02','2009-05-03', NULL,NULL,' ', '45','petes',?,?,?,?,?)"

and I get back the following message:

Error: "-9[IBM][CLI Driver] CLI0100E  Wrong number of parameters.
SQLSTATE=0700110"

 

I've checked multiple times and am sending the correct number of
parameters.  The driver I am using is:

IBM DB2 ODBC DRIVER version 8.01.12.99

 

I have done some searching and tried things like setting AUTOCOMMIT off,
but no luck.

 

Has anyone seen this before?  

 

Thanks,

Peter

 

 

 

 

Peter W Schwartz

Vice-President

IB Technology - Prime Brokerage / JP Morgan Chase 

(973) 793-7407

 

  _  

This email is confidential and subject to important disclaimers and
conditions including on offers for the purchase or sale of securities,
accuracy and completeness of information, viruses, confidentiality,
legal privilege, and legal entity disclaimers, available at
http://www.jpmorgan.com/pages/disclosures/email. 



This email is confidential and subject to important disclaimers and
conditions including on offers for the purchase or sale of
securities, accuracy and completeness of information, viruses,
confidentiality, legal privilege, and legal entity disclaimers,
available at http://www.jpmorgan.com/pages/disclosures/email.  ___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: Win32::ODBC

2009-05-06 Thread Paul Rogers
I'd suggest you strongly consider switching to DBI/DBD::ODBC (1.21).
Win32::ODBC is obfuscated.
 
Try with DBI/DBD::ODBC and see if results change.
 
Paul ---
 
 
From: perl-win32-users-boun...@listserv.activestate.com
[mailto:perl-win32-users-boun...@listserv.activestate.com] On Behalf Of
Schwartz, Peter (JPMC)
Sent: Wednesday, May 06, 2009 2:25 PM
To: perl-win32-users@listserv.ActiveState.com
Subject: Win32::ODBC
 
I'm having problems running  a stored procedure using the Win32::ODBC
package.  I am executing the following:
sql statement: "call BSCPROC.PHCT110 ('JAG','12345670','',.7,
'2009-05-02','2009-05-03', NULL,NULL,' ', '45','petes',?,?,?,?,?)"
and I get back the following message:
Error: "-9[IBM][CLI Driver] CLI0100E  Wrong number of parameters.
SQLSTATE=0700110"
 
I've checked multiple times and am sending the correct number of parameters.
The driver I am using is:
IBM DB2 ODBC DRIVER version 8.01.12.99
 
I have done some searching and tried things like setting AUTOCOMMIT off, but
no luck.
 
Has anyone seen this before?  
 
Thanks,
Peter
 
 
 
 
Peter W Schwartz
Vice-President
IB Technology - Prime Brokerage / JP Morgan Chase 
(973) 793-7407
 
  _  

This email is confidential and subject to important disclaimers and
conditions including on offers for the purchase or sale of securities,
accuracy and completeness of information, viruses, confidentiality, legal
privilege, and legal entity disclaimers, available at
http://www.jpmorgan.com/pages/disclosures/email. 
___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: Win32::Process Help Needed - Main Process Exits While Children Run

2009-03-11 Thread Jan Dubois
Hi Michael,

 

You may want to look at the Win32::Job module.  As long as your vendor programs 
don't get started with the "break away from job"
attribute you should be able to check the status of all processes started 
inside the job object.  Maybe some combination of the
watch() and status() methods of the watch object will do what you want.

 

Cheers,

-Jan

 

From: perl-win32-users-boun...@listserv.activestate.com 
[mailto:perl-win32-users-boun...@listserv.activestate.com] On Behalf Of
Michael Cohen
Sent: Wednesday, March 11, 2009 4:26 PM
To: perl-win32-users@listserv.ActiveState.com
Subject: Win32::Process Help Needed - Main Process Exits While Children Run

 


I have a piece of code that has been running for a number of years, until now.  
My vendor changed the way they created a program,
and that new program exits before its children's processes are finished.  In 
the past, the following "snippette" has worked fine for
me: 

my $progFullPath = "c:\\temp\\foobar.exe";# Not the real program 
my $commandLine = "foobar opt1 opt2"; # Again, just an example 
my $ProcessObj; 
Win32::Process::Create($ProcessObj, 
$progFullPath, 
$commandLine, 
0, 
NORMAL_PRIORITY_CLASS, 
".")|| die print Win32::FormatMessage( Win32::GetLastError() ); 
while (!($done)) { 
  $done = 1 if ($ProcessObj->Wait(100)); 
  $main->update;  # TK update 
} 


As noted above, the "Wait(100)" would work fine if the parent program does not 
exit prematurely.  However, now that that is no
longer true: 
a)  How do I determine all of the children processes on Windows (specifically 
XP at this point)? 
b)  How do I wait until all children processes are finished? 

I have been searching the web for various options for several hours, and just 
cannot come up with one at this point.  If anyone has
any suggestions, pointers, solutions, etc., I would be most appreciative of 
your help. 

Regards,
Michael Cohen

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


RE: Win32::Printer???

2009-02-23 Thread Ken Cornetet
If memory serves, you can share the printer, then just treat it like a
UNC file path.

For example, if your computer is named FOGHORN and you share the printer
as LEGHORN, you can do this:
Open FILE, "foghorn\\leghorn"
Print FILE ...
Close FILE



-Original Message-
From: perl-win32-users-boun...@listserv.activestate.com
[mailto:perl-win32-users-boun...@listserv.activestate.com] On Behalf Of
Jon Bjornstad
Sent: Saturday, February 21, 2009 11:51 AM
To: perl-win32-users@listserv.ActiveState.com
Subject: Win32::Printer???

In the activestate ppm repository at:

http://ppm4.activestate.com/idx/W3...WU.html

Win32::Printer is listed but it is not available for download.
The build logs show that there were fatal errors during the build
on 5.8 and 5.10.

If I simply want to send a plain text file to the default
printer what is recommended?

Thank you!

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


Re: Win32::Printer???

2009-02-21 Thread Justin Allegakoen
2009/2/22 Spencer Chase 

>
> Greetings Jon et.al,
>
> I installed win32::printer using the graphical version of PPM. No
> problems installing but it looks like this module is way more than I
> need to just send plain text to a chosen printer, realtime. Any
> suggestions as to how to do this (maybe a sample script?) would be
> appreciated. I want to send simple ASCII text to a printer for which I
> have the control codes. I want to be able to immediately send each
> character and not deal with buffering or anything complex.
>
> Saturday, February 21, 2009, 8:50:51 AM, you wrote:
> JB> In the activestate ppm repository at:
>
> JB> http://ppm4.activestate.com/idx/W3...WU.html
>
> JB> Win32::Printer is listed but it is not available for download.
> JB> The build logs show that there were fatal errors during the build
> JB> on 5.8 and 5.10.
>
> JB> If I simply want to send a plain text file to the default
> JB> printer what is recommended?
>
> JB> Thank you!


This was a thread on one of the AS lists a while back - I'm sure if you
search you'll find it there.

Win32::Printer from memory only works on 5.8 and above and ppm installs fine
on my DOS prompt:-

C:\Perl\Programs>ppm install Win32-Printer
Downloading ActiveState Package Repository packlist...done
Updating ActiveState Package Repository database...done
Downloading Kobes packlist...not modified
Downloading Win32-Printer-0.9...done
Unpacking Win32-Printer-0.9...done
Generating HTML for Win32-Printer-0.9...done
Updating files in site area...done
  10 files installed

C:\Perl\Programs>print /?
Prints a text file.

PRINT [/D:device] [[drive:][path]filename[...]]

   /D:device   Specifies a print device.

C:\Perl\Programs>

Hardly a recommendation since you'll have to call it as a system command,
but Window's native print command should do you just fine.
___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: Win32::TieRegistry question

2008-09-26 Thread anthony . okusanya
From:
Michael Ellery <[EMAIL PROTECTED]>
To:
'perl-win32-users' 
Date:
09/26/2008 01:23 PM
Subject:
Win32::TieRegistry question



Win32-ers,

Does anyone know off-hand what TieRegistry should do with a statment
like this:

$Registry->{'LMachine/Software/Bar'} = {'SubKey/' => { '/SomeValue' => 1 
}};

..specifically, with respect to the type of the SomeValue entry?  I had
thought that it would create a DWORD value since the value assigned is
integer, but based on a quick experiment, I seem to assume wrong (it
creates a REG_SZ).  Anyone have any insight into this?  What's the
"right" way to create/assign REG_SZ values?

Thanks,
Mike Ellery


you need to specify a data type as it defaults to REG_SZ
$Registry->{'LMachine/Software/Bar'} = {'SubKey/' => { '/SomeValue' => [ 
"0x0001", "REG_DWORD" ] }};





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



U.S. BANCORP made the following annotations
-
Electronic Privacy Notice. This e-mail, and any attachments, contains 
information that is, or may be, covered by electronic communications privacy 
laws, and is also confidential and proprietary in nature. If you are not the 
intended recipient, please be advised that you are legally prohibited from 
retaining, using, copying, distributing, or otherwise disclosing this 
information in any manner. Instead, please reply to the sender that you have 
received this communication in error, and then immediately delete it. Thank you 
in advance for your cooperation.



-

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


RE: Win32::FileSecurity problem

2008-08-21 Thread Charles Manafa
Jan,

 

Fortunately, I'm only interested in the Allow DCLs, and currently don't have
any requirement to look at Deny DCLs.

 

Returning the SID for unknown accounts is just perfect for my purposes. I
use the module to produce file systems permission reports.

 

Thanks

Charles

 

  _  

From: Jan Dubois [mailto:[EMAIL PROTECTED] 
Sent: 21 August 2008 22:25
To: 'Charles Manafa'; perl-win32-users@listserv.ActiveState.com
Subject: RE: Win32::FileSecurity problem

 

You are welcome!

 

While fixing the problem I noticed 2 things about the module:

 

1)  It only supports ALLOW DCLs and ignores everything else. Is nobody
using DENY DCLs?

2)  The Get() function will now return the SID if the account name does
not exist. Do you ever need to be able to *set* a DCL using a SID instead of
an account name? Currently you won't be able to call Get(), modify the
returned hash and call Set(). You will have to remove any SID entries first
or Set() will complain.

 

Cheers,

-Jan

 

From: Charles Manafa [mailto:[EMAIL PROTECTED] 
Sent: August 21, 2008 2:07 PM
To: 'Jan Dubois'; perl-win32-users@listserv.ActiveState.com
Subject: RE: Win32::FileSecurity problem

 

Thanks very much, Jan. I've come to rely very heavily on this module.

 

Rgds

Charles

 

  _  

From: Jan Dubois [mailto:[EMAIL PROTECTED] 
Sent: 20 August 2008 19:52
To: 'Charles Manafa'; perl-win32-users@listserv.ActiveState.com
Subject: RE: Win32::FileSecurity problem

 

I've fixed this problem for Win32-FileSecurity-1.08:

 

http://code.google.com/p/libwin32/source/detail?r=433

 

You should see it show up in the beta PPM repository within 2 days or so:

 

http://ppm.activestate.com/beta/

 

It will of course also be included in any upcoming ActivePerl releases.

 

Cheers,

-Jan

 

From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
Charles Manafa
Sent: August 13, 2008 3:32 PM
To: perl-win32-users@listserv.ActiveState.com
Subject: Win32::FileSecurity problem

 

Hi,

 

Has anyone come across an issue with the Win32::FileSecurity module, that
ships with Perl 10, that causes it to croak when trying to retrieve DACL for
a folder for which one of the trustees is an unknown account (i.e account is
represented by it's SID instead of the account name)?

 

This doesn't appear to be an issue with the Win32::FileSecurity module from
Dave Roth. Unfortunately, Dave Roth's module will only work with Perl 817
and below.

 

The specific code extract I'm using is:

 

  use Win32::FileSecurity qw(Get EnumerateRights);

  ...

  Get($folder,\%htrustees);

  while (($trustee, $mask) = each %htrustees) {

  ...

 

The script croaks when it calls the Get function, and the error can not be
trapped. I have tried "eval" to no avail.

 

Any ideas, other than going back to 817, will be greatly appreciated.

 

Thanks

Charles

 

 

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


RE: Win32::FileSecurity problem

2008-08-21 Thread Jan Dubois
You are welcome!

 

While fixing the problem I noticed 2 things about the module:

 

1)  It only supports ALLOW DCLs and ignores everything else. Is nobody 
using DENY DCLs?

2)  The Get() function will now return the SID if the account name does not 
exist. Do you ever need to be able to *set* a DCL
using a SID instead of an account name? Currently you won't be able to call 
Get(), modify the returned hash and call Set(). You will
have to remove any SID entries first or Set() will complain.

 

Cheers,

-Jan

 

From: Charles Manafa [mailto:[EMAIL PROTECTED] 
Sent: August 21, 2008 2:07 PM
To: 'Jan Dubois'; perl-win32-users@listserv.ActiveState.com
Subject: RE: Win32::FileSecurity problem

 

Thanks very much, Jan. I've come to rely very heavily on this module.

 

Rgds

Charles

 

  _  

From: Jan Dubois [mailto:[EMAIL PROTECTED] 
Sent: 20 August 2008 19:52
To: 'Charles Manafa'; perl-win32-users@listserv.ActiveState.com
Subject: RE: Win32::FileSecurity problem

 

I've fixed this problem for Win32-FileSecurity-1.08:

 

http://code.google.com/p/libwin32/source/detail?r=433

 

You should see it show up in the beta PPM repository within 2 days or so:

 

http://ppm.activestate.com/beta/

 

It will of course also be included in any upcoming ActivePerl releases.

 

Cheers,

-Jan

 

From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of
Charles Manafa
Sent: August 13, 2008 3:32 PM
To: perl-win32-users@listserv.ActiveState.com
Subject: Win32::FileSecurity problem

 

Hi,

 

Has anyone come across an issue with the Win32::FileSecurity module, that ships 
with Perl 10, that causes it to croak when trying to
retrieve DACL for a folder for which one of the trustees is an unknown account 
(i.e account is represented by it's SID instead of
the account name)?

 

This doesn't appear to be an issue with the Win32::FileSecurity module from 
Dave Roth. Unfortunately, Dave Roth's module will only
work with Perl 817 and below.

 

The specific code extract I'm using is:

 

  use Win32::FileSecurity qw(Get EnumerateRights);

  ...

  Get($folder,\%htrustees);

  while (($trustee, $mask) = each %htrustees) {

  ...

 

The script croaks when it calls the Get function, and the error can not be 
trapped. I have tried "eval" to no avail.

 

Any ideas, other than going back to 817, will be greatly appreciated.

 

Thanks

Charles

 

 

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


RE: Win32::FileSecurity problem

2008-08-21 Thread Charles Manafa
Thanks very much, Jan. I've come to rely very heavily on this module.

 

Rgds

Charles

 

  _  

From: Jan Dubois [mailto:[EMAIL PROTECTED] 
Sent: 20 August 2008 19:52
To: 'Charles Manafa'; perl-win32-users@listserv.ActiveState.com
Subject: RE: Win32::FileSecurity problem

 

I've fixed this problem for Win32-FileSecurity-1.08:

 

http://code.google.com/p/libwin32/source/detail?r=433

 

You should see it show up in the beta PPM repository within 2 days or so:

 

http://ppm.activestate.com/beta/

 

It will of course also be included in any upcoming ActivePerl releases.

 

Cheers,

-Jan

 

From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
Charles Manafa
Sent: August 13, 2008 3:32 PM
To: perl-win32-users@listserv.ActiveState.com
Subject: Win32::FileSecurity problem

 

Hi,

 

Has anyone come across an issue with the Win32::FileSecurity module, that
ships with Perl 10, that causes it to croak when trying to retrieve DACL for
a folder for which one of the trustees is an unknown account (i.e account is
represented by it's SID instead of the account name)?

 

This doesn't appear to be an issue with the Win32::FileSecurity module from
Dave Roth. Unfortunately, Dave Roth's module will only work with Perl 817
and below.

 

The specific code extract I'm using is:

 

  use Win32::FileSecurity qw(Get EnumerateRights);

  ...

  Get($folder,\%htrustees);

  while (($trustee, $mask) = each %htrustees) {

  ...

 

The script croaks when it calls the Get function, and the error can not be
trapped. I have tried "eval" to no avail.

 

Any ideas, other than going back to 817, will be greatly appreciated.

 

Thanks

Charles

 

 

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


Re: Win32::Lanman and Perl 5.10

2008-08-21 Thread Sisyphus

- Original Message - 
From: "Jan Dubois" <[EMAIL PROTECTED]>
To: "'Bullock, Howard A.'" <[EMAIL PROTECTED]>
Cc: 
Sent: Thursday, August 21, 2008 5:39 AM
Subject: RE: Win32::Lanman and Perl 5.10


> Oops, should have been more careful before replying.  Looks like Jens's 
> modules are all pure GPL and not "same terms as Perl". That
> makes me somewhat less interested in spending time on them.
>

But, once you get co-maintainership, won't you be able to rewrite the 
license ?

Cheers,
Rob 

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


RE: Win32::Lanman and Perl 5.10

2008-08-21 Thread Steve Hay
I contacted Jens back in March 2003 regarding the GPL status of
Win32::Lanman. I asked him if he would consider releasing a new version
with a less restrictive licence so that the company which I'm working
for can distribute it in their commercial software.
 
He replied to say that we could use it under the Artistic License, and
would change the licence paragraph in the next release, but there never
was another release--the latest one that I've seen was January 2003.
 
I haven't had any further contact with him.
 
Steve



From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
Jan Dubois
Sent: 20 August 2008 20:40
To: 'Bullock, Howard A.'
Cc: perl-win32-users@listserv.ActiveState.com
Subject: RE: Win32::Lanman and Perl 5.10



Oops, should have been more careful before replying.  Looks like Jens's
modules are all pure GPL and not "same terms as Perl". That makes me
somewhat less interested in spending time on them.

 

If you ever get a response from Jens, could you ask him if he is willing
to change the licensing terms to the same as Perl (and tell him to
contact me if he wants his code in the libwin32 project repository on
Google, which does use the same dual Artistic/GPL license that Perl
uses).

 

Cheers,

-Jan

 

From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
Jan Dubois
Sent: August 20, 2008 12:29 PM
To: 'Bullock, Howard A.'; perl-win32-users@listserv.ActiveState.com
Subject: RE: Win32::Lanman and Perl 5.10

 

I'll import them into the libwin32 repository at googlecode and try to
make them build automatically for 5.8 and 5.10.

 

Please send me a copy of the message you sent to Jens Helberg. In case I
need to get co-maintainership on CPAN for the module I need to show that
Jens has been unresponsive for a while.

 

Cheers,

-Jan

 

From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
Bullock, Howard A.
Sent: August 20, 2008 12:13 PM
To: perl-win32-users@listserv.ActiveState.com
Subject: Win32::Lanman and Perl 5.10

 

Microsoft has told me that the Win32-Lanman API will continue to exist
in all flavors of Windows 2008.  This being the case and to avoid a
large amount of code rewrites, shouldn't Win32::Lanman be updated to
work with Perl 5.10?

I have sent email to the author, but have not received any replies to my
queries. Would someone else pick this up so that it can continue to be
used with the latest receive of Perl?

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


RE: Win32::Lanman and Perl 5.10

2008-08-20 Thread Jan Dubois
Oops, should have been more careful before replying.  Looks like Jens's modules 
are all pure GPL and not "same terms as Perl". That
makes me somewhat less interested in spending time on them.

 

If you ever get a response from Jens, could you ask him if he is willing to 
change the licensing terms to the same as Perl (and tell
him to contact me if he wants his code in the libwin32 project repository on 
Google, which does use the same dual Artistic/GPL
license that Perl uses).

 

Cheers,

-Jan

 

From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jan
Dubois
Sent: August 20, 2008 12:29 PM
To: 'Bullock, Howard A.'; perl-win32-users@listserv.ActiveState.com
Subject: RE: Win32::Lanman and Perl 5.10

 

I'll import them into the libwin32 repository at googlecode and try to make 
them build automatically for 5.8 and 5.10.

 

Please send me a copy of the message you sent to Jens Helberg. In case I need 
to get co-maintainership on CPAN for the module I need
to show that Jens has been unresponsive for a while.

 

Cheers,

-Jan

 

From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of
Bullock, Howard A.
Sent: August 20, 2008 12:13 PM
To: perl-win32-users@listserv.ActiveState.com
Subject: Win32::Lanman and Perl 5.10

 

Microsoft has told me that the Win32-Lanman API will continue to exist in all 
flavors of Windows 2008.  This being the case and to
avoid a large amount of code rewrites, shouldn't Win32::Lanman be updated to 
work with Perl 5.10?

I have sent email to the author, but have not received any replies to my 
queries. Would someone else pick this up so that it can
continue to be used with the latest receive of Perl?

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


RE: Win32::Lanman and Perl 5.10

2008-08-20 Thread Jan Dubois
I'll import them into the libwin32 repository at googlecode and try to make 
them build automatically for 5.8 and 5.10.

 

Please send me a copy of the message you sent to Jens Helberg. In case I need 
to get co-maintainership on CPAN for the module I need
to show that Jens has been unresponsive for a while.

 

Cheers,

-Jan

 

From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of
Bullock, Howard A.
Sent: August 20, 2008 12:13 PM
To: perl-win32-users@listserv.ActiveState.com
Subject: Win32::Lanman and Perl 5.10

 

Microsoft has told me that the Win32-Lanman API will continue to exist in all 
flavors of Windows 2008.  This being the case and to
avoid a large amount of code rewrites, shouldn't Win32::Lanman be updated to 
work with Perl 5.10?

I have sent email to the author, but have not received any replies to my 
queries. Would someone else pick this up so that it can
continue to be used with the latest receive of Perl?

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


RE: Win32::FileSecurity problem

2008-08-20 Thread Jan Dubois
I've fixed this problem for Win32-FileSecurity-1.08:

 

http://code.google.com/p/libwin32/source/detail?r=433

 

You should see it show up in the beta PPM repository within 2 days or so:

 

http://ppm.activestate.com/beta/

 

It will of course also be included in any upcoming ActivePerl releases.

 

Cheers,

-Jan

 

From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of
Charles Manafa
Sent: August 13, 2008 3:32 PM
To: perl-win32-users@listserv.ActiveState.com
Subject: Win32::FileSecurity problem

 

Hi,

 

Has anyone come across an issue with the Win32::FileSecurity module, that ships 
with Perl 10, that causes it to croak when trying to
retrieve DACL for a folder for which one of the trustees is an unknown account 
(i.e account is represented by it's SID instead of
the account name)?

 

This doesn't appear to be an issue with the Win32::FileSecurity module from 
Dave Roth. Unfortunately, Dave Roth's module will only
work with Perl 817 and below.

 

The specific code extract I'm using is:

 

  use Win32::FileSecurity qw(Get EnumerateRights);

  ...

  Get($folder,\%htrustees);

  while (($trustee, $mask) = each %htrustees) {

  ...

 

The script croaks when it calls the Get function, and the error can not be 
trapped. I have tried "eval" to no avail.

 

Any ideas, other than going back to 817, will be greatly appreciated.

 

Thanks

Charles

 

 

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


RE: WIN32::OLE help

2008-08-18 Thread Brian Raven
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
Neson Maxmelbin (RBEI/EMT4)
Sent: 18 August 2008 09:40
To: Steve Howard (PFE); perl-win32-users@listserv.ActiveState.com
Subject: RE: WIN32::OLE help

> Hello Steve,
>  
> It does work and my machine shows the same values for minimise and
maximise ..
> But what does these value depend on ?
>  
> I checked in another machine and the maximise value is -4137 ... 
>  
> Where do i find the constants declared for these ?

They are declared by the module that you have already included, i.e.
Win32::OLE::Const. See the documentation for that module (you should
probably have done that before using it in your code). However, as I am
feeling generous, try either:

use Win32::OLE::Const 'Microsoft Excel';
print "xlMaximized: ", xlMaximized, "\n";
print "xlMinimized: ", xlMinimized, "\n";
print "xlNormal: ", xlNormal, "\n";

... or if you don't want to polute your main namespace so much try this:

use Win32::OLE::Const;
my $consts = Win32::OLE::Const->Load('Microsoft Excel');
print "xlMaximized: $consts->{xlMaximized}\n";
print "xlMinimized: $consts->{xlMinimized}\n";
print "xlNormal: $consts->{xlNormal}\n";

To find the constant names, or anything to do with using OLE on such
applications, it is useful to read the relevant parts of the Visual
Basic Reference for that application, under the help menu. Another
damned useful tool is the OLE browser kindly provided with the
Activestate documentation. I found the constant names mentioned above in
both.

HTH

-- 
Brian Raven 


Visit our website at http://www.nyse.com



Note: The information contained in this message and any attachment to it is 
privileged, confidential and protected from disclosure. If the reader of this 
message is not the intended recipient, or an employee or agent responsible for 
delivering this message to the intended recipient, you are hereby notified that 
any dissemination, distribution or copying of this communication is strictly 
prohibited.
If you have received this communication in error, please notify the sender 
immediately by replying to the message, and please delete it from your system. 
Thank you. NYSE Group, Inc.


__
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
__
___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: WIN32::OLE help

2008-08-18 Thread Neson Maxmelbin (RBEI/EMT4)
Hello Steve,

It does work and my machine shows the same values for minimise and maximise ..
But what does these value depend on ?

I checked in another machine and the maximise value is -4137 ...

Where do i find the constants declared for these ?

Thanks and Regards
Maxmelbin Neson




From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Steve Howard 
(PFE)
Sent: Friday, 15. August 2008 1:34 AM
To: Neson Maxmelbin (RBEI/EMT4); perl-win32-users@listserv.ActiveState.com
Subject: RE: WIN32::OLE help

I'll type this directly in so I might make a typo. You should be able to set 
the state in the application object:

$Excel->{WindowState} = -4140;

To set back to normal mode:

$Excel->{WindowState} = -4143;

The way to find this is to record a macro in Excel, and do what you want to 
see. Then view the macros and see what was done. In this case, the macro uses 
constants xlMinimized, and xlNormal. You can use the object browser to see the 
values of those constants. They're probably in the constants you have imported 
as well, so it would probably be better to use them there rather than the 
literal values.

See if this helps.

Steve

From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Neson Maxmelbin 
(RBEI/EMT4)
Sent: Thursday, August 14, 2008 4:30 AM
To: perl-win32-users@listserv.ActiveState.com
Subject: WIN32::OLE help


Hello ,

I am using WIn32::OLE to Read contents of an Excel sheet.
There is no issues on reading, but the problem is that Excel file opens on the 
screen, during the time the script processes the file.

I don't need this.
One solution was to make it not visible ($Excel->{'Visible'} = 0;).
But this had some other problems. In some cases, when this Excel sheet was open 
for viewing, its contents were hidden ! , when we move the mouse over the 
cells, then we see it .. might be a Excel Bug. Due this we cannot make the 
Excel sheet invisible during the runnign of the script.

What I need now is to minimise the sheet once it is opened. How do we do it ?

My code extract -

use Win32::OLE::Const 'Microsoft Excel';

$Excel = Win32::OLE->GetActiveObject('Excel.Application')|| 
Win32::OLE->new('Excel.Application', 'Quit');

$Excel->{'Visible'} = 1;

$xlFile = 'C:\HWEConfig.xls';

eval { $Book = $Excel->Workbooks->Open("$xlFile"); };

... then the reading 





Thanks and Regards
Maxmelbin Neson


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


RE: WIN32::OLE help

2008-08-14 Thread Steve Howard (PFE)
I'll type this directly in so I might make a typo. You should be able to set 
the state in the application object:

$Excel->{WindowState} = -4140;

To set back to normal mode:

$Excel->{WindowState} = -4143;

The way to find this is to record a macro in Excel, and do what you want to 
see. Then view the macros and see what was done. In this case, the macro uses 
constants xlMinimized, and xlNormal. You can use the object browser to see the 
values of those constants. They're probably in the constants you have imported 
as well, so it would probably be better to use them there rather than the 
literal values.

See if this helps.

Steve

From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Neson Maxmelbin 
(RBEI/EMT4)
Sent: Thursday, August 14, 2008 4:30 AM
To: perl-win32-users@listserv.ActiveState.com
Subject: WIN32::OLE help


Hello ,

I am using WIn32::OLE to Read contents of an Excel sheet.
There is no issues on reading, but the problem is that Excel file opens on the 
screen, during the time the script processes the file.

I don't need this.
One solution was to make it not visible ($Excel->{'Visible'} = 0;).
But this had some other problems. In some cases, when this Excel sheet was open 
for viewing, its contents were hidden ! , when we move the mouse over the 
cells, then we see it .. might be a Excel Bug. Due this we cannot make the 
Excel sheet invisible during the runnign of the script.

What I need now is to minimise the sheet once it is opened. How do we do it ?

My code extract -

use Win32::OLE::Const 'Microsoft Excel';

$Excel = Win32::OLE->GetActiveObject('Excel.Application')|| 
Win32::OLE->new('Excel.Application', 'Quit');

$Excel->{'Visible'} = 1;

$xlFile = 'C:\HWEConfig.xls';

eval { $Book = $Excel->Workbooks->Open("$xlFile"); };

... then the reading 





Thanks and Regards
Maxmelbin Neson


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


Re: WIN32::OLE help

2008-08-14 Thread ekkehard . goerlach
Hello,

if you just want to read data from an Excel file, you might consider the 
Spreadsheet::ParseExcel module. I would think that using the OLE module 
always starts an Excel instance (visible or not) whereas the Spreadsheet 
module operates directly on the XLS file. 

Ekkehard

_

CONFIDENTIALITY NOTICE

The information contained in this e-mail message is intended only for the 
exclusive use of the individual or entity named above and may contain 
information that is privileged, confidential or exempt from disclosure 
under applicable law. If the reader of this message is not the intended 
recipient, or the employee or agent responsible for delivery of the 
message to the intended recipient, you are hereby notified that any 
dissemination, distribution or copying of this communication is strictly 
prohibited. If you have received this communication in error, please 
notify the sender immediately by e-mail and delete the material from any 
computer.  Thank you.
___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: Win32::Lanman make computer go argh!

2008-07-09 Thread Sisyphus

- Original Message - 
From: "Barry Brevik" <[EMAIL PROTECTED]>
.
> My test program begins like this:
>  use Win32;
>  use Win32::NetAdmin;
>  use Win32::Lanman;
>
> As soon as it hits "use Win32::Lanman", a gui dialog pops up which
> starts like this:
>
>"Perl Command Line Interpreter has encountered
> a problem and needs to close. We are sorry for
> the inconvenience."
>
.
> I would appreciate any clues as to where to start looking to fix this
> problem.
>

Is any error message printed to the console as well (either before or after 
you close the gui box) ?
Do you get the same behaviour by loading Win32::Lanman only ? ie, does 
running the following produce the same behaviour:

perl -MWin32::Lanman -e 1

Cheers,
Rob 

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


Re: Win32::OLE -- assignment to property of type IUnknown..how?

2008-05-29 Thread Michael Ellery
Jan Dubois wrote:
> On Wed, 28 May 2008, Michael Ellery wrote:
>> I have a COM component with a property defined like this (IDL):
>>
>> [propput, id(30), helpstring("property TestSuite")] HRESULT
>> TestSuite([in] IUnknown *pVal);
> 
> Try adding a second line here:
> 
>   [propputref, id(30), helpstring("property TestSuite")] HRESULT
>   TestSuite([in] IUnknown *pVal);
> 
> (identical to the previous line, except propput => propputref).
> 
> Not sure if this is enough, but maybe it is sufficient to get the
> required IDispatch glue generated for you.
> 
> Cheers,
> -Jan


that seems to do the trick - thank you!

-Mike


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


RE: Win32::OLE -- assignment to property of type IUnknown..how?

2008-05-28 Thread Jan Dubois
On Wed, 28 May 2008, Michael Ellery wrote:
> 
> I have a COM component with a property defined like this (IDL):
> 
> [propput, id(30), helpstring("property TestSuite")] HRESULT
> TestSuite([in] IUnknown *pVal);

Try adding a second line here:

  [propputref, id(30), helpstring("property TestSuite")] HRESULT
  TestSuite([in] IUnknown *pVal);

(identical to the previous line, except propput => propputref).

Not sure if this is enough, but maybe it is sufficient to get the
required IDispatch glue generated for you.

Cheers,
-Jan

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


RE: Win32::OLE problem

2008-05-13 Thread Bullock, Howard A.
Removing the trailing semi-colon did the trick.


From: Howard Tanner [mailto:[EMAIL PROTECTED] 

It's been a while, so I looked it up. From MS:

";(objectClass=*);AdsPath, cn;subTree"

So remove the space before subTree and the semi-colon following it. If
that still doesn't work, your query might be case sensitive, so fix the
capitalization for subTree. 


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


RE: Win32::Process::Create

2008-04-29 Thread Jan Dubois
On Tue, 29 Apr 2008, Shuttlesworth, James wrote:
> 
> I was/am also having this problem, but generally ignored having the
> window- I can say for my part I do normally use backticks for most
> things, but I use win32process when I want more control over the
> process, for instance I want it to run for a certain amount of time and
> then kill it. For instance a little snippet that shows a PowerPoint
> slide for 15 seconds
> 
> Win32::Process::Create($goodfile,
>"c:\\progra~1\\microsoft office\\powerpoint viewer\\PPTVIEW.EXE",
>"PPTVIEW.EXE \"$goodfile\" /s",
>0,
>NORMAL_PRIORITY_CLASS,
>".") || die ErrorReport();
> Win32::Sleep(15000);
> {$goodfile->Kill(0)}

You can still do this with the system(1, ...) syntax too:

my @arg = ('-le', '++$|; while () { print ++$_; sleep(1) }');
my $pid = system(1, $^X, @arg);
sleep(5);
kill 9, $pid;

You should make sure to use the system(1, $prog, @arg) form instead of
the system(1, $cmdline) version because the latter may run your $cmdline
indirectly via the cmd.exe shell[1] and the $pid returned by system() will
then be the pid of the cmd.exe process and not of your actual program.
Killing the cmd.exe shell will not terminate the child process. With
ActivePerl 820 and later you can of course use

kill -9, $pid;

to kill not only $pid, but also all of its child processes. This still
doesn't work right if your program is a GUI application (like the
PowerPoint viewer above), because it will run detached from the cmd.exe
which can finish immediately after launching the GUI.

Oh, one thing I should mention about system(1, ...): Perl is keeping
the list of processes started this way in a table that is also used
to keep track of pseudo-threads created by the fork() emulation.  This
table is limited to something like 64 entries, so make sure you call
either waitpid() or kill() on the pids if you plan to create lots of
child processes over time.  The purpose of this table is that wait()
will now which child processes belong to the current Perl instance.
It also means you cannot have more than 64 child-processes running at
the same time. If you need more, then you have to use Win32::Process.

Cheers,
-Jan

[1] The decision to run a $commandline via cmd.exe is made at least
partially based on the existence of shell metacharacters (at least
'>', '<', '|' and '%', and possibly others) in the commandline.

The other criteria is that if $commandline fails to start without the
shell, then it will be retried via the shell just in case you are trying
to run one of the builtin shell commands ("echo", "dir", etc).


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


Re: Win32::Process::Create

2008-04-29 Thread Michael Ellery
Jan Dubois wrote:

> 
> If you need to wait for your subprocesses, then you may want
> to use this somewhat obscure form:
> 
> my $pid = system(1, $cmdline);
> # ...
> waitpid $pid, 0;
> 
> (This is documented in `perldoc perlport` as a Win32 specific extension
> to system(), but not mentioned in `perldoc -f system`).
> 

okay - thanks to everyone for the advice.  I never knew this 
"non-blocking" version of system() existed - very interesting.  Based on 
my quick tests, it looks like this version might still use the shell 
(although I can't tell).  For instance, I wasn't able to start a cmd.exe 
instance to run a  batch file using system(1, ...) in my quick tests, 
but that might have been pilot error.  I'll give Win32::GUI::Show a shot 
- that might be my best option for now.

Thanks,
Mike


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


RE: Win32::Process::Create

2008-04-29 Thread Shuttlesworth, James
I was/am also having this problem, but generally ignored having the
window- I can say for my part I do normally use backticks for most
things, but I use win32process when I want more control over the
process, for instance I want it to run for a certain amount of time and
then kill it. For instance a little snippet that shows a PowerPoint
slide for 15 seconds

Win32::Process::Create($goodfile,
   "c:\\progra~1\\microsoft office\\powerpoint viewer\\PPTVIEW.EXE",
 "PPTVIEW.EXE \"$goodfile\" /s",
   0,
   NORMAL_PRIORITY_CLASS,
   ".") || die ErrorReport();
Win32::Sleep(15000);
{$goodfile->Kill(0)}

--
James Shuttlesworth
Network Technologies Manager
Ursinus College
Computing Services
[EMAIL PROTECTED]
 
 

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
Stuart Arnold
Sent: Tuesday, April 29, 2008 2:47 AM
To: 'Michael Ellery'; 'perl-win32-users'
Subject: RE: Win32::Process::Create


Not sure why you use Win32Process (I' am sure you have your reasons),
but I have scripts that launch child processes and wait for them to
terminate. I just use the backticks(``) rather than a "system" command.
The script will just hang until the child is done.

For the other thing about minimizing/hiding the console window,
Win32::GUI can do this:

use Win32::GUI; 
my $perlwin = Win32::GUI::GetPerlWindow();
Win32::GUI::Show( $perlwin, 0 ); # SW_HIDE
Win32::GUI::Show( $perlwin, 1 ); # SW_SHOWNORMAL Win32::GUI::Show(
$perlwin, 5 ); # SW_SHOW Win32::GUI::Show( $perlwin, 6 ); # SW_MINIMIZE


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
Michael Ellery
Sent: Monday, April 28, 2008 3:24 PM
To: 'perl-win32-users'
Subject: Win32::Process::Create

..I use this function pretty regularly to spawn procs on windows, but 
I've often wanted to minimize the console or main window that was 
launched. Does anyone know how to do this? In the corresponding WIN32 
API, there is a STARTUPINFO structure that allows this, but looks like 
it's not part of the Win32::Process API. Advice appreciated.
-Mike Ellery
___
Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

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


RE: Win32::Process::Create

2008-04-28 Thread Stuart Arnold

Not sure why you use Win32Process (I' am sure you have your reasons),
but I have scripts that launch child processes and wait for them to
terminate. I just use the backticks(``) rather than a "system" command.
The script will just hang until the child is done.

For the other thing about minimizing/hiding the console window,
Win32::GUI can do this:

use Win32::GUI; 
my $perlwin = Win32::GUI::GetPerlWindow();
Win32::GUI::Show( $perlwin, 0 ); # SW_HIDE
Win32::GUI::Show( $perlwin, 1 ); # SW_SHOWNORMAL Win32::GUI::Show(
$perlwin, 5 ); # SW_SHOW Win32::GUI::Show( $perlwin, 6 ); # SW_MINIMIZE


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
Michael Ellery
Sent: Monday, April 28, 2008 3:24 PM
To: 'perl-win32-users'
Subject: Win32::Process::Create

..I use this function pretty regularly to spawn procs on windows, but 
I've often wanted to minimize the console or main window that was 
launched. Does anyone know how to do this? In the corresponding WIN32 
API, there is a STARTUPINFO structure that allows this, but looks like 
it's not part of the Win32::Process API. Advice appreciated.
-Mike Ellery
___
Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

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


RE: Win32::Process::Create

2008-04-28 Thread Jan Dubois
On Mon, 28 Apr 2008, Michael Ellery wrote:
> 
> ..I use this function pretty regularly to spawn procs on windows, but
> I've often wanted to minimize the console or main window that was
> launched.  Does anyone know how to do this?  In the corresponding WIN32
> API, there is a STARTUPINFO structure that allows this, but looks like
> it's not part of the Win32::Process API.  Advice appreciated.

You cannot do this currently with Win32::Process, so you may want
to file an enhancement request at

http://rt.cpan.org/Public/Dist/Display.html?Name=Win32-Process

You could achieve the functionality with the standard system()
function though.  Just call e.g.

Win32::SetChildShowWindow(Win32::SW_SHOWMINIMIZED);
or
Win32::SetChildShowWindow(Win32::SW_HIDE);

to run processes minimized, or even without a window at all.
See `perldoc Win32` for the Win32""SetChildShowWindow() docs.

If you need to wait for your subprocesses, then you may want
to use this somewhat obscure form:

my $pid = system(1, $cmdline);
# ...
waitpid $pid, 0;

(This is documented in `perldoc perlport` as a Win32 specific extension
to system(), but not mentioned in `perldoc -f system`).

Cheers,
-Jan


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


Re: Win32::Process::Create

2008-04-28 Thread Michael Ellery
Sisyphus wrote:

> 
> What happens if you launch the script using the wperl executable instead 
> of the perl executable ?
> 

I don't even know what wperl is, although it does look like it's part of 
my current perl install (I have never heard of it before now). In any 
event, it's not an option for us since most of our stuff runs in the 
context of the perlSE.dll (ActiveScript engine).

> Have you checked the various flags constants ? From the docs:
> 
> --
> EXPORTS
>The following constants are exported by default:
> 
>CREATE_DEFAULT_ERROR_MODE

> --
> 
> I was thinking specifically of CREATE_NO_WINDOW constant (but perhaps 
> that does something else).
> 

I believe this corresponds to this process creation flag (from MSDN docs):


CREATE_NO_WINDOW
0x0800

The process is a console application that is being run without a console 
window. Therefore, the console handle for the application is not set.

This flag is ignored if the application is not a console application, or 
if it is used with either CREATE_NEW_CONSOLE or DETACHED_PROCESS.


I'm really looking for something that works more generally (for console 
and non-console apps alike).  In older versions of the win32 API, I'm 
pretty sure there was a field in the STARTUPINFO that allowed the caller 
to request the app be started mimimized, but the current docs don't show 
such an option.

Perhaps my best bet it to try to call ShowWindow directly ??




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


Re: Win32::Process::Create

2008-04-28 Thread Sisyphus

- Original Message - 
From: "Michael Ellery" <[EMAIL PROTECTED]>
To: "'perl-win32-users'" 
Sent: Tuesday, April 29, 2008 5:24 AM
Subject: Win32::Process::Create


> ..I use this function pretty regularly to spawn procs on windows, but
> I've often wanted to minimize the console or main window that was
> launched.  Does anyone know how to do this?  In the corresponding WIN32
> API, there is a STARTUPINFO structure that allows this, but looks like
> it's not part of the Win32::Process API.  Advice appreciated.

Jst a couple of thoughts - I don't have time to test any of this out at the 
moment.

What happens if you launch the script using the wperl executable instead of 
the perl executable ?

Have you checked the various flags constants ? From the docs:

--
EXPORTS
The following constants are exported by default:

CREATE_DEFAULT_ERROR_MODE
CREATE_NEW_CONSOLE
CREATE_NEW_PROCESS_GROUP
CREATE_NO_WINDOW
CREATE_SEPARATE_WOW_VDM
CREATE_SUSPENDED
CREATE_UNICODE_ENVIRONMENT
DEBUG_ONLY_THIS_PROCESS
DEBUG_PROCESS
DETACHED_PROCESS
HIGH_PRIORITY_CLASS
IDLE_PRIORITY_CLASS
INFINITE
NORMAL_PRIORITY_CLASS
REALTIME_PRIORITY_CLASS
THREAD_PRIORITY_ABOVE_NORMAL
THREAD_PRIORITY_BELOW_NORMAL
THREAD_PRIORITY_ERROR_RETURN
THREAD_PRIORITY_HIGHEST
THREAD_PRIORITY_IDLE
THREAD_PRIORITY_LOWEST
THREAD_PRIORITY_NORMAL
THREAD_PRIORITY_TIME_CRITICAL

The following additional constants are exported by request only:

STILL_ACTIVE
--

I was thinking specifically of CREATE_NO_WINDOW constant (but perhaps that 
does something else).

Cheers,
Rob 

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


RE: win32 service application (like google desktop)

2008-04-03 Thread Jan Dubois
Note: The PPM GUI is written using Tkx, not Tk. Similarly all GUI applications 
in the PDK are written using Tkx and packaged with
PerlApp.

 

You should be able to use Wx::Perl with the PDK tools as well, just remember 
that you need to also use Wx::Perl::Packager:

 

http://www.gigi.co.uk/wxperl/

 

Cheers,

-Jan

 

From: Edward Peschko [mailto:[EMAIL PROTECTED] 
Sent: April 3, 2008 10:43 AM
To: Foo JH
Cc: Jan Dubois; Perl-Win32-Users@listserv.activestate.com
Subject: Re: win32 service application (like google desktop)

 

wow, this is cool.. Just one more question..

If I am going to make a standalone executable for installation on another host, 
are there any preferred GUI packages that I should
use? ie: ppm is written in Tk, should I stick with that? Or have people used 
Wx::Perl as well?

Ed

On Wed, Apr 2, 2008 at 8:11 PM, Foo JH <[EMAIL PROTECTED]> wrote:

Yup, you're still looking at PDK's PerlSvc packager. It's all there buddy.

Edward Peschko wrote:


great.. you are right, that's exactly what I'm looking for..

Now suppose that I want to install a standalone executable such that it is 
integrated into the start menu, and also runs as part of
the startup
sequence on any machine that it is installed on... anything to help there, or 
do I need to write to the registry myself? Are there
any perl based installers out there, anyways?

Thanks much,

Ed

On Wed, Apr 2, 2008 at 4:09 PM, Jan Dubois <[EMAIL PROTECTED] <mailto:[EMAIL 
PROTECTED]>> wrote:

   Check out the PerlTray utility in the Perl Dev Kit it does all the
   things you are looking for:


   http://aspn.activestate.com/ASPN/docs/PDK/7.1/PerlTray.html


   Download a trial version and look at the PerlTray sample programs.


   http://www.activestate.com/Products/perl_dev_kit/index.mhtml?_x=1


   Cheers,

   -Jan


   *From:* [EMAIL PROTECTED]
   <mailto:[EMAIL PROTECTED]>
   [mailto:[EMAIL PROTECTED]
   <mailto:[EMAIL PROTECTED]>] *On
   Behalf Of *Edward Peschko
   *Sent:* April 2, 2008 3:57 PM
   *To:* Perl-Win32-Users@listserv.ActiveState.com

   <mailto:Perl-Win32-Users@listserv.ActiveState.com>


   *Subject:* win32 service application (like google desktop)


   all,

   I wanted to get the following behaviors in a perl script:

   1. a small icon for the perl script, in the lower corner of
   the window (ie: by the system clock). Clicking on this expands the
   existing gui.
   2. a single instance (and only a single instance) of the
   script runs at all times.
   3. mousing over the script displays text associated with that
   script.
   4. no 'cmd' associated with the script.. runs standalone.

   In short, I was looking on how to make a script that behaves like
   the google desktop applet.. Anyone made something like this?

   Ed






___
Perl-Win32-Users mailing list


Perl-Win32-Users@listserv.ActiveState.com

To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
 

 

 

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


Re: win32 service application (like google desktop)

2008-04-03 Thread Edward Peschko
wow, this is cool.. Just one more question..

If I am going to make a standalone executable for installation on another
host, are there any preferred GUI packages that I should use? ie: ppm is
written in Tk, should I stick with that? Or have people used Wx::Perl as
well?

Ed

On Wed, Apr 2, 2008 at 8:11 PM, Foo JH <[EMAIL PROTECTED]> wrote:

> Yup, you're still looking at PDK's PerlSvc packager. It's all there buddy.
>
> Edward Peschko wrote:
>
> >
> > great.. you are right, that's exactly what I'm looking for..
> >
> > Now suppose that I want to install a standalone executable such that it
> > is integrated into the start menu, and also runs as part of the startup
> > sequence on any machine that it is installed on... anything to help
> > there, or do I need to write to the registry myself? Are there any perl
> > based installers out there, anyways?
> >
> > Thanks much,
> >
> > Ed
> >
> > On Wed, Apr 2, 2008 at 4:09 PM, Jan Dubois <[EMAIL PROTECTED] > [EMAIL PROTECTED]>> wrote:
> >
> >Check out the PerlTray utility in the Perl Dev Kit it does all the
> >things you are looking for:
> >
> >
> >http://aspn.activestate.com/ASPN/docs/PDK/7.1/PerlTray.html
> >
> >
> >Download a trial version and look at the PerlTray sample programs.
> >
> >
> >http://www.activestate.com/Products/perl_dev_kit/index.mhtml?_x=1
> >
> >
> >Cheers,
> >
> >-Jan
> >
> >
> >*From:* [EMAIL PROTECTED]
> >
> >[mailto:[EMAIL PROTECTED]
> >] *On
> >Behalf Of *Edward Peschko
> >*Sent:* April 2, 2008 3:57 PM
> >*To:* Perl-Win32-Users@listserv.ActiveState.com
> >
> >*Subject:* win32 service application (like google desktop)
> >
> >
> >all,
> >
> >I wanted to get the following behaviors in a perl script:
> >
> >1. a small icon for the perl script, in the lower corner of
> >the window (ie: by the system clock). Clicking on this expands the
> >existing gui.
> >2. a single instance (and only a single instance) of the
> >script runs at all times.
> >3. mousing over the script displays text associated with that
> >script.
> >4. no 'cmd' associated with the script.. runs standalone.
> >
> >In short, I was looking on how to make a script that behaves like
> >the google desktop applet.. Anyone made something like this?
> >
> >Ed
> >
> >
> >
> > 
> >
> > ___
> > Perl-Win32-Users mailing list
> > Perl-Win32-Users@listserv.ActiveState.com
> > To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
> >
> >
>
>
___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: win32 service application (like google desktop)

2008-04-02 Thread Foo JH
Yup, you're still looking at PDK's PerlSvc packager. It's all there buddy.

Edward Peschko wrote:
>
> great.. you are right, that's exactly what I'm looking for..
>
> Now suppose that I want to install a standalone executable such that 
> it is integrated into the start menu, and also runs as part of the 
> startup
> sequence on any machine that it is installed on... anything to help 
> there, or do I need to write to the registry myself? Are there any 
> perl based installers out there, anyways?
>
> Thanks much,
>
> Ed
>
> On Wed, Apr 2, 2008 at 4:09 PM, Jan Dubois <[EMAIL PROTECTED] 
> > wrote:
>
> Check out the PerlTray utility in the Perl Dev Kit it does all the
> things you are looking for:
>
>  
>
> http://aspn.activestate.com/ASPN/docs/PDK/7.1/PerlTray.html
>
>  
>
> Download a trial version and look at the PerlTray sample programs.
>
>  
>
> http://www.activestate.com/Products/perl_dev_kit/index.mhtml?_x=1
>
>  
>
> Cheers,
>
> -Jan
>
>  
>
> *From:* [EMAIL PROTECTED]
> 
> [mailto:[EMAIL PROTECTED]
> ] *On
> Behalf Of *Edward Peschko
> *Sent:* April 2, 2008 3:57 PM
> *To:* Perl-Win32-Users@listserv.ActiveState.com
> 
> *Subject:* win32 service application (like google desktop)
>
>  
>
> all,
>
> I wanted to get the following behaviors in a perl script:
>
> 1. a small icon for the perl script, in the lower corner of
> the window (ie: by the system clock). Clicking on this expands the
> existing gui.
> 2. a single instance (and only a single instance) of the
> script runs at all times.
> 3. mousing over the script displays text associated with that
> script.
> 4. no 'cmd' associated with the script.. runs standalone.
>
> In short, I was looking on how to make a script that behaves like
> the google desktop applet.. Anyone made something like this?
>
> Ed
>
>
>
> 
>
> ___
> Perl-Win32-Users mailing list
> Perl-Win32-Users@listserv.ActiveState.com
> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
>   

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


Re: win32 service application (like google desktop)

2008-04-02 Thread Edward Peschko
great.. you are right, that's exactly what I'm looking for..

Now suppose that I want to install a standalone executable such that it is
integrated into the start menu, and also runs as part of the startup sequence
on any machine that it is installed on... anything to help there, or do I
need to write to the registry myself? Are there any perl based installers
out there, anyways?

Thanks much,

Ed

On Wed, Apr 2, 2008 at 4:09 PM, Jan Dubois <[EMAIL PROTECTED]> wrote:

>  Check out the PerlTray utility in the Perl Dev Kit it does all the things
> you are looking for:
>
>
>
> http://aspn.activestate.com/ASPN/docs/PDK/7.1/PerlTray.html
>
>
>
> Download a trial version and look at the PerlTray sample programs.
>
>
>
> http://www.activestate.com/Products/perl_dev_kit/index.mhtml?_x=1
>
>
>
> Cheers,
>
> -Jan
>
>
>
> *From:* [EMAIL PROTECTED] [mailto:
> [EMAIL PROTECTED] *On Behalf Of *Edward
> Peschko
> *Sent:* April 2, 2008 3:57 PM
> *To:* Perl-Win32-Users@listserv.ActiveState.com
> *Subject:* win32 service application (like google desktop)
>
>
>
> all,
>
> I wanted to get the following behaviors in a perl script:
>
> 1. a small icon for the perl script, in the lower corner of the window
> (ie: by the system clock). Clicking on this expands the existing gui.
> 2. a single instance (and only a single instance) of the script runs
> at all times.
> 3. mousing over the script displays text associated with that script.
> 4. no 'cmd' associated with the script.. runs standalone.
>
> In short, I was looking on how to make a script that behaves like the
> google desktop applet.. Anyone made something like this?
>
> Ed
>
___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: win32 service application (like google desktop)

2008-04-02 Thread Jan Dubois
Check out the PerlTray utility in the Perl Dev Kit it does all the things you 
are looking for:

 

http://aspn.activestate.com/ASPN/docs/PDK/7.1/PerlTray.html

 

Download a trial version and look at the PerlTray sample programs.

 

http://www.activestate.com/Products/perl_dev_kit/index.mhtml?_x=1

 

Cheers,

-Jan

 

From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of
Edward Peschko
Sent: April 2, 2008 3:57 PM
To: Perl-Win32-Users@listserv.ActiveState.com
Subject: win32 service application (like google desktop)

 

all,

I wanted to get the following behaviors in a perl script:

1. a small icon for the perl script, in the lower corner of the window (ie: 
by the system clock). Clicking on this expands the
existing gui.
2. a single instance (and only a single instance) of the script runs at all 
times.
3. mousing over the script displays text associated with that script.
4. no 'cmd' associated with the script.. runs standalone.

In short, I was looking on how to make a script that behaves like the google 
desktop applet.. Anyone made something like this?

Ed

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


RE: Win32::OLE and hidden methods

2008-02-13 Thread Jan Dubois
On Wed, 13 Feb 2008, Michael Ellery wrote:
> Can Win32::OLE access methods/props marked as hidden in the IDL? There
> happens to be one property we have marked as such and I tried the
> naive thing:
>
> my $secret = $object->HiddenProperty
>
> ...and it was rejected. Is there some way to ask Win32::OLE to ignore
> the hidden attribute?

Win32::OLE doesn't care about the IDL or typelib; it calls the
IDispatch::GetIDsOfNames() on your object to figure out the dispatch id
for the method or property.

If your GetIDsOfNames() implementation doesn't return the dispatch ids
of hidden methods and properties, then there is still a way to call them
directly if you know the dispatch id:

my $dispid = 1234;
my $secret = $object->Invoke($dispid, @args);

For property assignments you would need to use LetProperty/SetProperty
methods instead of specifying the dispid as a hash key.

But if your IDispatch::Invoke() implementation doesn't even dispatch
to the hidden properties, then they will be inaccessible from Win32::OLE.

Note that methods/properties are typically marked as "hidden" because
they are not safe to be called via IDispatch, or don't have an Automation
compatible parameter list, or something like that.
 
Cheers,
-Jan


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


RE: Win32::OLE and VT_INT

2008-01-09 Thread Jan Dubois
On Wed, 09 Jan 2008, Michael Ellery wrote:
> The VT_TYPE coming into my put_Some_VARIANT_Property was actually
> VT_BSTR in this case, which I was not expecting. Simply wrapping int()
> around the get call works fine, but a fix to Win32::OLE would be great.
>
> I think I'll also update my VARIANT processing on the put.

I think you should do that.  I don't know if there is some normative
text about this, but I've seen several references that say that the
IDispatch::Invoke implementation is responsible for the coercion of
all parameters to the expected type (if possible).

E.g. the remarks section of the VariantChangeTypeEx() documentation says:

| Typically, the implementer of IDispatch::Invoke determines which
| member is being accessed and then calls VariantChangeType to get the
| value of one or more arguments.
|
| For example, if the IDispatch call specifies a SetTitle member that
| takes one string argument, the implementor would call
| VariantChangeTypeEx to attempt to coerce the argument to VT_BSTR.

[from http://msdn2.microsoft.com/en-us/library/aa909107.aspx]

Cheers,
-Jan


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


Re: Win32::OLE and VT_INT

2008-01-09 Thread Michael Ellery
Jan Dubois wrote:
> On Wed, 09 Jan 2008, Michael Ellery wrote:
>> just running some quick COM code in perl and I notice this: if I call
>> a property or method that returns VT_I4, Win32::OLE maps that to a
>> perl integer in scalar context. When I call a property or method that
>> returns VT_INT, however, it gets mapped to a perl string. Is this
>> deliberate? Is it correct behavior? I can work around my current issue
>> by just doing int() around my values, but it seemed strange to me that
>> these two cases produced slightly different scalars.
> 
> It is a bug in Win32::OLE: it doesn't handle VT_INT (nor VT_UINT)
> explicitly and therefore tries to coerce it into VT_BSTR (using
> VariantChangeTypeEx) before turning it into a Perl scalar. At the Perl
> level this shouldn't really matter though, as strings are converted back
> to integers/numbers automatically whenever needed.
> 
> I don't know why it was never handled explicitly; I just checked, and
> even the wtypes.h from VC98 lists VT_INT as a valid type for a VARIANT.
> 
> I'll fix it in a future Win32::OLE release.
> 
> Cheers,
> -Jan

Jan,

Thanks for the quick response.  In my case, I only noticed the behavior
because I am passing the output to another property - and that property
put wasn't expecting a string.  It went something like this:

my $foo = $oleObject->Some_VT_INT_Property;
$oleObject->{Some_VARIANT_Property} = $foo;

The VT_TYPE coming into my put_Some_VARIANT_Property was actually
VT_BSTR in this case, which I was not expecting. Simply wrapping int()
around the get call works fine, but a fix to Win32::OLE would be great.
I think I'll also update my VARIANT processing on the put.

Thanks,
Mike


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


RE: Win32::OLE and VT_INT

2008-01-09 Thread Jan Dubois
On Wed, 09 Jan 2008, Michael Ellery wrote:
> just running some quick COM code in perl and I notice this: if I call
> a property or method that returns VT_I4, Win32::OLE maps that to a
> perl integer in scalar context. When I call a property or method that
> returns VT_INT, however, it gets mapped to a perl string. Is this
> deliberate? Is it correct behavior? I can work around my current issue
> by just doing int() around my values, but it seemed strange to me that
> these two cases produced slightly different scalars.

It is a bug in Win32::OLE: it doesn't handle VT_INT (nor VT_UINT)
explicitly and therefore tries to coerce it into VT_BSTR (using
VariantChangeTypeEx) before turning it into a Perl scalar. At the Perl
level this shouldn't really matter though, as strings are converted back
to integers/numbers automatically whenever needed.

I don't know why it was never handled explicitly; I just checked, and
even the wtypes.h from VC98 lists VT_INT as a valid type for a VARIANT.

I'll fix it in a future Win32::OLE release.

Cheers,
-Jan

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


Re: win32::process problem

2007-11-29 Thread Mark Dootson
Hi,

It may have nothing to do with paths.

Your '$play_file' param needs to be

vmidi.exe path_to_midi_file.

It currently works on one machine because 
C:\Program Files\vanBasco's Karaoke Player\vmidi.exe is registered with shell 
to execute MIDI files. 
On the machine where it does not work, either it isn't, or something else 
prevents shellexecute from working.

In any case, 3rd param should be a command line so you need to include the exec 
name. (not the full path to the exec).

Regards

Mark





Spencer Chase wrote:
> Greetings ,
> 
> I know that everyone likes a working or not working total script. In this 
> case it is not
> going to be easy for someone else to test so I will start with just a snip 
> and try to
> explain the problem. I can send a whole script but it would require 
> installing programs
> and text files etc. to really test it. I will send the mess of a script (I 
> tend to write
> really rambling garbage with the hope of cleaning it up some day and rarely 
> do) to anyone
> who does want to install the required program etc.
> 
>  Win32::Process::Create( my $process,
> $player,
> $play_file,
> 0,
> DETACHED_PROCESS,
> ".") || die "Create: $!";
> 
> I am using win32::process as above. I need to start an application that, 
> unfortunately is
> in the following location:
> C:\Program Files\vanBasco's Karaoke Player\vmidi.exe  It has both a ' and 
> spaces in it so
> I can not figure out how to treat it in "" or '' strings. I read the path 
> from a text file
> just as it is above and assign this to the variable $player the other 
> variable $play_file
> is a MIDI file that the application will open and is in the working directory 
> although it
> can also have a path added to it. The above snip of code works fine on one 
> computer (the
> one I am developing it on) but not on another win xp machine. I get an error 
> from die
> since the process can not be created. I have tried all sorts of combinations 
> of "" ''
> single and double \\ / \' for the ' in the path, thinking that I might get 
> something that
> works on both computers. I can only get it to work by reading C:\Program 
> Files\vanBasco's
> Karaoke Player\vmidi.exe from a text file (a config file) and assigning it to 
> $player.It
> may also be that permission is needed to start a process but I thought I was 
> avoiding this
> by using win32::process.
> 
> Should the name of the process as used above work on all win computers? It it 
> just a
> permission problem? If so, what can I do to assure that I can run this 
> application on
> other computers not knowing what permissions and passwords are in effect?
> 
> --
> Best regards,
> Spencer Chasemailto:[EMAIL PROTECTED]
> 67550 Bell Springs Rd.
> Garberville, CA 95542  Postal service only.
> Laytonville, CA 95454  UPS only.
> [EMAIL PROTECTED]
> http://www.spencerserolls.com
> http://www.spencerserolls.com/MidiValve.htm
> (707) 984-8356
> 
> ___
> Perl-Win32-Users mailing list
> Perl-Win32-Users@listserv.ActiveState.com
> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


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


Re: win32::taskscheduler

2007-11-24 Thread Randy Kobes
On Sat, 24 Nov 2007, Sisyphus wrote:

>
> - Original Message -
> From: "Spencer Chase" <[EMAIL PROTECTED]>
> To: 
> Sent: Saturday, November 24, 2007 3:18 PM
> Subject: win32::taskscheduler
>
>
>> Greetings perl-win32-users,
>>
>> I have tried unsuccessfully to install win32::taskscheduler. It is on CPAN
>> but does not show up in the list of the Perl Package Manager. Following
>> the instruction in the zip file (downloaded from CPAN) results in a bunch
>> of warnings and a final fatal error. Is there any way to install this
>> automatically or can someone provide installation instructions (maybe more
>> specific than the ones in the zip file README) that work?
>
> Try:
> ppm install http://theoryx5.uwinnipeg.ca/ppms/Win32-TaskScheduler.ppd
>
> That will give you version 0, however ... not the latest 2.0.3. Randy Kobes
> (who takes care of the uwinnipeg repository) will often update to the latest
> version ... if asked politely.

:) I've updated the Win32-TaskScheduler ppm package in
http://theoryx5.uwinnipeg.ca/ppms/ to the latest version.

-- 
best regards,
Randy
___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: win32::taskscheduler

2007-11-23 Thread Sisyphus

- Original Message -
.
.
> If you were to change the ' simply:
>
> 
>
> then , when you run 'ppm install Win32-TaskScheduler.ppd' (from that same
> directory), that should instead install whatever version it is that's in
> Win32-TaskScheduler-58.tar.gz. (With any luck, that will be version 
> 2.0.3).
>

No - don't bother, it's still only version 2.0.2.

If you're running perl 5.6, cd to the TaskScheduler/Win32-TaskScheduler 
folder and run 'ppm install Win32-TaskScheduler.ppd'. That should give you 
version 2.0.3 (with any luck). If it doesn't, try changing the 'http://listserv.ActiveState.com/mailman/mysubs


Re: win32::taskscheduler

2007-11-23 Thread Sisyphus

- Original Message - 
From: "Spencer Chase" <[EMAIL PROTECTED]>
To: 
Sent: Saturday, November 24, 2007 3:18 PM
Subject: win32::taskscheduler


> Greetings perl-win32-users,
>
> I have tried unsuccessfully to install win32::taskscheduler. It is on CPAN
> but does not show up in the list of the Perl Package Manager. Following
> the instruction in the zip file (downloaded from CPAN) results in a bunch
> of warnings and a final fatal error. Is there any way to install this
> automatically or can someone provide installation instructions (maybe more
> specific than the ones in the zip file README) that work?

Try:
ppm install http://theoryx5.uwinnipeg.ca/ppms/Win32-TaskScheduler.ppd

That will give you version 0, however ... not the latest 2.0.3. Randy Kobes 
(who takes care of the uwinnipeg repository) will often update to the latest 
version ... if asked politely.

Having downloaded (and unzipped) the 2.0.3 package from CPAN it seems that 
if you were to cd to the
TaskScheduler/Win32-TaskScheduler-58 folder (which contains 2 files - 
'Win32-TaskScheduler.ppd' and 'Win32-TaskScheduler-58.tar.gz') and run:

ppm install Win32-TaskScheduler.ppd

then you may well end up with version 2.0.2.

If you were to change the '

then , when you run 'ppm install Win32-TaskScheduler.ppd' (from that same 
directory), that should instead install whatever version it is that's in 
Win32-TaskScheduler-58.tar.gz. (With any luck, that will be version 2.0.3).

The way the source package is set up is a little unusual - which may well be 
the reason that PPM's are so scarce - and I can't build it from source as I 
don't have the mstask headers and library.

Cheers,
Rob



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


Re: Win32::API installation troubleson ActivePerl-5.8.8.822-MSWin32-x64-280952.msi

2007-11-07 Thread Sisyphus

- Original Message - 
From: "Morihiro Miyazaki" <[EMAIL PROTECTED]>
.
.
> If the above codes could be converted to C codes by "x64 Intrinsics"
> , the compiler problem will be got over.
> However,the source codes of CALLBACK.XS are written by Assembler level
> coding. So another troubles will come up.
>

Callbacks are a recent inclusion in Win32::API. If you go back to version 
0.20, then the only problem you have to deal with is the inline assembly 
calls. If you can fix that then you could build Win32-API-0.20 . Obviously, 
"callback" and "struct" support will be missing, but you would still have a 
useful build of Win32::API.

Cheers,
Rob

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


Re: Win32::API installation troubleson ActivePerl-5.8.8.822-MSWin32-x64-280952.msi

2007-11-06 Thread Morihiro Miyazaki
> 
> - Original Message - 
> From: "Morihiro Miyazaki" <[EMAIL PROTECTED]>
> To: "Sisyphus" <[EMAIL PROTECTED]>
> Cc: 
> .
> .
> >> As an alternative, you could use Inline::C to access the dll functions on
> >> your 64-bit perl.
> >> (Or you could do it with XS.)
> 
> In case you're not familiar with Inline::C, you'll find an example of how to 
> access windows dll functionality in 'perldoc Inline::C-Cookbook' (towards 
> the end, in the section "Just Desserts").

Yes I'm not familiar wtih Inline::C. Now I prepare the environment for
it.
I'll try it.

> .
> .
> >
> > It's clear that trouble of building win32::API in 64-bit perl is caused
> > by the Inline Assembler which  cl.exe(compiler) doesn't support
> > in 64bit-environment.
> >
> 
> Yes. When I try to build Win32-API-0.46 I get the same as you, by the way.
> I wonder whether Visual Studio 2005 would be capable of building Win32::API 
> for the 64-bit ActiveState build of perl ? (I'm not about to check on that 
> ... you'd probably need the megabucks version anyway.)
You had tried to build Win32-API-0.46 , too.
In the source codes of API.xs, "__asm" codes of Inline Assembler are
written by as following:

#elif defined _MSC_VER
/* Disable warning about one missing macro parameter.
   TODO: How we define a macro with an optional (empty) parameter? */
#pragma warning( disable : 4003 )
#define ASM_LOAD_EAX(param,type) { \
__asm { mov eax, type param }; \
__asm { push eax };\
}
 If the above codes could be converted to C codes by "x64 Intrinsics"
, the compiler problem will be got over.
 However,the source codes of CALLBACK.XS are written by Assembler level
coding. So another troubles will come up. 

 I would like to build Win32::API for 64-bit ActiveState build of
perl(5.8.8.822). However I feel quite a burden.

M. Miyazaki

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


Re: Win32::API installation troubleson ActivePerl-5.8.8.822-MSWin32-x64-280952.msi

2007-11-06 Thread Sisyphus

- Original Message - 
From: "Morihiro Miyazaki" <[EMAIL PROTECTED]>
To: "Sisyphus" <[EMAIL PROTECTED]>
Cc: 
.
.
>> As an alternative, you could use Inline::C to access the dll functions on
>> your 64-bit perl.
>> (Or you could do it with XS.)

In case you're not familiar with Inline::C, you'll find an example of how to 
access windows dll functionality in 'perldoc Inline::C-Cookbook' (towards 
the end, in the section "Just Desserts").
.
.
>
> It's clear that trouble of building win32::API in 64-bit perl is caused
> by the Inline Assembler which  cl.exe(compiler) doesn't support
> in 64bit-environment.
>

Yes. When I try to build Win32-API-0.46 I get the same as you, by the way.
I wonder whether Visual Studio 2005 would be capable of building Win32::API 
for the 64-bit ActiveState build of perl ? (I'm not about to check on that 
... you'd probably need the megabucks version anyway.)

Cheers,
Rob 

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


Re: Win32::API installation troubleson ActivePerl-5.8.8.822-MSWin32-x64-280952.msi

2007-11-06 Thread Morihiro Miyazaki

> 
> - Original Message - 
> From: "Morihiro Miyazaki" <[EMAIL PROTECTED]>
> .
> .
> >
> >  This time I would like to do with massively processing of archived
> > LZH formatted data using win32::API and "UNLHA32.DLL" in 64-bit Perl.
> >
> 
> As an alternative, you could use Inline::C to access the dll functions on 
> your 64-bit perl.
> (Or you could do it with XS.)
> 
> Cheers,
> Rob 

Thank you for your advice

I will take several approaches with your advice to solve the problem. 
If I could find a trouble shooting method, I will response you.

It's clear that trouble of building win32::API in 64-bit perl is caused
by the Inline Assembler which  cl.exe(compiler) doesn't support 
in 64bit-environment.

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


Re: Win32::API installation troubles onActivePerl-5.8.8.822-MSWin32-x64-280952.msi

2007-11-05 Thread Morihiro Miyazaki
Good mornig

 I have already used Win32::API and unlha32.dll for processing archived
 LZH formatted data in 32bit-Perl.
 I know "perldoc Win32::API". I confirmed the usage of Win32::API
in ActivePerl User Guide(HTML).
And I have surveyed how to use Win32::API and unlha32.dll in internet.

Thank you

> Ohayou Miyazakikun.  As far as I know Win32::API is a default package that
> comes with the Perl installation.  U can confirm this by doing perldoc
> Win32::API or perl -e "use Win32::API".  Is it not there?  Ja.
> 
> 
> At 04:10 PM 11/5/2007 +0900, [EMAIL PROTECTED] wrote:
> >Hello!
> >   I have the Win32::API installation troubles 
> > on ActivePerl-5.8.8.822-MSWin32-x64-280952.msi.
> >
> >  I tried two cases of Win32::API installations. 
> >  How do I go about installing Win32::API 
> >  on ActivePerl-5.8.8.822-MSWin32-x64?
> >
> >Morihiro Miyazaki
> >
> 
> 
> --
> REMEMBER THE WORLD TRADE CENTER ---=< WTC 911 >=--
> "...ne cede malis"
> 
> 0100

Morihiro Miyazaki

System Manager
System Development
Hatsumeitsushin Co.LTD.
[EMAIL PROTECTED]

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


Re: Win32::API installation troubleson ActivePerl-5.8.8.822-MSWin32-x64-280952.msi

2007-11-05 Thread Sisyphus

- Original Message - 
From: "Morihiro Miyazaki" <[EMAIL PROTECTED]>
.
.
>
>  This time I would like to do with massively processing of archived
> LZH formatted data using win32::API and "UNLHA32.DLL" in 64-bit Perl.
>

As an alternative, you could use Inline::C to access the dll functions on 
your 64-bit perl.
(Or you could do it with XS.)

Cheers,
Rob 

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


  1   2   3   4   5   6   7   8   >