Subscribe to How-To Geek Mag-subscribe sa Paano-Upang Geek

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 Paano Debug isang Windows Vista Sidebar Gadget Sa pamamagitan ng Visual Studio

One of the ancillary benefits of our Isa sa mga ancillary mga benepisyo ng ating Vista Gadget breaking Vista paglabag ng Gadget 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. at ang aking email pagpuno up sa mga reklamo ay na ko natutunan kung paano mag-debug ng Vista Gadget sa Visual Studio, kaya ako sa pagbabahagi ng yaman sa lahat ng tao.

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. Para sa mga exercise na ito kailangan mo ng isang kopya ng Visual Studio 2005 at isang nasira Vista Gadget, ngunit maaari kang marahil iakma ito upang magtrabaho sa isang iba't ibang mga kasangkapan kung susubukan mo.

Critical Step: Enable Script Debugging Kritikal na Hakbang: Paganahin ang Script debugging

Open up Internet Explorer's Options panel, find the Advanced tab and uncheck the boxes for “Disable script debugging”. Buksan up ang Opsyon panel ng Internet Explorer, hanapin ang Advanced tab at alisan ng tsek ang mga kahon para sa "disable ang script debugging".

imahen

After you are done debugging you'll probably want to turn this off, as it can get quite annoying while browsing. Pagkatapos kayo ay tapos na debugging makikita mo marahil nais na turn off na ito, gaya ito maaari kumuha ganap nakakainis habang nagba-browse.

Open Your Gadget Code Buksan ang iyong Gadget Code

After installing your gadget, Windows will unpack and copy the files to a folder in your user profile. Matapos ang pag-install ng iyong gadget, Windows ay alisan ng laman at kopyahin ang mga file sa isang folder sa iyong user profile. We'll need to find this folder and open the javascript file that makes up the logic for your gadget. Aming kailangan upang mahanap ang folder na ito at buksan ang javascript file na gumagawa ang lohika para sa iyong mga gadget.

Just paste the following into the Explorer address bar: Basta i-paste ang mga sumusunod sa bar Explorer address:

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

imahen

You'll see a list of directories for all the gadgets installed into your profile. Makikita mo ang isang listahan ng mga direktoryo para sa lahat ng mga gadget na naka-install sa iyong profile. Open up the main javascript file in Visual Studio. Buksan ang pangunahing file javascript sa Visual Studio.

Attach to Sidebar Process Isama sa Sidebar Proseso

Next we'll need to attach to the specific sidebar process for your gadget. Susunod na kakailanganin naming isama sa mismong sidebar proseso para sa iyong gadget. (Make sure your gadget is running before you do this step) (Siguraduhin na ang iyong gadget ay tumatakbo bago mo gawin ang hakbang na ito)

Go to Tools \ Attach to Process or hit Ctrl+Alt+P to bring up the dialog. Pumunta sa Tools \ Isama sa Proseso o pindutin ang Ctrl + Alt + P upang dalhin ang dialog.

imahen

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. Ngayon na dapat mong hanapin para sa isang proseso na pinangalanang "sidebar.exe" na may pamagat na naka-set sa ang pangalan ng iyong gadget, at pagkatapos ay i-click ang Maglakip ng button.

imahen

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”. Para sa isang close-up view, makikita mo na gadget ay tumatakbo sa ilalim ng isang hiwalay na proseso mula sa pangunahing sidebar, ngunit ang pamagat ay naka-set sa "How-To Geek". imahen

Now comes the critical step… click to set a breakpoint just to the left of the white area… Ngayon ay dumating ang mga kritikal na mga hakbang ... i-click upang magtakda ng isang breakpoint lamang sa kaliwa ng ang puting lugar ...

imahen

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. Kung ang lahat ng napupunta rin, ikaw ay agad-agad ay dadalhin sa isang bagong file na pinangalanan ng isang bagay tulad ng x-gadget: / / / main.js at ang iyong mga debugging tools ay magiging aktibo sa lalong madaling breakpoint ang pagtama.

imahen

Note that you can't modify this file, but you can use the Immediate Window to test out any code in real-time. Tandaan na hindi mo maaaring baguhin ang file na ito, ngunit maaari mong gamitin ang agarang Window sa pagsubok ng anumang code sa real-time.

Important Notes Mahalaga Notes

  • 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. Kapag debugging isang gadget na mga lugar ng botohan sa bawat kaya madalas, magiging matalino sa set ang interval talagang mababa upang hindi na kayo kailangang maghintay ng masyadong mahaba para sa mga ito upang ma-trigger.
  • You can make changes in the original source file, but you will have to close/reopen the gadget and then re-attach to it. Maaari kang gumawa ng mga pagbabago sa orihinal na pinagmulan ng file, ngunit kailangan mong isara / buksang muli ang gadget at pagkatapos ay muling ilakip sa mga ito.
  • If you get an error about no symbols being loaded, you didn't follow the first step to enable script debugging. Kung makakuha ka ng isang error na hindi tungkol sa mga simbolo ng pagiging puno, hindi mo sundin ang mga unang hakbang upang paganahin ang 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. Kailangan ninyong manwal na ipasok ang pangalan ng variable na panoorin sa kahon sa Watch, ngunit maaari kang hakbang sa pamamagitan ng mga gadget na katulad ng isang tunay na debugger dapat.

Happy debugging! Happy debugging!

This article was originally written on 10/9/07 Tagged with: Vista Tips & Tweaks Vista Tips at Tweaks , , Windows Vista Windows Vista

Daily Email Updates Araw-araw na Updates Email

You can get our how-to articles in your inbox each day for free. Maaari kang makakuha ng aming kung-paano na mga artikulo sa iyong inbox sa bawat araw para sa libre. Just enter your name and email below: Ilagay lamang ang inyong pangalan at email sa ibaba:


Name: Pangalan:
Email: Email:

Comments (1) Comments (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] Kung makakuha ka ng isang error na hindi tungkol sa mga simbolo ng pagiging puno, hindi mo sundin ang mga unang hakbang upang paganahin ang script debugging. [/ quote]

    Or you didn't completely restart sidebar.exe. O hindi mo lubos na i-restart ang sidebar.exe. Running VistaSP2, IE8, VS2008. Tumatakbo VistaSP2, IE8, VS2008. Restart of sidebar.exe was required to reload the debugging settings. I-restart ng sidebar.exe ay kinakailangan na i-reload ang mga setting ng debugging.


Leave a Comment Iwanan ng isang Puna




Leave your Iwanan ang iyong mga friendly friendly comment here. puna dito.

If you have a computer help question, Kung ikaw ay may isang computer ng tulong tanong, click here to leave it on the forums i-click dito upang mag-iwan ito sa forums instead. sa halip ng.

Note: Your comment may not show up immediately on the site. Tandaan: ang iyong puna ay maaaring hindi magpapakita agad sa site.

Our Friends Ang aming mga Friends
Getting Started Pagsisimula


About How-To Geek Tungkol sa Paano-Upang Geek
What Is That Process? Ano ba ang Proseso Iyon?
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.