How to get hold iMbnRegistration without hook up the iMbnRegistrationEvent handler?
-
Tuesday, May 08, 2012 8:50 PM
Hi,
I'm working on an app (developed in c#) that needs to access the COM interface iMbnRegistration. I know that I could hook up the iMbnRegistrationEvent handler to get it whenever there's a registration change. However, the registration may happen before the app starts, such that, the event could be missed. Is there another way to get hold of the iMbnRegistration interface in c#?
Thanks.
All Replies
-
Wednesday, May 09, 2012 9:27 AMModerator
Hi,
I am not sure what exactly you are trying to accomplish. If you want to get notification when network status changes, you can use NetworkInformation.NetworkStatusChanged event. It allows us to directly obtain network status changes notification in our managed application, without going through custom COM interop. I would like to suggest you to check http://msdn.microsoft.com/en-us/library/windows/apps/hh700376.aspx for a sample. It uses JavaScript, but this feature is available in XAML as well.
>> However, the registration may happen before the app starts, such that, the event could be missed.
In addition, your application still needs to be running in order to receive the notification. If you’re worried when your app starts, there’s no network connection but you don’t know, you can also use NetworkInformation.GetInternetConnectionProfile to check network connection status.
Best Regards,
Ming Xu.
Please mark the replies as answers if they help or unmark if not.
If you have any feedback about my replies, please contact msdnmg@microsoft.com.
Microsoft One Code Framework -
Wednesday, May 09, 2012 8:47 PM
Hi Ming,
I'm writing a mobile oprator's privileged app that needs to get the info of the current servicing mobile operator. Basically what I need is some unique id, such as the mcc/mnc pair, that tells me exactly the current servicing mobile operator is. Unfortunately, I don't see anythere that I can retrieve this info. Would you please give me some hint?
Thanx.
Daniel
-
Thursday, May 10, 2012 6:52 AMModerator
Hi,
Please try to see if you’re able to get the information using classes under the Windows.Networking.Connectivity namespace: http://msdn.microsoft.com/en-us/library/windows/apps/br212028.aspx, if it doesn't help and the WinRT network API doesn't give you the information you need, you may need to use C++ to invoke the native APIs, like IMbnRegistration you pointed out in your first post. You can create a custom WinRT component using C++, and consume the component from your C# application. I would like to suggest you to check http://msdn.microsoft.com/en-us/library/windows/apps/hh441569(v=vs.110).aspx for more information.
Best Regards,
Ming Xu.
Please mark the replies as answers if they help or unmark if not.
If you have any feedback about my replies, please contact msdnmg@microsoft.com.
Microsoft One Code Framework- Marked As Answer by MingXu-MSFTModerator Tuesday, May 15, 2012 2:28 AM
-
Tuesday, May 15, 2012 2:28 AMModerator
Hi,
I will mark the reply as an answer. If you find it no help, please feel free to unmark it and follow up.
Thanks.
Bset Regards,
Ming Xu.
Please mark the replies as answers if they help or unmark if not.
If you have any feedback about my replies, please contact msdnmg@microsoft.com.
Microsoft One Code Framework


