Important! This is an automatic machine translated page. If you can read english, you should Click Here to read the original English version of the article.

How to Debug a Windows Vista Sidebar Gadget With Visual Studio Kako Debug Windows Vista Sidebar Gadget With Visual Studio

One of the ancillary benefits of our Ena od pomožnih prednosti našega Vista Gadget breaking Vista Gadget breaking and my email filling up with complaints was that I learned how to debug a Vista Gadget in Visual Studio, so I'm sharing the wealth with everybody. in svoj email polnil s pritožbami je bil, da sem se naučil, kako se v Visual Studio debug Vista Gadget, tako da sem delitve premoženja z vsem.

For this exercise you'll need a copy of Visual Studio 2005 and a broken Vista Gadget, but you can probably adapt it to work with a different tool if you try. Za to vajo boste potrebovali kopijo Visual Studio 2005 in lomljeni Vista Gadget, lahko pa verjetno prilagoditi za delo z drugačno orodje, če poskusite.

Critical Step: Enable Script Debugging Kritično korak: Omogoči Script Debugging

Open up Internet Explorer's Options panel, find the Advanced tab and uncheck the boxes for “Disable script debugging”. Odprite ploščo v Internet Explorerju Možnosti našli jeziček Dodatno in počistite polja za "Disable script debugging".

image

After you are done debugging you'll probably want to turn this off, as it can get quite annoying while browsing. Ko končate odpravljanje napak boste verjetno želeli vrteti to ne sveže, ker lahko dobite zelo moteč med brskanjem.

Open Your Gadget Code Open Your Code Gadget

After installing your gadget, Windows will unpack and copy the files to a folder in your user profile. Po namestitvi pripomočka, bo Windows odmotati in kopirati datoteke v mapo v svoj uporabniški profil. We'll need to find this folder and open the javascript file that makes up the logic for your gadget. Bomo morali najti to mapo in odprite javascript datoteko, ki sestavljajo logika za vaš pripomoček.

Just paste the following into the Explorer address bar: Samo po prilepite v naslovno vrstico Explorerja:

%LOCALAPPDATA%\Microsoft\Windows Sidebar\Gadgets LOCALAPPDATA%% \ Microsoft \ Windows Sidebar \ Gadgets

image

You'll see a list of directories for all the gadgets installed into your profile. Videli boste seznam imenikov za vse pripomočke umestiti v svoj profil. Open up the main javascript file in Visual Studio. Odprite glavno datoteko javascript v Visual Studio.

Attach to Sidebar Process Pritrdite na stransko vrstico procesu

Next we'll need to attach to the specific sidebar process for your gadget. Naprej bomo morali priložiti poseben postopek za kredenca vaš pripomoček. (Make sure your gadget is running before you do this step) (Prepričajte se, da pripomoček deluje, preden naredite ta korak)

Go to Tools \ Attach to Process or hit Ctrl+Alt+P to bring up the dialog. Pojdite na Tools \ priložiti k procesu ali zadeti Ctrl + Alt + P, da bi se pogovorno okno.

image

Now you should look for a process named “sidebar.exe” with the title set to the name of your gadget, and then click the Attach button. Sedaj bi morali iskati proces, imenovan "sidebar.exe" z naslovom nastavljen na ime svojega pripomočka, in kliknite gumb Priloži.

image

For a close-up view, you can see that the gadget is running under a separate process from the main sidebar, but the title is set to “How-To Geek”. Za blizu pogled, lahko vidite, da gadget teče v ločenem postopku od glavne kredenca, ampak naslov je nastavljena na "Kako naj Geek". image

Now comes the critical step… click to set a breakpoint just to the left of the white area… Zdaj prihaja pomemben korak ... klik za določitev odmerka samo na levi strani bele površine ...

image

If all goes well, you will immediately be taken to a new file named something like x-gadget:///main.js and your debugging tools will become active as soon as the breakpoint is hit. Če bo šlo vse dobro, boste takoj je treba sprejeti za novo datoteko z imenom nekaj kot x-pripomoček: / / / main.js in vaše orodje debugging bodo postali aktivni takoj, ko je udaril odmerka.

