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, ...
-
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!
-
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!
>
-
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!
> >
>
>
>
-
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!
>> >
>>
>>
>>
Similar Threads
-
By Application Development in forum DOTNET
Replies: 0
Last Post: 10-08-2007, 08:54 PM
-
By Application Development in forum DOTNET
Replies: 6
Last Post: 03-08-2007, 08:59 AM
-
By Application Development in forum DOTNET
Replies: 2
Last Post: 05-04-2006, 04:35 PM
-
By Application Development in forum DOTNET
Replies: 1
Last Post: 09-29-2005, 08:48 AM
-
By Application Development in forum DOTNET
Replies: 2
Last Post: 12-14-2003, 09:51 AM