Hi Masters.

This code on my WinXP crashes perl.
Searched the list , but only the old syle ( Method 1 or Method 2 ) comes up.
I am trying Method 3 , new with .40 onwards.

Please can somebody point out my "basic" mistake :

print "TYPE DWORD is known to Win32::API::Type \n" if Win32::API::Type->is_known('DWORD'); print "TYPE LPTSTR is known to Win32::API::Type \n" if Win32::API::Type->is_known('LPTSTR');

my $GetTempPathRetVal = Win32::API->Import('kernel32','DWORD GetTempPath( DWORD nBufferLength, LPTSTR lpBuffer )');
if($GetTempPathRetVal eq 0) {
   die "Can't import API GetTempPath : $^E\n";
}


my $lpBuffer = '-'x80;
my $returnval = GetTempPath(79,$lpBuffer);
my $TempPath = substr($lpBuffer,0,$returnval);

print "Temp path is : $TempPath !!\n";


Sumitro Chowdhury


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

Reply via email to