从 VB6 exe 调试 VB6 dll [英] Debugging VB6 dll from VB6 exe

查看:33
本文介绍了从 VB6 exe 调试 VB6 dll的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个调用 VB6 DLL 的 VB6 程序,而后者又调用另一个 VB6 DLL.当我执行调用程序时,出现了一个我无法查明的应用程序错误,因此我研究了如何在 dll 中看到"错误.

I have a VB6 program that calls a VB6 DLL which in turn calls another VB6 DLL. When I execute the calling program there is an application error which I am unable to pinpoint so I researched how if it was possible to "see" the error in the dll.

我阅读了 Stackoverflow 条目关于调试 VB6 dll 的问题

I read Stackoverflow entry question about debugging VB6 dll

并按照 Booji Boy 的指示创建了一个 vbg.我还按照他的指示从他的参考列表中删除了两个 DLL.调用程序将 .txt 文件作为输入.当我执行 exe 时,我收到了这个错误:

and followed the directions of Booji Boy to create a vbg. I also followed his directions and removed the two DLLs from he Reference list. The calling program takes a .txt file as input. When I executed the exe I received this error:

错误号:13描述:类型不匹配

该错误不是由应用程序生成的.

The error isn't being generated by the application.

这是什么意思?如何调试此问题?

What does this mean? How can I debug this issue?

推荐答案

您必须拥有EXE和两个DLL的所有源代码.您将所有项目添加到单个组文件中,即 VBG.您必须在 EXE 项目中有对第一个 DLL 的引用.我不知道为什么你被告知必须删除它们.您必须在第一个 DLL 项目中引用第二个 DLL 项目.VB 很聪明,可以默默地用项目引用替换 DLL 引用.如果您从项目组中删除 DLL 项目,那么将项目引用替换为 DLL 引用也很聪明.

You must have all the source code for the EXE and the two DLLs. You add all the projects into single group file i.e. the VBG. You must have a reference in the EXE project to the first DLL. I have no idea why you have been told you have to remove them. You must have a reference in the first DLL project to the second DLL project. VB is clever enough to silently replace the DLL reference with the project reference. It is also clever enough to silently replace the project reference with the DLL reference if you remove a DLL project from the project group.

确保您将错误处理设置为Break on All Errors"或Break in Class".

Make sure you have error handling set to "Break on All Errors" or "Break in Class".

类型不匹配错误可能发生在简单的事情中,例如将非数字字符串分配给数字变量.如果您传递对象引用,它会变得更加复杂.如果您看到此错误发生在以下内容上:

The type mismatch error can occur from simple things like assign a non-numeric string to an numeric variable. It gets more complicated if you are passing object references around. If you see this error occurs on something like:

设置 myObject = someOtherObject

...看起来它们应该是同一类型,这可能会变得非常复杂.但首先,我会让你进行调试.

... and it looks as if they should be the same type, this might get very complicated. But first, I'll let you do the debug.

这篇关于从 VB6 exe 调试 VB6 dll的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