none
Call backs between separate DLLs RRS feed

  • Question

  • Hi all,

    I am working on Windows Embedded CE 6.0. Developing a stream Interface driver as DLL for data read from SPI Interface. I have a call back here which needs to be called every 1ms. 

    I will have a Sequencer also as a stream interface driver as DLL which handles all call backs from different modules.

    I need to register my call backs to sequencer through a function call.

    All i want to know is whether functions calls is possible between different driver DLLs. If yes then how?

    Please help me to find the correct solution for this requirement.

     

    Thanks in advance

    Thursday, October 6, 2011 11:51 AM

All replies

  • As long as the DLL's are in the same virtual space (either both in kernel mode or both in user mode) and are loaded in the same process then callbacks are possible. It may be better though to use a message queue or simply events to communicate and wait.
    Good luck,

    Michel Verhagen, eMVP
    Check out my blog: http://guruce.com/blog

    GuruCE
    Microsoft Embedded Partner
    http://guruce.com
    Consultancy, training and development services.
    Thursday, October 6, 2011 12:16 PM
    Moderator
  • Thanks Michel,

     

    But how to make sure my all DLLs are in same virtual space and loaded in the same process?

    I am newbie in this and has very little knowledge.

     

    Please provide more information about your suggestion.

     

     

    Regards,

    Ashfaque

    Thursday, October 6, 2011 12:40 PM
  • If you are a newbie then my strong advice is to NOT use callbacks. It's old style and in most cases not necessary anymore. Have a look at message queues: http://msdn.microsoft.com/en-us/library/ee482757.aspx

    Stream drivers are all loaded by device.exe (so same process in kernel mode) and if your application loads several DLLs they are loaded in the same process. If you need to communicate between processes you'll have to look up interprocess communication (events, mutexes, semaphores, message queues, memory mapped files, etc).

     

    If you tell us WHAT you want to accomplish (not HOW) then we may be able to give you more specific advice (see also http://guruce.com/blogpost/howtoaskquestionsonnewsgroups)

     


    Good luck,

    Michel Verhagen, eMVP
    Check out my blog: http://guruce.com/blog

    GuruCE
    Microsoft Embedded Partner
    http://guruce.com
    Consultancy, training and development services.
    Thursday, October 6, 2011 12:58 PM
    Moderator