PInvoke AGL

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!
 
G

Guest

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
 
G

Guest

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?
 
G

Guest

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top