PInvoke AGL - DOTNET

This is a discussion on PInvoke AGL - DOTNET ; I am building a custom Application class because I need to perform some actions AFTER the main form is displayed and the message pump is started. I have implementing my own message pump using the GetMessage / DispatchMessage api calls, ...

+ Reply to Thread
Results 1 to 4 of 4

PInvoke AGL

  1. Default PInvoke AGL

    I am building a custom Application class because I need to perform some
    actions AFTER the main form is displayed and the message pump is started.

    I have implementing my own message pump using the GetMessage /
    DispatchMessage api calls, but I'm afraid my application's performance will
    be impacted by using managed code in such a critical point.

    After reverse engineering the System.Windows.Forms.Application type I have
    noticed that the Run method calls the EnterMainLoop function from the AGL
    library.
    I know I am not supposed to use the AGL library but I am willing to take the
    risk if I am to improve my performance. The problem is that AGL is not
    visible from my app.

    So how do I declate a DllImport for an AGL function?

    Thanks!


  2. Default Re: PInvoke AGL

    You don't. If you want to create your own message loop, there's nothing
    wrong with that. The Smart Device Framework has a good example of it, as we
    implemented it so you could add IMessageFilters. It's been there a long
    time, so even the old, free, 1.4 source has it.

    www.opennetcf.com/sdf


    --
    Chris Tacke - Embedded MVP
    OpenNETCF Consulting
    Managed Code in the Embedded World
    www.opennetcf.com
    --


    "Strider" <Strider@discussions.microsoft.com> wrote in message
    news:9095D6BD-6A99-4C0F-8C70-1A27DC3F4A62@microsoft.com...
    >I am building a custom Application class because I need to perform some
    > actions AFTER the main form is displayed and the message pump is started.
    >
    > I have implementing my own message pump using the GetMessage /
    > DispatchMessage api calls, but I'm afraid my application's performance
    > will
    > be impacted by using managed code in such a critical point.
    >
    > After reverse engineering the System.Windows.Forms.Application type I have
    > noticed that the Run method calls the EnterMainLoop function from the AGL
    > library.
    > I know I am not supposed to use the AGL library but I am willing to take
    > the
    > risk if I am to improve my performance. The problem is that AGL is not
    > visible from my app.
    >
    > So how do I declate a DllImport for an AGL function?
    >
    > Thanks!
    >




  3. Default Re: PInvoke AGL

    Thanks chris.

    But just for the record, where is this mysterious AGL library located and
    how can I import a function into my code?
    Have you ever used it?

    "<ctacke/>" wrote:

    > You don't. If you want to create your own message loop, there's nothing
    > wrong with that. The Smart Device Framework has a good example of it, as we
    > implemented it so you could add IMessageFilters. It's been there a long
    > time, so even the old, free, 1.4 source has it.
    >
    > www.opennetcf.com/sdf
    >
    >
    > --
    > Chris Tacke - Embedded MVP
    > OpenNETCF Consulting
    > Managed Code in the Embedded World
    > www.opennetcf.com
    > --
    >
    >
    > "Strider" <Strider@discussions.microsoft.com> wrote in message
    > news:9095D6BD-6A99-4C0F-8C70-1A27DC3F4A62@microsoft.com...
    > >I am building a custom Application class because I need to perform some
    > > actions AFTER the main form is displayed and the message pump is started.
    > >
    > > I have implementing my own message pump using the GetMessage /
    > > DispatchMessage api calls, but I'm afraid my application's performance
    > > will
    > > be impacted by using managed code in such a critical point.
    > >
    > > After reverse engineering the System.Windows.Forms.Application type I have
    > > noticed that the Run method calls the EnterMainLoop function from the AGL
    > > library.
    > > I know I am not supposed to use the AGL library but I am willing to take
    > > the
    > > risk if I am to improve my performance. The problem is that AGL is not
    > > visible from my app.
    > >
    > > So how do I declate a DllImport for an AGL function?
    > >
    > > Thanks!
    > >

    >
    >
    >


  4. Default Re: PInvoke AGL

    The AGL stuff is internal to the CF. Since you don't know exactly what it's
    doing and it's not documented, you should never call it. You have no idea
    what it expects or how it behaves, so the risk in using it is too large.


    --
    Chris Tacke - Embedded MVP
    OpenNETCF Consulting
    Managed Code in the Embedded World
    www.opennetcf.com
    --



    "Strider" <Strider@discussions.microsoft.com> wrote in message
    news:6E5AC835-5D4D-4281-95F2-1FD35F18D1CF@microsoft.com...
    > Thanks chris.
    >
    > But just for the record, where is this mysterious AGL library located and
    > how can I import a function into my code?
    > Have you ever used it?
    >
    > "<ctacke/>" wrote:
    >
    >> You don't. If you want to create your own message loop, there's nothing
    >> wrong with that. The Smart Device Framework has a good example of it, as
    >> we
    >> implemented it so you could add IMessageFilters. It's been there a long
    >> time, so even the old, free, 1.4 source has it.
    >>
    >> www.opennetcf.com/sdf
    >>
    >>
    >> --
    >> Chris Tacke - Embedded MVP
    >> OpenNETCF Consulting
    >> Managed Code in the Embedded World
    >> www.opennetcf.com
    >> --
    >>
    >>
    >> "Strider" <Strider@discussions.microsoft.com> wrote in message
    >> news:9095D6BD-6A99-4C0F-8C70-1A27DC3F4A62@microsoft.com...
    >> >I am building a custom Application class because I need to perform some
    >> > actions AFTER the main form is displayed and the message pump is
    >> > started.
    >> >
    >> > I have implementing my own message pump using the GetMessage /
    >> > DispatchMessage api calls, but I'm afraid my application's performance
    >> > will
    >> > be impacted by using managed code in such a critical point.
    >> >
    >> > After reverse engineering the System.Windows.Forms.Application type I
    >> > have
    >> > noticed that the Run method calls the EnterMainLoop function from the
    >> > AGL
    >> > library.
    >> > I know I am not supposed to use the AGL library but I am willing to
    >> > take
    >> > the
    >> > risk if I am to improve my performance. The problem is that AGL is not
    >> > visible from my app.
    >> >
    >> > So how do I declate a DllImport for an AGL function?
    >> >
    >> > Thanks!
    >> >

    >>
    >>
    >>




+ Reply to Thread

Similar Threads

  1. Pinvoke for RMS SDK.
    By Application Development in forum DOTNET
    Replies: 0
    Last Post: 10-08-2007, 08:54 PM
  2. pinvoke WM5
    By Application Development in forum DOTNET
    Replies: 6
    Last Post: 03-08-2007, 08:59 AM
  3. SDIOCam.dll and Pinvoke
    By Application Development in forum DOTNET
    Replies: 2
    Last Post: 05-04-2006, 04:35 PM
  4. Re: InvalidateRect Pinvoke and C#
    By Application Development in forum DOTNET
    Replies: 1
    Last Post: 09-29-2005, 08:48 AM
  5. PInvoke
    By Application Development in forum DOTNET
    Replies: 2
    Last Post: 12-14-2003, 09:51 AM