Converting a VB typdef to Win32::API::Struct

Discussion in 'Perl Misc' started by Oistein Sorensen, Sep 30, 2003.

  1. Hi,

    I'm new to perl-win32 programming and need your help.

    I'm trying to convert this VB typedef to a Win32::API::Struct:

    Public Type ReskInfo
    lSize As Long ' Size of the entire structure
    ' Denne må settes til
    Len(ReskInfo) før Api-kallet
    sKey As Integer
    sFiller1 As Integer ' for future use
    lKundeNummer As Long
    szKundeNavn As String * 30
    bNull_1 As String * 1
    szAdresseI As String * 30
    bNull_2 As String * 1
    szAdresseII As String * 30
    bNull_3 As String * 1
    szPostNummer As String * 6
    bNull_4 As String * 1
    szPostSted As String * 25
    bNull_5 As String * 1
    szTelefon As String * 15
    bNull_6 As String * 1
    szFax As String * 15
    bNull_7 As String * 1
    szEmailAdresse As String * 64
    bNull_8 As String * 1
    szBankgiroNr As String * 15
    bNull_9 As String * 1
    szPostgiroNr As String * 15
    bNull_10 As String * 1
    szDeresRef As String * 30
    bNull_11 As String * 1
    szOrganisasjonsNr As String * 15
    bNull_12 As String * 1

    sKundeGruppe As Integer ' Nytt felt Build 750
    sRabattGruppe As Integer ' Nytt felt Build 750
    sPrisKode As Integer ' Nytt felt Build 750
    sBehandlingsProfil As Integer ' Nytt felt Build 750
    sDistriktsNr As Integer ' Nytt felt Build 750
    sMedarbeiderNr As Integer ' Nytt felt Build 750
    sFiller2 As Integer ' for future use

    dKredittGrense As Double
    dSaldo As Double
    End Type

    When I run my program I get seg-fault in DLL file.

    Can anyone help me with the datatypes?
    VB Perl
    --------- ---------
    Long -> long
    String * 30 -> ??
    Integer -> int
    Double -> double

    Best,
    /oistein/
    Oistein Sorensen, Sep 30, 2003
    #1
    1. Advertising

  2. Oistein Sorensen

    Bart Lateur Guest

    Oistein Sorensen wrote:

    > String * 30 -> ??


    I don't know what this is in Win32::API::Struct, as the latter is pretty
    new to me -- I just upgraded Win32::API and it's a new addition; but
    that's likely a 30 byte pad.

    --
    Bart.
    Bart Lateur, Sep 30, 2003
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mark Piffer

    typdef'ing from sig_atomic_t valid?

    Mark Piffer, Apr 22, 2004, in forum: C Programming
    Replies:
    21
    Views:
    1,878
    Dan Pop
    Apr 29, 2004
  2. baumann@pan
    Replies:
    42
    Views:
    982
  3. Johan Tibell

    Typdef pointers to structs or not?

    Johan Tibell, Jul 27, 2006, in forum: C Programming
    Replies:
    17
    Views:
    542
  4. Mark  Snelling

    How do you typdef a function template

    Mark Snelling, Oct 24, 2005, in forum: C++
    Replies:
    14
    Views:
    441
    Kai-Uwe Bux
    Oct 25, 2005
  5. Dave
    Replies:
    1
    Views:
    311
    Ron Natalie
    Nov 9, 2005
Loading...

Share This Page