想要在VB6.0中创建对象 [英] Want to create an object in VB6.0

查看:469
本文介绍了想要在VB6.0中创建对象的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好朋友,

我使用VB6创建了一个示例dll,即SimpleCalculator.dll,并注册了该文件,并使用sample_testpage.asp测试了相同的dll.它在ASP经典页面中效果很好.

现在,我想在另一个vb项目中使用相同的dll.为此

我创建了一个新项目,并通过project-> reference->添加了参考.浏览了dll文件.

我在dll类文件中添加的方法已成功弹出.

但是,当我运行该项目时,会出现错误,例如对象变量或带有块变量
未设置".

我不知道我在哪里.

敬请指教.

关于问候

R.K.PRABAKAR

Hello friends,

I created a sample dll namely SimpleCalculator.dll using VB6, and i registered and I tested the same dll using sample_testpage.asp. It works good in asp classic page.

Now I want to use the same dll in another vb project. For that

I created a new project and added a reference through project-->reference--> browsed the dll file.

The methods that i added in dll class files are popping up successfully.

But when i ran the project, error is raised as "Object variable or With block variable
not set".

I do not know where i am lacking.

kindly advise.

With regards

R.K.PRABAKAR

推荐答案

您没有发布代码,反正请查看下面的链接以获取解决方案

对象变量或未设置带块变量(错误91)-应用程序的Visual Basic参考 [ ^ ]
You didn''t post your code, anyway check the below link for the solution(s)

Object variable or With block variable not set (Error 91) - Visual Basic for Applications Reference[^]


我只是尝试创建一个对象,就像

Dim Obj as Class1

它会抛出该错误,然后我尝试使用以下代码进行对象创建,然后效果很好

Dim Obj作为新的Class1

谢谢大家!!!
I just tried to create an object just like

Dim Obj as Class1

it throws that error, then i tried the following code for object creation then it works fine

Dim Obj as new Class1

Thanks folks !!!


这篇关于想要在VB6.0中创建对象的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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