作者m13m13m (奇怪 还没收到??)
看板C_Sharp
标题[问题] Add-in 里这些method 不能用...
时间Sun Jul 17 19:13:14 2011
是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
1F:→ wvsrugby:写到指定的文字档去 07/17 21:01
2F:→ wvsrugby:当你要开发WindowsService专案时,也会有相同问题 07/17 21:03
3F:→ m13m13m:请问是甚麽意思...可以请您再多说明吗? 07/17 23:27
4F:→ SnowyFox:Console.WriteLine会输出到Console介面,MessageBox则会跳 07/18 01:05
5F:→ SnowyFox:出视窗,有没有可能是发生错误所以没有执行到这一段 07/18 01:06
6F:→ SnowyFox:或是像上面说的WindowsService类型的专案是没有输出介面 07/18 01:07
7F:→ SnowyFox:就只可以用写文字档的方式输出讯息 07/18 01:07
8F:→ m13m13m:很有可能是没有输出介面xd........ 07/18 12:32