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

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

问题描述

我有一个VB6程序,该程序调用一个VB6 DLL,然后依次调用另一个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说明:类型不匹配

应用程序未生成错误.

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

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.

请确保将错误处理设置为打破所有错误"或类突破".

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天全站免登陆