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 Ako sa k ladenie Windows Vista Sidebar Gadget s Visual Studio

One of the ancillary benefits of our Jedným z vedľajších výhod nášho Vista Gadget breaking Vista Gadget lámanie 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. a môj e-mail plní sťažností bolo, že som sa naučil, ako ladiť Vista Gadget vo Visual Studiu, takže som zdieľanie bohatstva s každým.

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. Pre toto cvičenie budete potrebovať kópiu Visual Studio 2005 a zlomené Vista Gadget, ale môžete ju pravdepodobne prispôsobiť prácu s rôznymi nástrojmi, ak sa pokúsite.

Critical Step: Enable Script Debugging Kritický krok: Povoliť ladenie skriptov

Open up Internet Explorer's Options panel, find the Advanced tab and uncheck the boxes for “Disable script debugging”. Otvoriť panel Možnosti programu Internet Explorer, nájdete na kartu Spresnenie a zrušte začiarknutie políčka "Vypnúť ladenie skriptov".

image

After you are done debugging you'll probably want to turn this off, as it can get quite annoying while browsing. Potom, čo ste urobil ladenie budete si chcieť pravdepodobne túto funkciu vypnúť, pretože to môže dostať docela otravné pri prehliadaní.

Open Your Gadget Code Open Your Gadget kód

After installing your gadget, Windows will unpack and copy the files to a folder in your user profile. Po inštalácii si gadget, bude systém Windows rozbaliť a skopírovať súbory do priečinka vo vašom používateľskom profile. We'll need to find this folder and open the javascript file that makes up the logic for your gadget. Budeme musieť nájsť túto zložku a otvorte súbor, ktorý javascript tvorí logiku pre váš prístroj.

Just paste the following into the Explorer address bar: Stačí vložiť nasledujúce do baru Explorer adresu:

%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. Uvidíte zoznam adresárov pre všetky mini-aplikácie nainštalované do vášho profilu. Open up the main javascript file in Visual Studio. Otvoriť hlavné javascript súbor vo Visual Studio.

Attach to Sidebar Process Pripojiť k bočnému panelu procesu

Next we'll need to attach to the specific sidebar process for your gadget. Ďalšie budeme musieť pripojiť ku konkrétnej sidebar proces pre váš prístroj. (Make sure your gadget is running before you do this step) (Uistite sa, že prístroj beží Pred uskutočnením tohto kroku)

Go to Tools \ Attach to Process or hit Ctrl+Alt+P to bring up the dialog. Go to Tools \ Pripojiť k procesu, alebo stlačte Ctrl + Alt + P vyvolajte dialóg.

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. Teraz by ste mali hľadať proces s názvom "sidebar.exe" s názvom nastavená na meno svojho modul gadget a potom kliknite na tlačidlo Pripojiť.

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”. Pre close-up pohľad vidíte, že prístroj beží v samostatnom procese z hlavného panela, ale titul je nastavená na "How-To Geek". image

Now comes the critical step… click to set a breakpoint just to the left of the white area… Teraz prichádza kľúčový krok ... kliknite pre nastavenie prerušenia len na ľavej bielej plochy ...

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. Ak všetko pôjde dobre, budete okamžite presmerovaný na nový súbor s názvom niečo ako x-gadget: / / / main.js a Vaša ladiace nástroje budú aktívne, akonáhle bod zlomu je hit.

image

Note that you can't modify this file, but you can use the Immediate Window to test out any code in real-time. Všimnite si, že nie je možné meniť tento súbor, ale môžete použiť v okne Immediate otestovať ľubovoľný kód v real-time.

Important Notes Dôležité poznámky

  • 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. Pri ladenie prístroj aby ankety každý tak často, že by bolo múdre nastaviť interval naozaj nízka, takže nebudete musieť čakať veľmi dlho, aby mohla spustiť.
  • You can make changes in the original source file, but you will have to close/reopen the gadget and then re-attach to it. Môžete vykonať zmeny v pôvodnom zdrojovom súbore, ale budete musieť uzavrieť / znova prístroj a potom re-pripojiť k nemu.
  • If you get an error about no symbols being loaded, you didn't follow the first step to enable script debugging. Ak sa vyskytne chyba asi žiadne symboly sa zaobchádza, ste po prvým krokom k tomu, aby ladenie skriptov.
  • 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. Budete musieť ručne zadávať názvy premenných, ktoré je sledovať v okne hodinky, ale môžete pohybovať po gadget rovnako ako skutočný debugger mal.

Happy debugging! Happy ladenie!

This article was originally written on 10/9/07 Tagged with: Tento článok bol pôvodne napísaný na 10/9/07 Tagged s: Vista Tips & Tweaks Vista Tipy & Tweak , , Windows Vista Windows Vista

Daily Email Updates Denný Svářeč

You can get our how-to articles in your inbox each day for free. Môžete si naše jak-na články vo vašej schránky každý deň zadarmo. Just enter your name and email below: Stačí zadať svoje meno a e-mail nižšie:


Name: Meno:
Email: E-mail:

Comments (1) Komentáre (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] Ak sa vyskytne chyba asi žiadne symboly sa zaobchádza, ste po prvým krokom k tomu, aby ladenie skriptov. [/ quote]

    Or you didn't completely restart sidebar.exe. Alebo ste sa úplne restart sidebar.exe. Running VistaSP2, IE8, VS2008. Beh VistaSP2, IE8, VS2008. Restart of sidebar.exe was required to reload the debugging settings. Restart sidebar.exe bolo potrebné znovu načítať ladenie nastavenia.


Our Friends Naši priatelia
Getting Started Začíname


About How-To Geek O tom, ako-To Geek
What Is That Process? Čo je to za 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.