[問題] Add-in 裡這些method 不能用...

看板C_Sharp (C#)作者 (奇怪 還沒收到??)時間14年前 (2011/07/17 19:13), 編輯推噓0(008)
留言8則, 3人參與, 最新討論串1/1
是C#的add-in using System; using Extensibility; using EnvDTE; using EnvDTE80; ...繁族不及備載 using Microsoft.VisualStudio.Shell; using Microsoft.VisualStudio.Shell.Interop; using System.Collections; using System.Windows.Forms; using System.IO; ~口卡口卡~ 直接跳到exec public void Exec(string commandName, vsCommandExecOption executeOption, ref object varIn, ref object varOut, ref bool handled) { handled = false; if(executeOption == vsCommandExecOption.vsCommandExecOptionDoDefault) { if(commandName == "ProjectLauncher.Connect.ProjectLauncher") { DisplayLaunchForm(); TestStackFrames((DTE)(_applicationObject)); //主要測試 string string2 = " "; string2 = (string)function_path.Pop(); //解釋: TestStackFrames((DTE)(_applicationObject)); //這個東西是針對 function_path (一個stack),我是把string資料存到裡面去 //問題就在這: 你們看下面幾行,我用了MessageBox.Show要去display function_path //的東西 但是不行的~ ,連下面那個Show Hello? Form 也不行~ //Console 也不鳥我... MessageBox.Show(string2); string2 = (string)function_path.Pop(); MessageBox.Show("Hello? Form", "WinApp"); Console.WriteLine(string2); handled = true; return; } } } ~口卡口卡~ ************************************************************ 是不是在add-in裡面不能用form的API/ 也不能用Console app 的 每個不同的project有各自的輸出函式? 不能混用? And 因為我沒有辦法用debugger去看,所以我只能找類似printf 的方式去把local var. show出來,...VS是不是沒有這種類似的功能阿 / \ 好苦阿... Thanks for millions -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.115.178.77

07/17 21:01, , 1F
寫到指定的文字檔去
07/17 21:01, 1F

07/17 21:03, , 2F
當你要開發WindowsService專案時,也會有相同問題
07/17 21:03, 2F

07/17 23:27, , 3F
請問是甚麼意思...可以請您再多說明嗎?
07/17 23:27, 3F

07/18 01:05, , 4F
Console.WriteLine會輸出到Console介面,MessageBox則會跳
07/18 01:05, 4F

07/18 01:06, , 5F
出視窗,有沒有可能是發生錯誤所以沒有執行到這一段
07/18 01:06, 5F

07/18 01:07, , 6F
或是像上面說的WindowsService類型的專案是沒有輸出介面
07/18 01:07, 6F

07/18 01:07, , 7F
就只可以用寫文字檔的方式輸出訊息
07/18 01:07, 7F

07/18 12:32, , 8F
很有可能是沒有輸出介面xd........
07/18 12:32, 8F
文章代碼(AID): #1E8iFCiK (C_Sharp)
文章代碼(AID): #1E8iFCiK (C_Sharp)