RE: IE/OLE - properties & methods questions
-Original Message- > Hello, > I'm using Win32::OLE to work with IE. I've looked through the docs at MSDN and the archives here, but I didn't find my answer so I don't know if these requests are possible or not. > 1) I'd like to disable "view source" via right click (w/o resorting to the JavaScript trick). I've disabled the toolbars and menus however. > 2) Can I disable text selection (that is, left click and drag)? > 3) Instead of using Navigate to get a URL or file, can I use HTML that's stored in a scalar in my source code? Can you set the Document to an html string? > > Thanks "The IPersistStreamInit interface, and its associated methods, can be used to load a HTML content from a stream using the WebBrowser control...", from MSDN, Topic "Loading HTML content from a Stream". I'm not sure how this translates to perl, I don't have any experience using COM from perl. Also, in regards to (1) and (2), these should be possible if you subclass the webbrowser control. IIRC, some of these questions were answered in past issues of MSDN Mag. which is available at http://msdn.microsoft.com/msdnmag. I believe they appeared in the "C++ Q & A" column, but not sure. HTH, Randy. ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Re: Subject goes hereRe: When open doesn't
Just a thought on diagnosing the problem - as well as checking $!, also check $@, $^E and $? . You never know Cheers, Rob ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: Task Scheduler
Sorry Stanley, I just stumbled on the answer of SeeTargetComputer. Perl is very new to me. I'll try my best though. Can you send me your code? I can have a look and let you know if I see anything. I did run the code below on 12 Win2k Servers (4 DC's and 8 file servers.) Didn't run into the problem you are having Thanks, Jason Murray IBM Global Services, Server Platforms Team, Intel division Why live in the Thick of Thin things. Ph: 416.926.3000 Ext 5758 Fax: 416.926.5234 Cell:416.459.6925 Pager:416.329.1443 mailto: [EMAIL PROTECTED] To: [EMAIL PROTECTED], [EMAIL PROTECTED] cc: 05/23/2002 04:34 PMSubject: RE: Task Scheduler I'm having a problem on SOME but NOT ALL of my Win2k boxes with the Enum() method. It's very consistent on these particular servers in that it is successful on the SetTargetComputer method, but the array is empty after execution of the Enum method. Any thoughts on that? Stanley G. Martin Sprint - ISS Enterprise App/Decision Support Services [EMAIL PROTECTED] -Original Message- From: Jason.Murray [mailto:[EMAIL PROTECTED]] Sent: Thursday, May 23, 2002 8:24 AM To: Perl-Win32-Users Subject: Re: Task Scheduler Got it. # # Read Schedules Tasks# # use strict; use Win32::TaskScheduler; Varibles### my $scheduler; my $count; my @jobs; my $jobName; my $result; my $AccountInformation; my $ApplicationName; my $Parameters; my $WorkingDirectory; my $Priority; my $Creator; my $HostName; # Name of the server this will run on. ## $scheduler = Win32::TaskScheduler->New(); $scheduler->SetTargetComputer("MachineName"); #Enumerate the jobs on the selected server. @jobs = $scheduler->Enum(); $count=0; while ($count < @jobs) { $jobName=$jobs[$count]; $jobName=~(s/\.job//); print "Job Name: $jobName\n"; #Sets the job on which the package will operate from now on. The name must be without the .job extension and result will be: $result = $scheduler->Activate($jobName); #Returns the username for the currently active job or undef in case of error. if (defined $scheduler-> GetAccountInformation()) { $AccountInformation = $scheduler-> GetAccountInformation(); print "Account Information: $AccountInformation\n"; }else{ print "The Account Information is not Defined\n"; } #Gets the command that will be executed at the time specified for this scheduled task. if (defined $scheduler-> GetApplicationName()) { $ApplicationName = $scheduler-> GetApplicationName(); print "Application Name: $ApplicationName\n"; }else{ print "The Application Name Information is not Defined\n"; } # Gets the parameters passed to the command that will be executed at the time specified for this scheduled task. if (defined $scheduler-> GetApplicationName()) { $Parameters = $scheduler->GetParameters(); print "Parameters: $Parameters\n"; }else{ print "The Parameters Information is not Defined\n"; } # Gets the working directory for this scheduled task. if (defined $scheduler-> GetWorkingDirectory()) { $Parameters = $scheduler->GetParameters(); print "Working Directory: $WorkingDirectory\n"; }else{ print "The Working Directory Information is not Defined\n"; } # Gets the priority associated with the currently selected task. #if (defined $scheduler-> GetPriority()) { # print "The Priority Information is Defined\n"; # $Priority = $scheduler-> GetPriority($jobName); # print "Priority: $Priority\n"; #}else{ print "The Priority Information is Not Defined\n"; # } #Returns the creator of the currently selected task. Returns undef on error. if (defined $scheduler-> GetCreator()) { $Creator = $scheduler->GetCreator(); print "Creator: $Creator\n"; }else{ print "The Creator Information is Not Defined\n"; } print "\n\n"; $count++; } Thanks, Jason Murray IBM Global Services, Server Platforms Team, Intel division Why live in the Thick of Thin thin
Re: [PMX:##] Crypt::TripleDES Help.....
[EMAIL PROTECTED] wrote: > I'm just trying to get the below to work properly. I'm > taking a credit card number, and incrypting it. Then > printing it out, then unincrypting it. I'm having problems > getting the latter to work. Any help greatly appreciated. > > #!/Perl -w > > use strict; > use Crypt::TripleDES; > > my $des = new Crypt::TripleDES; > > my $plaintext = "4111"; > #my $passphrase = "This is just test text."; > > my $cyphertext = $des->encrypt3 ( $plaintext, $passphrase > ); > > print $cyphertext; #I want to see incrypted results. > > $plaintext = $des->decrypt3 ( $cyphertext ); > > print $plaintext; #I want to see unincrypted results. This works for me: use strict; use Crypt::TripleDES; my $des = new Crypt::TripleDES; my $plaintext = "4111"; my $passphrase = "This is just test text."; print $plaintext, "\n"; my $cyphertext = $des->encrypt3($plaintext, $passphrase); print $cyphertext, "\n"; $plaintext = $des->decrypt3($cyphertext, $passphrase); print $plaintext, "\n"; __END__ -- ,-/- __ _ _ $Bill Luebkert ICQ=14439852 (_/ / )// // DBE Collectibles Mailto:[EMAIL PROTECTED] / ) /--< o // // http://dbecoll.tripod.com/ (Free site for Perl) -/-' /___/_<_http://www.todbe.com/ ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
[PMX:##] Crypt::TripleDES Help.....
I'm just trying to get the below to work properly. I'm taking a credit card number, and incrypting it. Then printing it out, then unincrypting it. I'm having problems getting the latter to work. Any help greatly appreciated. #!/Perl -w use strict; use Crypt::TripleDES; my $des = new Crypt::TripleDES; my $plaintext = "4111"; #my $passphrase = "This is just test text."; my $cyphertext = $des->encrypt3 ( $plaintext, $passphrase ); print $cyphertext; #I want to see incrypted results. $plaintext = $des->decrypt3 ( $cyphertext ); print $plaintext; #I want to see unincrypted results. Allan ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Re: IE/OLE - properties & methods questions
On Fri, 24 May 2002, dss wrote: > > > dss <[EMAIL PROTECTED]> wrote: > and then disable right click so that a user can't right click to view source or >cut-and-paste. > > Of course, hiding HTML source is impossible...don't know what I was thinking :) > I'm not absoulutely convinced that hiding HTML source is impossible. However I am convinced that if you could hide it the client/browser couldn't see it. After all, the browser has to read the source HTML in order to render it. I'm not sure what value write-only HTML source would be. Probably about as useful as write-only memory which is just a little more useful than erase-only memory. [EMAIL PROTECTED] All opinions are my own and not necessarily those of my employer ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Re: Subject goes hereRe: When open doesn't
On Fri, 24 May 2002 [EMAIL PROTECTED] wrote: > [EMAIL PROTECTED] wrote: > > >As a detour, have you tried opening a pipe from "type" to allow you > >to read the file contents via perl? > > No, haven't, but I think it would probably work, and its a pretty > good idea. What I'll probably do is Win32::File::FileCopy it > back to a temp directory though (all I really want to do is > a Digest::MD5 of the file after its copied, after all, it is > a (simple?) backup program I started out on). > > >Also, does sysopen, sysread, also fail? > Yes. > > >Have you tried to read the media via a normal CD drive? > No, and I don't think UDF formatted disks can be read on a normal > CD. But I have read the media on another CDRW outfitted for > UDF, and the data is fine. > Congratulations on having the non-typical problem of the month. I can't recall running across such an intractable problem on this list for some time. [EMAIL PROTECTED] All opinions are my own and not necessarily those of my employer ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Re: IE/OLE - properties & methods questions
dss <[EMAIL PROTECTED]> wrote: and then disable right click so that a user can't right click to view source or cut-and-paste. Of course, hiding HTML source is impossible...don't know what I was thinking :)Do You Yahoo!? LAUNCH - Your Yahoo! Music Experience
Re: IE/OLE - properties & methods questions
Ron Grabowski <[EMAIL PROTECTED]> wrote: Try navigating to 'about':# untested$ie->Navigate("about: hello%20world ");Be careful because you can only send so much HTML that way. Longer pageswill have to be sent loaded via file:// Thanks, that does work, but I will need to load large pages. What I've been asked to create is almost like an ebook. I need to embed the html in the app (the client will be using perl2exe) and then disable right click so that a user can't right click to view source or cut-and-paste. If I have to use a file, I suppose I could use two-way encryption, but I still need to figure out if it's possible with OLE to disable right click. I know the users will be using Windows and that's I'm trying to use Win32::OLE. Thanks again,Do You Yahoo!? LAUNCH - Your Yahoo! Music Experience
Re: IE/OLE - properties & methods questions
> 3) Instead of using Navigate to get a URL or file, can I use HTML > that's stored in a scalar in my source code? Can you set the Document > to an html string? > > my $ie = WIn32::OLE->new('InternetExplorer.Application') or die 'Can't > create instance of IE'; > > my $html = > 'TestTest'; > # Now can I do something like (both of which don't work) > $ie->Document = $html; > #or > $ie->Document->{body} = $html; Try navigating to 'about': # untested $ie->Navigate("about:hello%20world"); Be careful because you can only send so much HTML that way. Longer pages will have to be sent loaded via file:// ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Re: Problem with win32::OLE - please check this out
I like to add this to Chuck's response: I recall reading someplace that many of the larger MS applications ( i.e. Word, Excel ) are not suitable to act as OLE servers in a production environment such as a webserver. I don't know if this applies to Outlook. I'll try to look on Google for where I read about that. > eval {$OL= Win32::OLE->GetActiveObject('Outlook.Application')}; One of the benefits of using eval() comes from being able to check $@ for errors: eval {$OL= Win32::OLE->GetActiveObject('Outlook.Application')}; warn $@ if $@; I think seeing this would be more common: $OL = Win32::OLE->GetActiveObject('Outlook.Application') || Win32::OLE->new('Outlook.Application', 'Quit') unless $OL; ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Subject goes hereRe: When open doesn't
[EMAIL PROTECTED] wrote: >As a detour, have you tried opening a pipe from "type" to allow you >to read the file contents via perl? No, haven't, but I think it would probably work, and its a pretty good idea. What I'll probably do is Win32::File::FileCopy it back to a temp directory though (all I really want to do is a Digest::MD5 of the file after its copied, after all, it is a (simple?) backup program I started out on). >Also, does sysopen, sysread, also fail? Yes. >Have you tried to read the media via a normal CD drive? No, and I don't think UDF formatted disks can be read on a normal CD. But I have read the media on another CDRW outfitted for UDF, and the data is fine. ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Re: When open doesn't
On Fri, 24 May 2002 [EMAIL PROTECTED] wrote: > [EMAIL PROTECTED] wrote: > >Have you tried running it with the file copied to C:\BU_0\C\Prefs > >and run > >DOS>perl test.pl C:\BU_0\C\Prefs ? > > Yes, I have, and it works fine. > > >If no problem, then it may be your CDRW driver issue. > >Is the other Win 98 > >system using the same CDRW drive and driver? > > The other Win 98 system is using a different CDRW drive, with the > same media. It also has a different driver. > > So, I agree that it is a CDRW driver (possibly drive, but probably > driver) issue. > > The question is: > > What could be wrong with a driver which could cause the following > symptoms: > > 1) Basic DOS apps ("type", "dir") can access the disk fine, > 2) Windows apps (Wordpad, Word, Excel, etc) can read/write files >on the disk just fine. > 3) perl programs can copy files both to and from the disk using >Win32::File::CopyFile. > 4) perl programs can't open any file on the disk, and always seem >to fail with "Invalid argument". > > That set of symptoms doesn't make sense to me (but then again, as > I have said before, I'm a UNIX guy. "Open" isn't quite as basic > in DOS/Windows as it is in UNIX). > > Any ideas, anyone? > As a detour, have you tried opening a pipe from "type" to allow you to read the file contents via perl? Also, does sysopen, sysread, also fail? Have you tried to read the media via a normal CD drive? [EMAIL PROTECTED] All opinions are my own and not necessarily those of my employer > Bill B. > > ___ > Perl-Win32-Users mailing list > [EMAIL PROTECTED] > To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs > ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Re: When open doesn't
- Original Message - From: <[EMAIL PROTECTED]> > Its just > that I really wanted to find out why this is happening. > To that end it would be useful to know just what 'Invalid Argument' means. What does one have to do to produce that error ? Anyone know ? The only error I can produce is 'No such file or directory...'. Cheers, Rob ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Re: array values
On Fri, 24 May 2002, Ben Mouw wrote: > When I store values in an array that have both alpha and numeric values > like this 4716/1027-5K01 it ends up in some other format(I think it is > hexadecimal) and looks like this (0x1b9bce8) How can I convert this or > at least store it correctly to begin with. > If you want more help you have to provide more information. Such as the content in which the value is stored and retreived. A simple code snippet would go a long way toward helping us to help you. [EMAIL PROTECTED] All opinions are my own and not necessarily those of my employer ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs