Patrik K wrote:

> Hi,
> 
> I need to use a struct to get some data from a dll call so I tried the
> following but I get a bunch of errors(warnings) from struct.pm about
> uninitialized values but the call is successful, ie it does fill and
> commit the data to the application.

What specifically are your error messages ?  There are some bugs in
API/Struct.pm and API/Type.pm

> I am aware that the struct values start out as undef, but the first dll
> call is supposed to fill the struct not read it. After the first call
> the struct is filled with default values from the application.
> 
> I have been looking around the web for pages with good info on struct
> usage but havent found much code to look at to see how others have
> worked this out.
> Any help would be welcome :)

Why does everyone submit calls to non-standard libraries that we can't
test ?  ;)

> using win32::API 0.40 and perl 5.6.1
> 
> here is the code:
> ### START ###
> use strict;
> use Win32::API;
> 
> my $MDAEMONDLL='C:/Mdaemon/App/Mduser.dll';
> 
> ## sruct defs
> Win32::API::Struct->typedef('MDS_Domain', qw(
>     char DomainName[46];
>     char IP[21];
>     int MaxInactive;
>     int MaxMessageSize;
>     int MaxDeletedIMAPMessageAge;
>     int POP_Throttle;
>     int IMAP_Throttle;
>     int MultiPOP_Throttle;
>     int DomainPOP_Throttle;
>     INT InboundSMTP_Throttle;
>     INT OutboundSMTP_Throttle;
>     char* SupressList;
>     char* AdminList;
>     INT Flags;
> )) or die "Typedef error $!\n";
> 
> my $DOM_struct             = Win32::API::Struct->new('MDS_Domain');
> #print $DOM_struct->align('auto');
> print "DOM Struct size :" . $DOM_struct->sizeof ."\n";
> 
> 
> Win32::API->Import ($MDAEMONDLL, 'VOID MD_InitDomainInfo (LPMDS_Domain
> Domain,char* Name)');
> my $NewDomain='sinza.test';
> &MD_InitDomainInfo($DOM_struct,$NewDomain);


-- 
  ,-/-  __      _  _         $Bill Luebkert    Mailto:[EMAIL PROTECTED]
 (_/   /  )    // //       DBE Collectibles    Mailto:[EMAIL PROTECTED]
  / ) /--<  o // //      Castle of Medieval Myth & Magic http://www.todbe.com/
-/-' /___/_<_</_</_    http://dbecoll.tripod.com/ (My Perl/Lakers stuff)
_______________________________________________
Perl-Win32-Admin mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to