PInvoke AGL

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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!
 
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
 
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?
 
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.
 
Back
Top