Win32 and modules

Discussion in 'Perl Misc' started by pgodfrin, Sep 21, 2009.

  1. pgodfrin

    pgodfrin Guest

    Greetings,

    Is there anything out there to make using Win32 modules (Activestate)
    not require dusting off my C skills? Case in point - Win32::Service:

    GetStatus(hostName, serviceName, status)
    The third argument must be a hash reference that will be populated
    with entries corresponding to the SERVICE_STATUS structure of the
    Win32 API.

    Microsoft says:

    C++

    typedef struct _SERVICE_STATUS {
    DWORD dwServiceType;
    DWORD dwCurrentState;
    DWORD dwControlsAccepted;
    DWORD dwWin32ExitCode;
    DWORD dwServiceSpecificExitCode;
    DWORD dwCheckPoint;
    DWORD dwWaitHint;
    }SERVICE_STATUS, *LPSERVICE_STATUS;

    Do I have remember how to do all that "or-ing" and "and-ing" again?
    pg
     
    pgodfrin, Sep 21, 2009
    #1
    1. Advertising

  2. pgodfrin

    pgodfrin Guest

    On Sep 21, 12:44 am, Ben Morrow <> wrote:
    > Quoth pgodfrin <>:
    >
    >
    >
    >
    >
    > > Is there anything out there to make using Win32 modules (Activestate)
    > > not require dusting off my C skills? Case in point - Win32::Service:

    >
    > > GetStatus(hostName, serviceName, status)
    > > The third argument must be a hash reference that will be populated
    > > with entries corresponding to the SERVICE_STATUS structure of the
    > > Win32 API.

    >
    > > Microsoft says:

    >
    > > C++

    >
    > > typedef struct _SERVICE_STATUS {
    > >   DWORD dwServiceType;
    > >   DWORD dwCurrentState;
    > >   DWORD dwControlsAccepted;
    > >   DWORD dwWin32ExitCode;
    > >   DWORD dwServiceSpecificExitCode;
    > >   DWORD dwCheckPoint;
    > >   DWORD dwWaitHint;
    > > }SERVICE_STATUS, *LPSERVICE_STATUS;

    >
    > > Do I have remember how to do all that "or-ing" and "and-ing" again?

    >
    > Yes. It's not difficult though: you don't need to know any C, just a
    > how & and | work.
    >
    > Ben


    Hi Ben,
    (nice to hear from you - I've been away a while...)
    Yeah - I just panicked. Seems the GetStatus function updates the
    structure directly - and it looks like MS might not have combined
    flags. So a Dumper that prints a decimal 16 is 0x00000020 and that's
    that. I wonder if I will have to learn the & and | operators :)
    pg
     
    pgodfrin, Sep 21, 2009
    #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. Alex Lyman
    Replies:
    0
    Views:
    697
    Alex Lyman
    Mar 7, 2004
  2. ImpalerCore
    Replies:
    0
    Views:
    879
    ImpalerCore
    Mar 10, 2011
  3. Michael Edmonson

    Win32::SAPI4 question (Win32 events and Perl)

    Michael Edmonson, Feb 28, 2004, in forum: Perl Misc
    Replies:
    0
    Views:
    199
    Michael Edmonson
    Feb 28, 2004
  4. pgodfrin

    Active State 64-bit and Win32 Modules

    pgodfrin, Sep 22, 2009, in forum: Perl Misc
    Replies:
    6
    Views:
    148
    Steve C
    Sep 23, 2009
  5. Honghe Wu
    Replies:
    4
    Views:
    138
    Nobody
    Mar 1, 2013
Loading...

Share This Page