Hi.

I'm using Win32::API v0.41 with Perl 5.8.0 build 805 on WinXP Pro.
I'm having trouble with a DLL I made with VC++ 6.0 Service Pack 5.

When I run the script it outputs 'ABCD' and then Perl crashes.

Regards,
Borkur Gudjonsson


---------- Start DLL ----------
#include "stdafx.h"
#include <stdio.h>

extern "C" __declspec(dllexport)
int test(LPCTSTR strText)
{
        printf(strText);
        return 1;
}

BOOL APIENTRY DllMain(HANDLE hModule, 
                      DWORD  ul_reason_for_call, 
                      LPVOID lpReserved)
{
        return TRUE;
}
---------- End DLL ----------

---------- Start script ----------
#!/usr/bin/perl -w
use strict;
use Win32::API;

my $function = Win32::API->new('bg_dll', 'test', ['P'], 'I');
if (!defined($function))
{
  print STDERR "Error\n";
  exit(1);
}
my $str = "ABCD";
my $ret = $function->Call($str);
print "\$ret=$ret\n";
exit(0);
__END__
---------- End script ----------


_______________________________________________
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to