locked
Microsoft.wireless namespace in windows mobile using c# ? RRS feed

  • Question

  • Hi,

     

    for getting mobile Number in Windows mobile device i'm using the following line of code .

     Microsoft.Wireless.PhoneAddress p =

                           Microsoft.Wireless.Sim.GetPhoneNumber();

    but we are not having Microsoft.Wireless namespace in built.pls provide link for downloading that dll.

    Saturday, April 23, 2011 3:28 AM

Answers

  • those namespaces don't exist, you have to create them; see this example where they are used to P/Invoke native cellcore functions:
    http://msdn.microsoft.com/en-us/library/aa446543.aspx

    you may need to download the file attached to the article to see how they create the namespaces.

    -PaulH

    • Proposed as answer by Jesse Jiang Monday, April 25, 2011 7:32 AM
    • Marked as answer by Jesse Jiang Monday, May 2, 2011 6:00 AM
    Sunday, April 24, 2011 3:17 AM

All replies

  • Hi,

    You need to Add these 2 assemblies to your project as References.

    Microsoft.WindowsMobile

    Microsoft.WindowsMobile.Telephony

    Microsoft.WindowsMobile.PocketOutlook

    To add References right on References in Solution explorer and click "Add References" and add these assemblies to your project. See

    Hope it helps.


    - Pavan [MCTS - Windows Mobile 5.0] If you find my post is helpful for you then mark as a answer and vote it.
    Saturday, April 23, 2011 5:36 AM
  • Hi,

     

    i added those refernces to my solution .

    but it's giving error like " the type or  namespace name "wireless" does not exist in the namespace 'Microsoft'(are u missing an assembly reference?) ".

     

     

    please help this .

    Saturday, April 23, 2011 9:14 AM
  • those namespaces don't exist, you have to create them; see this example where they are used to P/Invoke native cellcore functions:
    http://msdn.microsoft.com/en-us/library/aa446543.aspx

    you may need to download the file attached to the article to see how they create the namespaces.

    -PaulH

    • Proposed as answer by Jesse Jiang Monday, April 25, 2011 7:32 AM
    • Marked as answer by Jesse Jiang Monday, May 2, 2011 6:00 AM
    Sunday, April 24, 2011 3:17 AM
  • Pual, i try to add the following code from the web that you posted but it doesn't work because the WP7 does not allow to use an UNSAFE code. Do you have another solution for this ? 
    Saturday, September 24, 2011 11:56 AM
  • Pual, i try to add the following code from the web that you posted but it doesn't work because the WP7 does not allow to use an UNSAFE code. Do you have another solution for this ? 


    Nothing in this forum is necessarily applicable to Windows Phone 7. You should ask in the WP7 forums located here: http://forums.create.msdn.com/forums/default.aspx?GroupID=19

    -PaulH

    Tuesday, September 27, 2011 1:37 PM