如何调试由 vb6/vba 应用程序调用的 vs 2008 c# express dll?

发布于 2024-08-02 07:47:58 字数 695 浏览 5 评论 0原文

我有 ac# dll,它被编写为充当包装器,从数据源获取数据并将其传递给 vba/powerpoint ppa 应用程序。我对 vba 没有太多经验,这就是为什么我使用 vb6 来模拟这个,我对 vb6 稍微了解一点。

我现在遇到了足够多的问题,试图理解 com 和 ccw 的语法以及复杂的工作原理。所以我正在寻找一种方法来调试为什么该函数没有返回任何数据,并且如果可能的话,当 vb6 应用程序调用它时,对 .net dll 进行逐行演练。

最初我想在 .net dll 中放入一个函数,该函数将写入外部文件,但这似乎不起作用,我不知道为什么。

我做了一些谷歌搜索并发现有一个附件处理这可能对我的情况有用,但该功能是 仅在 vs studio 完整版中可用n。

所以我希望有其他工具、方法可以让我正确调试 vb6/vba 应用程序和 .net dll 之间发生的情况。

谢谢。

i have a c# dll which is written to act as a wrapper to grab data from a data source and pass it to a vba/powerpoint ppa application. i don't have much experience with vba which is why i'm simulating this using vb6 which i know a tiny bit more about.

i'm having enough problem as of now trying to understand the syntax and what not for the intricate workings of com and ccw. so i'm looking for a way to debug on why the function isn't returning me any data, and if possible have a line by line walkthrough of the .net dll when the vb6 app is calling it.

initially i thought of putting in a function inside the .net dll which will write out to an external file but that doesn't seems to be working and i don't know why.

i did some googling and found out that there's a attach to process which could be useful for my case but that feature is only available in vs studio full version.

so i'm hoping there's other tools, methods that i can use which can allows me to properly debug what's going on between the vb6/vba app and the .net dll.

thanks.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

笑,眼淚并存 2024-08-09 07:47:58

不幸的是,附加到进程对您来说不可用,因为这是要走的路。

在 .net dll 中放置适当的 Debug.Assert(false); 是强制显示调试器的一种方法。

您还可以尝试 Debugger.Break(); ,它会强制设置断点并询问您是否要附加调试器。

DebugDebugger 都位于 System.Diagnostics 命名空间中。

Too bad attach to process isn't available to you because that is the way to go.

A well placed Debug.Assert(false); in the .net dll is one way to force a debugger to show up.

You could also try Debugger.Break(); which should force a breakpoint and ask you if you want to attach a debugger.

Both Debug and Debugger are in the System.Diagnostics namespace.

陌上芳菲 2024-08-09 07:47:58
  1. 在 Visual Studio 中打开 C# 项目的项目属性。
  2. 进入调试页面。
  3. 选择“启动外部程序”并浏览到 VB.exe(很可能是 C:\Program Files\Microsoft Visual Studio\VB98\VB6.EXE)。
  4. 可选:在命令行参数中输入 VB6 项目的 .vbp 文件的路径。

当您运行 C# 项目(“调试”->“开始调试”或 F5)时,它将启动 VB6。您可以在 C# 项目中放置任何您想要的断点。当您启动 VB6 项目时,调试器将停止在 VS2005/ 处。 2008 断点。您还可以使用调试 C# 项目时的即时窗口和任何其他调试选项。

  1. Open up the Project properties in Visual Studio for the C# project.
  2. Go to the Debug page.
  3. Select 'Start external program' and browse to the VB.exe (most likely C:\Program Files\Microsoft Visual Studio\VB98\VB6.EXE.
  4. Optional: Enter the path to your VB6 project's .vbp file in the command line arguments.

When you run your C# project (Debug->Start Debugging or F5), it will start VB6. You can put any breakpoints you want in your C# project. When you start up your VB6 project, the debugger will stop at your VS2005/2008 breakpoint. You'll also be able to use the immediate window and any other debugging options that you would when debugging a C# project.

怀中猫帐中妖 2024-08-09 07:47:58

将其添加

<StartAction>Program</StartAction>
<StartProgram>C:\Program Files\NUnit-Net-2.0 2.2.8\bin\nunit-gui.exe</StartProgram>

到我的 C# Express 2008 项目的 .csproj 文件中的 PropertyGroup 元素下,对我来说就成功了
详细信息)。

Adding this

<StartAction>Program</StartAction>
<StartProgram>C:\Program Files\NUnit-Net-2.0 2.2.8\bin\nunit-gui.exe</StartProgram>

to my C# Express 2008 project's .csproj file, under the PropertyGroup element, did the trick for me
(details here).

︶ ̄淡然 2024-08-09 07:47:58

在 Visual C# Express Edition 之上下载并安装 Visual C++ Express Edition。两者都是完全免费的,这将使您能够在调试器中“附加到进程”

Download and install Visual C++ Express Edition on top of Visual C# Express Edition. Both are completely free, and that will give you the ability to "attach to process" in the debugger

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文