看板 C_Sharp 關於我們 聯絡資訊
是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
wvsrugby:寫到指定的文字檔去 07/17 21:01
wvsrugby:當你要開發WindowsService專案時,也會有相同問題 07/17 21:03
m13m13m:請問是甚麼意思...可以請您再多說明嗎? 07/17 23:27
SnowyFox:Console.WriteLine會輸出到Console介面,MessageBox則會跳 07/18 01:05
SnowyFox:出視窗,有沒有可能是發生錯誤所以沒有執行到這一段 07/18 01:06
SnowyFox:或是像上面說的WindowsService類型的專案是沒有輸出介面 07/18 01:07
SnowyFox:就只可以用寫文字檔的方式輸出訊息 07/18 01:07
m13m13m:很有可能是沒有輸出介面xd........ 07/18 12:32