c - perl

2005-03-28 Thread Paul Rogers
I've been tasked with getting some perl scripts to connect to the GoldMine 
API.  I checked some of their API docs and they have C and VB sample code. 
I figured it'd be easier to translate directly from C, even though I have no 
real clue about C.  Easier, in the sense that I'm dealing with C data types, 
not VB data types.

From my research on this, it looks like I'll need to use Win32::API to do 
this job.
Any hints/direction as to how I can do this?
Paul ---
// prototypes
typedef int (*fnGMW_LoadBDE) ( char *szSysDir, char *szGoldDir, char 
*szCommonDir, char *szUser );
typedef int (*fnGMW_UnloadBDE) ();

void GM5S32_DLL_Test() {
// load the GM5S32.DLL
 HMODULE hLib = LoadLibrary(GM5S32.DLL);
if( hLib ) {
 // get proc addresses of GM5S32 functions
  fnGMW_LoadBDE GMW_LoadBDE = (fnGMW_LoadBDE) GetProcAddress( (HINSTANCE) 
hLib, GMW_LoadBDE );
  fnGMW_UnloadBDE GMW_UnloadBDE = (fnGMW_UnloadBDE)
  GetProcAddress((HINSTANCE) hLib,GMW_UnloadBDE);

 // initialize the BDE
  GMW_LoadBDE( d:\\gm4, d:\\gm4, d:\\gm4\\demo, szUser, szPass );
 // do whatever..
 // shut down BDE
  GMW_UnloadBDE();
 // unload the DLL
  FreeLibrary(hLib);
}
return;
}

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


TVGuide

2005-03-28 Thread Jerry Kassebaum
I would like to automate tvguide.com.
I have read Spidering Hacks, but I'm stuck.
Here is the form portion of their code that takes my e-mail address for the 
log-in:


*
form action=login.asp method=post id=frmLogin name=frmLogin
	tr
		td 	bgcolor=#EE
			valign=top
			align=left
			style=padding-left:10px; padding-right:5px; padding-top:15px; 
padding-bottom:8px;
			input id=guid name=returnurl type=hidden value=
			input id=guid name=referrer type=hidden value=
			input id=guid name=regMode type=hidden value=0


			bPlease enter your email address:/bbr
			img src=/images/space.gif width=14 height=14br
			INPUT type=text name=email id=email value= size=20 
style=width:150px
			input 	type=image
name=go
id=go
src=/myprofile/images/login.gif
align=absmiddle
border=0
hspace=5

/td
/tr
/form
***


Here's what I have so far:

use LWP;
$browser=LWP::UserAgent-new;
$url=http://tvguide.com/;;
$response=$browser-post($url, ['name'='email', 'id'='email', 
'value'='[EMAIL PROTECTED]',]);
print$response;

*

I get: HTTP::Response=HASH(0x2883cb4)
Now what?
___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: TVGuide

2005-03-28 Thread Thomas, Mark - BLS CTR
I would recommend starting with WWW::Mechanize. It's an easier-to-use layer
on top of LWP with many conveniences for following links, filling out forms,
etc.

Sample code:

use WWW::Mechanize;
my $mech = WWW::Mechanize-new();

$mech-get( $url_to_login_page );

$mech-submit_form(
form_name = 'frmLogin',
fields= { email  = '[EMAIL PROTECTED]', },
);

# Do more stuff, follow links, etc.

# Print the results
print $mech-content;


