OpenNETCF.Notification can not get return value...

F

Franky

I try the exemple in the topic
http://www.opennetcf.org/Forums/topic.asp?TOPIC_ID=389

but if a do a break point in the Event, the e.ID is nothing and the e.Link=0
too.

this is my code.
----
int NotifyID = 100;
Notification notTest;
NotificationEngine oEngine;

private void Form_Load(object sender, System.EventArgs e)
{
oEngine = new NotificationEngine(new Guid());
oEngine.NotificationSelect += new
NotificationEventHandler(Notif_Eng_NotificationSelect);
oEngine.NotificationDismiss += new
NotificationEventHandler(Not_Eng_NotificationDismiss);
oEngine.NotificationShow += new NotificationEventHandler(NotificationShow);
}

private void bntNotify_Click(object sender, System.EventArgs e)
{
notTest = new Notification();

notTest.ID = CntNot;
notTest.Title= "This is a Personal Notification!";
notTest.HTML = " <a CMD=10 href=\"CMD:10\" ID=\"CMD:377\">Hey man! What's
New?</a>";
notTest.Duration = 30;
notTest.Flags = NotificationFlags.ForceMessage;
oEngine.Add(notTest);
TxtNotifyResult.Text = "";
CntNot++;
}

private void Notif_Eng_NotificationSelect(object sender,
NotificationEventArgs e)
{ TxtNotifyResult.Text = "ID Select : " + e.ID.ToString() + " Link: " +
e.Link.ToString();
}


private void Not_Eng_NotificationDismiss(object sender,
NotificationEventArgs e)
{
TxtNotifyResult.Text = "ID dimmiss: " + e.ID.ToString() + " Link: " +
e.Link.ToString();
}

private void NotificationShow(object sender, NotificationEventArgs e)
{
TxtNotifyResult.Text = "ID show: " + e.ID.ToString() + " Link: " +
e.Link.ToString();
}

---

SO where i'm wrong??



________________________
Franky
(e-mail address removed)
 
P

Peter Foot [MVP]

When you construct the NotificationEngine you must pass in a unique Guid for
your application - passing in new Guid() will use a blank Guid, you should
avoid doing this as it may interfere with other notification providers
active on the system.
Where is "CntNot" defined in your code? - this is the ID assigned to the
notification, also the Link property will only be returned in the
NotificationSelect event, and this will be the numeric portion of your cmd:x
link.

Peter
 
F

Franky

Ok fine a change some feature
---
oEngine = new NotificationEngine(new
Guid("65EF1EB7-4C54-4e20-B3F8-EC290B4E3262"));
---

and i got the Cmd now... but the ID still equal strange value? The ID is
not equal to the value pass in notTest.ID ...
And how can I change the icon?

____________________
Franky
(e-mail address removed)
 
P

Peter Foot [MVP]

The current implementation can only use the application icon from your exe
(there is no direct way to get a native icon handle from a
System.Drawing.Icon). However you can change the code to load from an
alternative native dll or exe, we are looking into how we might be able to
make this more flexible for a future version.
As for the ID, I'll have to take a look in the code, I haven't worked on
Notification for a little while so will need to refresh my memory.

Peter

--
Peter Foot
Windows Embedded MVP
OpenNETCF.org Senior Advisor
www.inthehand.com | www.opennetcf.org
 

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