Multi-threaded in windows phone c#

Hello all I am doing the code return a messageBox after the click of a button. After the click of the screen do not freeze, or a capture did not return an error. When you run debug I get unauthorized access. And two routedEventArg and EventArg work also with the button. Dispatcher without lambda give a correct return type. In total, two method. first type void StartRunning try-catch with the second method running coming out of a task
If someone could help thanks

private void StartRunning(object sender, EventArgs args)
{   

        try
        {
            Dispatcher.BeginInvoke(() => { Running(); });
        }
         catch (Exception ex)
         {
             MessageBox.Show(ex.Message);
         }
    }

public async Task Running()
    {
        await Task.Run(() =>
        {
            MessageBox.Show("hello");
        });
    }

C# is outside the scope of this site.  Your best bet is to ask on the MSDN (Microsoft developer network)

This issue is beyond the scope of this site and to make sure, you get the best (and fastest) reply, we have to ask either on Technet (for IT Pro) or MSDN (for developers)

Tags: Windows

Similar Questions

  • Problems with UN / reinstall Windows Phone Desktop app

    Hello

    Yesterday, I tried to update my Desktop Windows Phone application, but received an error message prompting me to reinstall. When I go into Control Panel, I am only offered the possibility to uninstall it, and when I try to do, it fails to uninstall I get an error message that the installation package {256BFC36-34DF-4C3E-8051-5DDCC16B9334} v1.1.2726.0.msi is missing. I tried to get on my computer, but I'm afraid she's not found. I also tried to install the new version of the app, but I can't do that because it says that the program is already installed on my machine. So now I can't use the app, uninstall it, fix it or reinstall it because of the missing installation package.

    Yesterday I ran ccleaner registry cleaning and other improvements, he suggests, so I think it's the way in which the installation package has gone missing.

    What can I do? Thanks in advance.

    Solved!

    Earlier, I found this thread that addresses the same issue:

    http://answers.Microsoft.com/en-us/WinPhone/Forum/wp8-wpmusic/cant-install-new-version-of-Windows-phone-app-for/9a09e169-8cea-40a9-A421-fbf9d4e37fc1

    Your colleague Sheena M it gives a link to a fix that solved the problem for me:

    http://support.Microsoft.com/mats/Program_Install_and_Uninstall?WA=wsignin1.0

    I chose 'Uninstall' as the difficulty, which solved the problem. Now, I managed to reinstall the latest version of the desktop Windows Phone application.

  • Question no doubt multi-threaded

    Greetings!

    Don't know what kind of problem I face, but still very interesting.

    I have a UiApplication who starts a thread to listen to incoming SMS and respond automatically. This same class implements PhoneListener as below:

    public class SMSSenderReceiver extends Thread implements PhoneListener {
    
        private static DatagramConnection _dc;
        private static int _callIdIncoming;
        private static int _callIdAnswered;
        public static String _phoneNumber;
    
        static {
        try {
            _dc = (DatagramConnection) Connector.open("sms://");
            } catch (IOException e) {
                System.out.println(e);
            }
        }
    
        public SMSSenderReceiver() {
            super();
            _callIdIncoming = -1;
            _callIdAnswered = -1;
            Phone.addPhoneListener(this);
        }
    
        public void run() {
            try {
                for (;;) {
                    Datagram d = _dc.newDatagram(_dc.getMaximumLength());
                    _dc.receive(d);
                    String address = d.getAddress();
                    if (address.startsWith("//")) {
                        address = address.substring(2);
                    }
                    String answer = getResponseByPhone(address);
                    if (answer != null) {
                        answer.getBytes();
                        Datagram returnpacket = _dc.newDatagram(_dc
                                .getMaximumLength());
                        returnpacket.setAddress(d.getAddress());
                        returnpacket.setData(answer.getBytes(), 0, answer.length());
                        _dc.send(returnpacket);
                    }
                }
            } catch (IOException ioe) {
                System.out.println(ioe);
                Phone.removePhoneListener(this);
            }
        }
    
        private static String getResponseByPhone(final String phone) {
            TextResponses tr = TextResponses.getInstance();
            MultiMap mm = tr.getResponses();
            Enumeration valuesEnum = mm.keys();
            while (valuesEnum.hasMoreElements()) {
                String element = valuesEnum.nextElement().toString();
                if (mm.containsValue(element, phone)) {
                    return element;
                } else {
                    continue;
                }
            }
            return null;
        }
    
        //  public void missedCallSMSSender(final String address) {
        //      try {
        //          if(_callIdAnswered != _callIdIncoming){
        //              //              if (address.startsWith("//")) {
        //              //                  address = address.substring(2);
        //              //              }
        //              String answer = this.getResponseByPhone(address);
        //              if (answer != null) {
        //                  answer.getBytes();
        //                  Datagram returnpacket = _dc.newDatagram(_dc
        //                          .getMaximumLength());
        //                  returnpacket.setAddress("//" + address);
        //                  returnpacket.setData(answer.getBytes(), 0, answer
        //                          .length());
        //                  _dc.send(returnpacket);
        //              }
        //              _callIdAnswered = _callIdIncoming = -1;
        //              //_phoneCallsHash.remove("" + _callIdIncoming);
        //          }
        //      } catch (Exception e) {
        //          System.out.println(e);
        //      }
        //  }
    
        public void callIncoming(final int callId) {
            if(_callIdIncoming != callId){
                UiApplication.getUiApplication().invokeLater(new Runnable(){
                    public void run() {
                        _callIdIncoming = callId;
                        PhoneCall phoneCall = Phone.getCall( callId );
                        _phoneNumber = null;
                        try {
                            _phoneNumber = phoneCall.getDisplayPhoneNumber();
    
                            String tempNumber = null;
                            for(int i = _phoneNumber.length() -1 ;i >= 0; --i) {
                                if(Character.isDigit(_phoneNumber.charAt(i))){
                                    tempNumber = _phoneNumber.charAt(i) + ((tempNumber == null) ? "" : tempNumber) ;
                                }
                            }
                            _phoneNumber = tempNumber;
    
                            System.out.println("**bleep** Phone Number: " + _phoneNumber);
                        } catch(NullPointerException npe) {
                            _phoneNumber = "0";
                            System.out.println("NULL!!!!" + npe);
                        }
                    }
                });
            }
        }
    
        public void callAnswered(int callId) {
            _callIdAnswered = callId;
        }
    
        public void callDisconnected(int callId) {
            UiApplication.getUiApplication().invokeLater(new Runnable(){
                public void run() {
                    //System.out.println("**bleep** Phone Number: " + _phoneNumber);
                    //SMSSenderReceiver.this.missedCallSMSSender(_phoneNumber);
                    String address = _phoneNumber;
                    if(_callIdAnswered != _callIdIncoming){
                        //                  if (address.startsWith("//")) {
                        //                      address = address.substring(2);
                        //                  }
                        String answer = getResponseByPhone(address);
                        if (answer != null) {
                            answer.getBytes();
                            try {
                                Datagram returnpacket = _dc.newDatagram(_dc.getMaximumLength());
                                returnpacket.setAddress("//" + address);
                                returnpacket.setData(answer.getBytes(), 0, answer
                                        .length());
                                _dc.send(returnpacket);
                            } catch(Exception e) {
                                System.out.println(e);
                            }
                        }
                        _callIdAnswered = _callIdIncoming = -1;
                    }
                }
            });
        }
    ...
    

    The goal is to send an SMS for each missed call. Thus, on incomingCall while I get caller Id and phone number assign them static variables. If the call is answered I catch the call id also. Once the call is disconnected I just check the id of appeal responded and id entering in case they differ from each other, I got a call from miss and I send a SMS.

    The problem is once the callDisconneted is called, I don't have the value of _phoneNumber. On incomingCall I could see the number, but not after all. Why? Seems to be a fundamental basis on the multi-thread.

    Anyone know what is happening?

    Thanks in advance!

    --

    This question probably has to do with the fact that the listener to call is actually coming in your code on the phone application thread. Each application gets a copy separate from the static context. As a result, you won't see the same data when you access this variable in your own application process.

    You can probably here either: (a) send yourself a form of global event listener call, then pick up the event in your own process, or (b) use the runtime store to keep the value so that the two processes can * see * it.

  • Why my Windows Phone app (for desktop) does not open?

    I connect my WP8 to my laptop. Open Windows Phone app to sync music.

    And this happens:

    The signature of the whole problem:

    Signature of the problem:
    Problem event name: CLR20r3
    Signature of the problem 01: windowsphone.exe
    Signature of the problem 02: 1.0.1720.1
    Signature of the problem 03: 519a6ab5
    Signature of the problem 04: Microsoft.Practices.Unity
    Signature of the problem 05: 2.1.505.2
    Signature of the 06 problem: 5004782f
    Signature of the problem 07: 30 d
    Signature of the problem 08: 0
    Signature of the problem 09: System.ArgumentNullException
    OS version: 6.1.7601.2.1.0.768.3
    Locale ID: 1033
    Additional information 1: 0a9e
    More information 2: 0a9e372d3b4ad19135b953a78882e789
    Additional information 3: 0a9e
    Additional information 4: 0a9e372d3b4ad19135b953a78882e789

    I tried to uninstall and install again. I have completely updated my laptop and repeat the process of re-installing and he still does not work.

    Hello Jaycub,

    Thanks for posting your query in Microsoft Community Forum.

    What is the brand and model number. the phone?

    The question may arise for various reasons, including a problem with the USB, all recent software update etc. So, I would suggest trying the following steps and check if the problem still persists.

    Method 1:

    Please, try the steps in the following Knowledge Base article.

    Windows Phone 8 is not detected by your computer

    http://support.Microsoft.com/kb/2749484/en

    Method 2:

    You too, try the next solution.

    Try to log in and cancel the success of sync, then try to uncheck auto sync - I hope that this should prevent the app crash the next time you connect.
    For more information on uncheck auto sync, please see the following thread:

    http://answers.Microsoft.com/en-us/WinPhone/Forum/wp8-wpstart/wp8-connector-for-OSX-crashing-on-launch/fbe20bb0-2bcf-4B86-a1f9-fffaa69ac1eb?page=3

    Hope this information is useful. If the problem still persists, please post back for further assistance, we will be happy to help you.

  • How can I connect my nokia windows phone to my macbook pro

    How to connect my windows phone to my macbook pro?

    / #XB3VsCvlhQulFFFR.97 https://blogs.Windows.com/Devices/2013/02/07/syncing-Your-Nokia-Lumia-with-a-Mac

  • I can't find pocket for Firefox for Windows phone application

    Pocket is available for my Nokia Lumia Windows phone and if yes where can I find it? It is not in the store.

    Hi HansFransen, please see support of pocket on this topic to https://help.getpocket.com/customer/portal/articles/1950016

  • This app works for windows phones 8.1

    Need more privacy, ppl are able to access certain accounts through Googling my name? !!

    Sorry but there is no development of a Firefox mobile for all Windows Phones devices and not expected anytime soon.

    Firefox is only for Windows, Mac OSX, Linux desktop. Firefox Mobile for Android 2.3 +. As a browser shell for iOS8 + and there's OS "Firefox" for some phones and some Panasonic Tv's.

  • FireFox will be available on Windows Phone?

    FireFox will be available on Windows Phone?

    Hello, I know no development or the efforts of mozilla firefox on the windows phone platform porting.
    Initially, there was technical and legal obstacles in the app store, which discouraged mozilla to start any developments in this direction. I do not know the current situation, but given that mozilla is now focusing its efforts on the creation of firefox os as a platform open source web-based, I doubt you'll see firefox on your windows phone device in the foreseeable future...

  • Good afternoon. Please tell me if firefox for windows phone?

    Good afternoon. Please tell me if firefox for windows phone?

    No, there is no development in this direction - when everything is available on WP who is called "Firefox" then it is not genuine and probably a trade mark infringement which must be reported to https://www.mozilla.org/about/legal/fraud-report/

  • Firefox for Windows Phone

    Why not develop a Version of WP in Firefox?

    It will certainly help you.

    I know that 25 per cent of mobile users use WP.

    And thousands of users want Firefox for WP too!

    I'm not a developer of Firefox, but as far as I know, due to the policy of windows app store there is a technical barrier to the deployment of Firefox on windows phone. And Mozilla is also trying to put all efforts here on FirefoxOS (mobile operating system new here). So maybe it's why they aren't creation of Firefox for Windows mobile.
    But can you please cite the source that shows that 25% of mobile users use windows phone!

  • Where can I download Mozilla Thunderbird for Windows Phone?

    I can't find it on your site or your Windows Phone store.

    There is no version of Thunderbird and Firefox from mozilla.org to any mobile Windows operating system and not about to be at any time in the future.

    Thunderbird is available for Windows XP SP2 or newer, Mac OS x 10.6 + and Linux workstations.

    Firefox is for same and as mobile Firefox for Android 2.3 + and Firefox OS.

  • Download Windows phone dor

    Is the Mozilla Firefox for windows phone?

    rdtbull said

    Is the Mozilla Firefox for windows phone?

    As far as I KNOW, there is no version of Firefox available for windows phone. And there is no Mozilla development effort to create one because of Microsoft limited of the API. And also Mozilla focuses on its own mobile operating system named FIrefox OS. So the answer to your question is no.

  • Why my windows phone says he can not download the file type when you try to install the firefox browser?

    I have no restrictions on the phone. I tried to be sure and use the features of security as... Safe search, cookie and other block. He repeated, however, unable to download the file type when I try and install one of the browsers to date. What is interesting to say the least. Because my browser already uses the version more up-to-date. I have internet explore using a nokia windows 8

    Hello, the mobile version of firefox is not available on the windows phone platform: Firefox work on my mobile?

    There was technical and legal obstacles in the app store initially that discouraged mozilla to start any developments in this direction. I do not know the current situation, but given that mozilla is now focusing its efforts on the creation of firefox os as a platform open source web-based, I doubt you'll see firefox on your windows phone device in the foreseeable future...

  • Support for Windows Phone?

    What difficulties mozilla faced creating an application for wp8.1?
    Please do not give the answer "Please understand that FF is not available...". ».

    Microsoft does not give us access to the full set of tools that we create Firefox for Android or desktop. Microsoft greatly limits code that can be executed on Windows Phone devices.

  • Is there a way to provide Windows Phone 8 a Firefox browser soon?

    I need Firefox on Windows Phone 8 soon, because it's the best browser ever.

    To have more than one answer to why.
    https://wiki.Mozilla.org/mobile/platforms
    Windows Mobile

       Firefox has stopped development for Windows Mobile indefinitely. Thank you to our contributors for their continued support and feedback. The last release for Windows Mobile was 1.1 alpha 1 (download). We have stopped developing for Microsoft's mobile platform because Windows Phone 7 no longer allows developers to build C++ applications like Firefox, and Microsoft's new policies ban open-source software like Firefox from the Windows Phone Marketplace.
    

Maybe you are looking for