Hope this helps.
-- Mark.

 -Original Message-
 From: [EMAIL PROTECTED] 
 [mailto:[EMAIL PROTECTED] On 
 Behalf Of Jerry Kassebaum
 Sent: Monday, March 28, 2005 9:24 AM
 To: perl-win32-users@listserv.ActiveState.com
 Subject: TVGuide
 
 
 I would like to automate tvguide.com.
 
 I have read Spidering Hacks, but I'm stuck.
 
 Here is the form portion of their code that takes my e-mail 
 address for the 
 log-in:
 
 
 
 *
 
 form action=login.asp method=post id=frmLogin name=frmLogin
   tr
   td bgcolor=#EE
   valign=top
   align=left
   style=padding-left:10px; 
 padding-right:5px; padding-top:15px; 
 padding-bottom:8px;
   input id=guid name=returnurl 
 type=hidden value=
   input id=guid name=referrer 
 type=hidden value=
   input id=guid name=regMode 
 type=hidden value=0
 
 
 
   bPlease enter your email address:/bbr
   img src=/images/space.gif width=14 
 height=14br
   INPUT type=text name=email 
 id=email value= size=20 
 style=width:150px
   input  type=image
   name=go
   id=go
   src=/myprofile/images/login.gif
   align=absmiddle
   border=0
   hspace=5
 
   /td
   /tr
 /form
 
 ***
 
 
 
 
 
 
 Here's what I have so far:
 
 
 
 use LWP;
 $browser=LWP::UserAgent-new;
 $url=http://tvguide.com/;;
 $response=$browser-post($url, ['name'='email', 'id'='email', 
 'value'='[EMAIL PROTECTED]',]);
 print$response;
 
 *
 
 
 
 I get: HTTP::Response=HASH(0x2883cb4)
 
 
 Now what?
 
 
 ___
 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: TVGuide

2005-03-28 Thread Johan Lindstrom
At 16:24 2005-03-28, Jerry Kassebaum wrote:
use LWP;
$browser=LWP::UserAgent-new;
$url=http://tvguide.com/;;
$response=$browser-post($url, ['name'='email', 'id'='email', 
'value'='[EMAIL PROTECTED]',]);
print$response;
What you get back is a HTTP::Response object. Reading the docs for that 
class (perldoc HTTP::Response) says the HTML you want to scrape is in 
$response-content.

Read lwpcook (perldoc lwpcook) to understand the issues at hand, then 
install WWW::Mechanize and read the docs for that module. It's even more 
adapted to being a web browser than LWP::UserAgent and will make your life 
a lot easier.

This is a good (but old) introduction to Mechanize:
http://www.perladvent.org/2002/16th/
/J
 --  --- -- --  --  - - --  -
Johan LindströmSourcerer @ Boss Casinos   johanl AT DarSerMan.com
Latest bookmark: TCP Connection Passing
http://tcpcp.sourceforge.net/
dmoz: /Computers/Programming/Languages/JavaScript/ 12
___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: TVGuide

2005-03-28 Thread Thomas, Mark - BLS CTR
I should have also mentioned the XMLTV project
(http://sourceforge.net/projects/xmltv) which is a very popular project for
retrieving TV data. The backend, written in Perl, grabs TV data and formats
it into XML. It is used in PVR software such as MythTV. There are many
front-ends, too, such as TVGuide for Windows
(http://tvguide.sourceforge.net/) and others written in Perl and other
languages (check out the Related Projects section of
http://membled.com/work/apps/xmltv/)

Depending on your needs, your work may already be done!

-- Mark. 

 
  -Original Message-
  From: Jerry Kassebaum
  
  I would like to automate tvguide.com.

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


Re: c - perl

2005-03-28 Thread Lloyd Sartor

There are recent threads in the archive
that discuss Perl-to-C interface options. I recommend taking a good look
at Inline::C before deciding on Win32::API.






Paul Rogers
[EMAIL PROTECTED] 
Sent by: [EMAIL PROTECTED]
03/28/2005 08:11 AM




To
Perl-Win32-Users perl-win32-users@listserv.ActiveState.com


cc



Subject
c - perl








I've been tasked with getting some perl scripts to
connect to the GoldMine 
API. I checked some of their API docs and they have C and VB sample
code. 
I figured it'd be easier to translate directly from C, even though I have
no 
real clue about C. Easier, in the sense that I'm dealing with C data
types, 
not VB data types.

From my research on this, it looks like I'll need to use Win32::API
to do 
this job.

Any hints/direction as to how I can do this?

Paul ---

// prototypes

 typedef int (*fnGMW_LoadBDE) ( char *szSysDir, char *szGoldDir, char 
*szCommonDir, char *szUser );
 typedef int (*fnGMW_UnloadBDE) ();

void GM5S32_DLL_Test() {

 // load the GM5S32.DLL
 HMODULE hLib = LoadLibrary(GM5S32.DLL);

 if( hLib ) {
 // get proc addresses of GM5S32 functions
  fnGMW_LoadBDE GMW_LoadBDE = (fnGMW_LoadBDE) GetProcAddress( (HINSTANCE)

hLib, GMW_LoadBDE );
  fnGMW_UnloadBDE GMW_UnloadBDE = (fnGMW_UnloadBDE)
  GetProcAddress((HINSTANCE) hLib,GMW_UnloadBDE);

 // initialize the BDE
  GMW_LoadBDE( d:\\gm4, d:\\gm4, d:\\gm4\\demo,
szUser, szPass );

 // do whatever..

 // shut down BDE
  GMW_UnloadBDE();

 // unload the DLL
  FreeLibrary(hLib);
 }
 return;
}



___
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: security diff between hidden fields and cookies

2005-03-28 Thread Chris
 I would like to get some opinions on what is safter,
 hidden fields or cookies ?
 For my particular program Im thinking that hidden fields might be safer
because  its a in house web based program  (postgressql dbase) and
 * all files live in a protected folder that outside users should not be 
 able to get to

 Im currently have auth levels stored in a hidden var and pass from page 
 to page...
 a coworker said he thought cookies would be more secure...

 Im going to do the research but thought it wouldnt hurt to ask

 thanks

 Lori



A better way is to assign each user a session ID and pass it along as a
cookie value or hidden form field. Keep the login info  auth levels in an
isolated table along with your session ID.

i.e.

RowID  RealName User Pass AuthSID
0  John Doe Jdoe dog  10  J7h62Gr841D2c9W33a74P8m9H6t1W
1  Jane Smith   Jsmith   cat  8   [Random String]
2  Ron ClarkRclark   purple   5   [Random String]


- Chris

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


Re: security diff between hidden fields and cookies

2005-03-28 Thread Kevin Carothers
On Mon, 28 Mar 2005 15:12:06 -0500, Thomas, Mark - BLS CTR
[EMAIL PROTECTED] wrote:
  I would like to get some opinions on what is safter,
  hidden fields or cookies?
 
 You might be surprised to hear both are equally insecure. In either case,
 you're sending data to a browser, and you're assuming the browser will send
 it back to you unchanged. Yet either can be manipulated.
 
 The best thing to do is avoid sending important data to the browser
 altogether. You can use a sessionID as the previous poster mentions, but be
 sure you keep in mind that the SessionID can be manipulated so make sure you
 build the proper controls in place to handle that.
 

 This is a VERY interesting thread-   It all depends on your needs,
but security is getting more and more of a legal issue so ...

Most websites include both... cookies for the session handling and
hidden fields for the login handshake. Use an SSL/TLS web page for
login/signup. everything else is  OK to use in cookies, IF there are
no passwords in the clear.

That brings up the basic philosophy you should follow;   don't leave
tracks in your client-level HTML code that a bad person can follow
to get into your website no decryption logic or HTML comments like
// decode base64 here  (I know it sounds dumb, but I admit;  mea
culpa).

If this thread gets deeper, maybe we can all have a security discussion.

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


RFC: Module: Win32::Word::Document::Writer

2005-03-28 Thread Johan Lindstrom
Hi all!
I have written a module for creating MS Word documents using the Win32::OLE 
module. It's a wrapper for getting things done a little more easily than 
using the DOM directly, and it has quite a few workarounds to bugs and 
problems with Word.

Anyway, what I'm most interested in now is name suggestions. My currently 
best idea is:

Win32::Word::Document::Writer
It's a bit long, but there are reasons for all the parts:
Win32 - because it's windows specific (but happens to be an implementation 
detail, so I wouldn't mind losing it).

Document::Writer - Writer because it follows the tradition of RTF::Writer 
and a lot of other modules. And I'd like to not hog the entire 
Word::Document namespace.

Word::Document - Document, because there may be other Word::* modules 
like... I don't know... Word::Dotfile or something.

Any ideas on this?
FYI:
There is also another module, Win32::Word::Document::Converter::FromHTML, 
which converts a HTML document to a Word document, and 
Win32::Word::Document::Converter::FromWeb which uses FromHTML to convert 
many web pages to a single Word document.

FYI:
This is the SYNOPSIS section. But looking at the interface, I'm inclined to 
simplify and unify it a little.

use Win32::Word::Document::Writer;
my $oWriter = Win32::Word::Document::Writer-new();
#Adding text and paragraphs with different styles
$oWriter-WriteParagraph(Example document, 1); #Heading 1
$oWriter-WriteParagraph(Usage, 2);#Heading 2
$oWriter-WriteParagraph(Write sentences to the document using a); #Normal
$oWriter-WriteParagraph(heading level, or Normal
if none is specified. );#newline: new paragraph
$oWriter-Write(Add some more text the current paragraph);
$oWriter-NewParagraphStyle(Envelope Return);  #The style must exist
$oWriter-Write(Return to sender. );
$oWriter-SetStyle(Envelope Address);  #Change the current style
$oWriter-Write(Nope, we changed the style of the entire paragraph);
$oWriter-Write(to a footer style);
#Setting character styles
$oWriter-WriteParagraph(Some more normal text. );
$oWriter-SetStyle(Hyperlink); #A charachter style
$oWriter-Write(http://www.DarSerMan.com/Perl/;);
$oWriter-ClearCharacterFormatting();#Clear character style
$oWriter-Write(  -- my );
#Bold/Italics
$oWriter-ToggleBold(); #Toggle bold
$oWriter-Write(Perl );
$oWriter-SetItalic(1); #Turn on Italic
$oWriter-Write(stuff.);
$oWriter-ToggleItalic();   #Toggle Italic
$oWriter-SetBold(0);   #Turn off bold
#Bullet point lists
$oWriter-ListBegin();
$oWriter-ListItem();
$oWriter-Write(The first bullet item);
$oWriter-ListItem();
$oWriter-Write(The second bullet item);
$oWriter-ListBegin();   #Nested bullet point list
$oWriter-ListItem();
$oWriter-Write(The first inner bullet item);
$oWriter-ListItem();
$oWriter-Write(The second inner bullet item);
$oWriter-ListEnd();
$oWriter-ListEnd();
#Do this at regular intervals (say, every couple of 10K of text you add)
$oWriter-Checkpoint();
#Tables
$oWriter-WriteParagraph(Table example, 1);
$oWriter-NewParagraphLevel(0);
$oWriter-TableBegin();
$oWriter-TableRowBegin();
$oWriter-TableColumnBegin();
$oWriter-SetBold(1);
$oWriter-Write(HTML table);
$oWriter-TableColumnBegin();
$oWriter-Write(Win32::Word::Document::Writer);
$oWriter-TableRowBegin();
$oWriter-TableColumnBegin();
$oWriter-SetBold(0);
$oWriter-Write(table);
$oWriter-TableColumnBegin();
$oWriter-Write(TableBegin());
$oWriter-TableRowBegin();
$oWriter-TableColumnBegin();
$oWriter-Write(tr);
$oWriter-TableColumnBegin();
$oWriter-Write(TableRowBegin());
$oWriter-TableEnd();
#Save the document
$oWriter-SaveAs(01example.doc);
/J
 --  --- -- --  --  - - --  -
Johan LindströmSourcerer @ Boss Casinos   johanl AT DarSerMan.com
Latest bookmark: TCP Connection Passing
http://tcpcp.sourceforge.net/
dmoz: /Computers/Programming/Languages/JavaScript/ 12
___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: Module: Win32::Word::Document::Writer

2005-03-28 Thread Sisyphus


- Original Message - 
From: Johan Lindstrom [EMAIL PROTECTED]
To: perl-win32-users perl-win32-users@listserv.ActiveState.com
Sent: Tuesday, March 29, 2005 10:38 AM
Subject: RFC: Module: Win32::Word::Document::Writer


 Hi all!

 I have written a module for creating MS Word documents using the
Win32::OLE
 module. It's a wrapper for getting things done a little more easily than
 using the DOM directly, and it has quite a few workarounds to bugs and
 problems with Word.

 Anyway, what I'm most interested in now is name suggestions. My currently
 best idea is:

  Win32::Word::Document::Writer

 It's a bit long, but there are reasons for all the parts:

 Win32 - because it's windows specific (but happens to be an implementation
 detail, so I wouldn't mind losing it).

 Document::Writer - Writer because it follows the tradition of RTF::Writer
 and a lot of other modules. And I'd like to not hog the entire
 Word::Document namespace.

 Word::Document - Document, because there may be other Word::* modules
 like... I don't know... Word::Dotfile or something.

 Any ideas on this?


Imo, if it's a module that will function only on Win32 (as is definitely the
case in this instance) then it should start with 'Win32::'. I don't know if
this is always done, but I would regard it as objectionable if the 'Win32'
bit were removed.

I think (like you) that 'Win32::Word::Document::Writer contains too many
instances of '::' - but I'm not too sure what to do about it. Do you need to
include 'Word' ? I'm not all that familiar with this area of MS Windows, but
I thought that 'Document' implies 'Word Document' - in which case you could
call it simply 'Win32::Document::Writer'. If you think it's necessary to
include the reference to 'Word', then maybe 'Win32::WordDocument::Writer' or
'Win32::WordDoc::Writer'  or even 'Win32::WordDocWriter' or something.
(I don't really like 'Win32::WordDocWriter' - looks more like a Win32.pm
function name, and doesn't really fit very well with the 'RTF::Writer'
precedent.)

Anyway - just my 2c worth.

Cheers,
Rob

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


Re: Module: Win32::Word::Document::Writer

2005-03-28 Thread Johan Lindstrom
At 04:00 2005-03-29, Sisyphus wrote:
I think (like you) that 'Win32::Word::Document::Writer contains too many
instances of '::' - but I'm not too sure what to do about it. Do you need to
include 'Word' ? I'm not all that familiar with this area of MS Windows, but
I thought that 'Document' implies 'Word Document' - in which case you could
call it simply 'Win32::Document::Writer'. If you think it's necessary to
Oh, Word is most certainly not implied by Document, that's a pretty generic 
word. I would say that the Document part could be implied by Word though:

  Win32::Word::Writer
  Win32::Word::Converter::FromHTML
  Win32::Word::Converter::FromWeb
That's shorter and it would still leave
  Win32::Word::Document
for someone else to do something useful with.
/J
 --  --- -- --  --  - - --  -
Johan LindströmSourcerer @ Boss Casinos   johanl AT DarSerMan.com
Latest bookmark: TCP Connection Passing
http://tcpcp.sourceforge.net/
dmoz: /Computers/Programming/Languages/JavaScript/ 12
___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Encoding TNEF

2005-03-28 Thread Leigh Sharpe



Hi All,
 Does anybody have any references 
on how to encode something into TNEF format?

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


RE: Encoding TNEF

2005-03-28 Thread Burris, Celeste Suliin
Don't know what you are using, but MS has a reference at
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/mapi/html/f
1cc6408-2863-4072-a3cb-ff5128c8124b.asp

Also, the Open Source program ytnef at http://ytnef.sourceforge.net/
is what I use to decode tnefs. If you can read C, it has file layouts, etc.



-Original Message-
From: [EMAIL PROTECTED]
To: Perl-Win32-Users
Sent: 3/28/2005 9:02 PM
Subject: Encoding TNEF

Hi All,
Does anybody have any references on how to encode something into
TNEF format?
 
 ATT152976.txt 
___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Perl/Tk GUI Builder

2005-03-28 Thread h-taguchi
Hello,
(B
(BDoes anyone know of a Perl/Tk GUI builder?
(BI know it is asked before.
(BBut I like to know if there is.
(BGuido seems not be supported any more.
(B
(BAny mailing list for Perl/Tk?
(B
(BRegards,
(BHirosi Taguti
(B[EMAIL PROTECTED]
(B
(B___
(BPerl-Win32-Users mailing list
(BPerl-Win32-Users@listserv.ActiveState.com
(BTo unsubscribe: http://listserv.ActiveState.com/mailman/mysubs