ISR in a dll ? - Programmer

This is a discussion on ISR in a dll ? - Programmer ; Hi, I have been strugling to pack a communication library into a dll, making only the "Init", "Write" and "Read" functions available to the user. A global structure (from the dll C source code point of view) allows successive function ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: ISR in a dll ?

  1. ISR in a dll ?


    Hi,


    I have been strugling to pack a communication library into a dll,
    making only the "Init", "Write" and "Read" functions available to the
    user.

    A global structure (from the dll C source code point of view) allows
    successive function calls to share the session data.

    The "Init" function is supposed to initialise the global structure
    data, and to set an interrupt handler.


    Executing that "Init" function causes an "access violation" c0000005
    exception, that kills my application...


    Is it not allowed to set an ISR from from a dll function call ?
    Have you done it before ?
    Should I rather put my init code into the DllMain "starter" section ?


    Thanks - oz


  2. Re: ISR in a dll ?

    "O. Zimmermann" wrote in message
    news:3FB3838C.9050502@lpsc.in2p3.fr...
    > Is it not allowed to set an ISR from from a dll function call ?
    > Have you done it before ?
    > Should I rather put my init code into the DllMain "starter" section ?


    You can't do this in user mode in Windows, since Windows won't give
    applications direct access to hardware, and that includes ISRs. You'll need
    to write a device driver, and for that you'll need the Windows DDK:
    http://www.microsoft.com/ddk/.

    --
    Tim Robinson (MVP, Windows SDK)
    http://www.themobius.co.uk/



+ Reply to Thread