For Programmers: Free Programming Magazines  


Home > Archive > Smartphone Developer Forum > October 2005 > Calling SHOnPluginDataChange(const CLSID * pclsidPlugin) in c#









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Calling SHOnPluginDataChange(const CLSID * pclsidPlugin) in c#
Sylvain Fortin

2005-10-17, 7:01 pm

Hi,

I would like to know how to call this function from a managed c#
application. I tried a couple of things and nothing worked and I searched the
archives without success. Actually, what I don't know is how to pass my
guid(CLSID) from c# in a format the native function will understand (also how
to declare to function itself to be able to P/Invoke it later).

Thanks,

Sylvain Fortin
Alex Feinman [MVP]

2005-10-17, 7:01 pm

[DllImport("aygshell")]
extern static int SHOnPluginDataChange(ref Guid clsid);


"Sylvain Fortin" <SylvainFortin@discussions.microsoft.com> wrote in message
news:7F2DDD78-398C-4FC5-AF44-1ACE9979A511@microsoft.com...
> Hi,
>
> I would like to know how to call this function from a managed c#
> application. I tried a couple of things and nothing worked and I searched
> the
> archives without success. Actually, what I don't know is how to pass my
> guid(CLSID) from c# in a format the native function will understand (also
> how
> to declare to function itself to be able to P/Invoke it later).
>
> Thanks,
>
> Sylvain Fortin


Sylvain Fortin

2005-10-18, 7:04 pm

Hi Alex,

Thanks for your quick response. That's what I thought I should do and I
thought my problem was because I didn't know how to declare
"SHOnPluginDataChange(...)" correctly.

When I call it, the .NET application freeze and the homescreen doesn't
receive the message. Here's my code, please let me know if you see anything
wrong.

Thanks,

Sylvain Fortin

....
[DllImport("aygshell.dll")]
public extern static int SHOnPluginDataChange(ref Guid clsid);
....

....
private Guid m_guidPlugin;
m_guidPlugin = new Guid("{697D4905-E66E-489e-897B-2E9AD343EDD7}");
....

....
SHOnPluginDataChange(ref m_guidPlugin);
....
Sylvain Fortin

2005-10-18, 7:04 pm

More details:

I wrote a simple application with one menu item to call
"SHOnPluginDataChange()". I experienced the same issue with this simple
application. However, I didn't reboot the Smartphone right away and the
homescreen plugin received the PE_DATACHANGE one minute later. During that
time, the application was frozen and came back to life once the homescreen
plugin received the message.

By the way, my application is running on WM 5.0 and target .NET 1.0. I never
had any issue like this before. As long as I kept P/Invoke functions
available in WM 2003 everything was fine.

Any idea on what's going on?

Thanks,

Sylvain Fortin

Alex Feinman [MVP]

2005-10-18, 7:04 pm

Could it be that the plugin takes a long time to process the message? Is it
your own plugin?

"Sylvain Fortin" <SylvainFortin@discussions.microsoft.com> wrote in message
news:076CEC63-CD55-417D-9A13-56DFF8F21AFA@microsoft.com...
> More details:
>
> I wrote a simple application with one menu item to call
> "SHOnPluginDataChange()". I experienced the same issue with this simple
> application. However, I didn't reboot the Smartphone right away and the
> homescreen plugin received the PE_DATACHANGE one minute later. During that
> time, the application was frozen and came back to life once the homescreen
> plugin received the message.
>
> By the way, my application is running on WM 5.0 and target .NET 1.0. I
> never
> had any issue like this before. As long as I kept P/Invoke functions
> available in WM 2003 everything was fine.
>
> Any idea on what's going on?
>
> Thanks,
>
> Sylvain Fortin
>


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com