Mike Kangas wrote:
>
> I have a c++ dll that takes a string and turns it into a binary string. I
> have C++ put the data into a file and that works fine. But, I can't get
> Win32::API to receive the whole binary string. Perl gets a little bit of the
> string but not much. Not sure why it's dyin'....
>
> #######################################
>
> open(FILE, "test.xml");
> @file = <FILE>;
> close(FILE);
> $xml = join "", @file;
>
> use Win32::API;
> $API = new Win32::API('FirstDll', 'decryptString', [P], P);
> $encryptedString = $API->Call($xml);
>
> ########################################
>
> Anyone?
You can't return a large value from a Call. You can add another
parameter and pass a pointer to a Perl vrbl and then have the C routine
store the data there and use unpack to access the data in the Perl
vrbl. Make sure you initialize the vrbl to the max size before the Call.
Have the sub return 1 for good and 0 for bad. Change [P] to [P, P] to
add the extra arg.
my $encryptedString = "\000" x $MAX_SIZE;
my $ret = $API->Call($xml, $encryptedString);
if ($ret) {
# good return from call
} else {
# bad return
}
--
,-/- __ _ _ $Bill Luebkert ICQ=14439852
(_/ / ) // // DBE Collectibles http://www.todbe.com/
/ ) /--< o // // Mailto:[EMAIL PROTECTED] http://dbecoll.webjump.com/
-/-' /___/_<_</_</_ http://www.freeyellow.com/members/dbecoll/
_______________________________________________
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users