image

Note that you can't modify this file, but you can use the Immediate Window to test out any code in real-time. Upoštevajte, da ne morete spremeniti te datoteke, vendar lahko uporabite Immediate Window preizkusiti vse kode v realnem času.

Important Notes Pomembna opozorila

  • When debugging a gadget that polls every so often, it would be wise to set the interval really low so that you don't have to wait very long for it to trigger. Ko debugging pripomoček javnomnenjske raziskave, ki vsake toliko, da bi bilo pametno, da nastavite interval res nizka, tako da vam ni treba čakati zelo dolgo, da bi sprožila.
  • You can make changes in the original source file, but you will have to close/reopen the gadget and then re-attach to it. Lahko naredite spremembe v prvotni vir datoteke, vendar boste morali zapreti / ponovno pripomoček in nato ponovno pritrdite z njo.
  • If you get an error about no symbols being loaded, you didn't follow the first step to enable script debugging. Če se pojavi napaka o nobenih znakov natovarjanjem, vam ni sledil prvi korak, da se omogoči script debugging.
  • You'll have to manually enter the names of variables to watch in the Watch box, but you can step through the gadget just like a real debugger should. Boste morali ročno vnesti imena spremenljivk, ki jih gledati v polju Watch, vendar lahko skozi korak gadget tako kot pravi treba najti in odstraniti napako.

Happy debugging! Happy debugging!

This article was originally written on 10/9/07 Tagged with: Ta članek je bil prvotno napisan na 10/9/07 Tagged with: Vista Tips & Tweaks Vista Nasveti in Tweaks , , Windows Vista Windows Vista

Daily Email Updates Dnevni Email Updates

You can get our how-to articles in your inbox each day for free. Lahko dobite našo kako do člankov v vašo mapo »Prejeto vsak dan brezplačno. Just enter your name and email below: Preprosto vpišite vaše ime in e-pošto spodaj:


Name: Ime:
Email: E-pošta:

Comments (1) Komentarji (1)

  1. Dave Dave

    [quote]If you get an error about no symbols being loaded, you didn't follow the first step to enable script debugging.[/quote] [quote] Če se pojavi napaka o nobenih znakov natovarjanjem, vam ni sledil prvi korak, da se omogoči script debugging. [/ quote]

    Or you didn't completely restart sidebar.exe. Ali niste popolnoma znova sidebar.exe. Running VistaSP2, IE8, VS2008. Running VistaSP2, IE8, VS2008. Restart of sidebar.exe was required to reload the debugging settings. Restart of sidebar.exe je bilo potrebno, da osvežite razhroščevanje nastavitev.


Leave a Comment Pustite komentar




Leave your Pustite friendly prijazen comment here. comment here.

If you have a computer help question, Če imate računalnik pomagati vprašanje, click here to leave it on the forums kliknite tukaj, da ga pustijo na forumih instead. namesto.

Note: Your comment may not show up immediately on the site. Opomba: Tvoj komentar morda ne pokažejo takoj na mestu.

Our Friends Naši prijatelji
Getting Started Getting Started


About How-To Geek O Kako naj Geek
What Is That Process? Kaj je to proces?
svchost.exe svchost.exe
jusched.exe jusched.exe
dwm.exe dwm.exe
ctfmon.exe Ctfmon.exe
wmpnetwk.exe wmpnetwk.exe
wmpnscfg.exe wmpnscfg.exe
rundll32.exe rundll32.exe
wfcrun32.exe wfcrun32.exe
Ipoint.exe Ipoint.exe
Itype.exe Itype.exe
Wfica32.exe Wfica32.exe
Mobsync.exe Mobsync.exe
conhost.exe conhost.exe
Dpupdchk.exe Dpupdchk.exe Adobe_Updater.exe Adobe_Updater.exe

Copyright © 2006-2009 HowToGeek.com. Copyright © 2006-2009 HowToGeek.com. All Rights Reserved. All Rights Reserved.