473,396 Members | 1,893 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Help: VB6 & VB.net

I'm trying to create a classlibrary in VB.net and call it from VB6.

I can't figure it out.

I created a .net project

Created a proc DoSomething

Sub DoSOmething()
msgbox ("You did something")
end sub

Then I compiled it.

I then Tried to create a reference in vb6, but got an error. (cannot load
project or library)

So then I tried

regasm ClassLibrary1.dll /tlb:ClassLibrary1.tlb

It seemed to work.

So I added the tlb to my vb6 references.

I can:

dim obj as ClassLibrary1.Class1

but when I execute:

set obj = new ClassLibrary1.Class1

I get a:

Automation error

cannot create a file when that file already exists

dim obj as object
set obj = createobject("ClassLibrary1.Class1")

produces the same error.

WHat am I doing wrong. How do I call a vb.net dll from vb6.

It works when I call the class lib from another vb.net project.
Please help!!!
Nov 20 '05 #1
5 2647
* "Eric Fortin" <em******@comcast.net> scripsit:
I'm trying to create a classlibrary in VB.net and call it from VB6.


<http://mvps.org/dotnet/dotnet/samples/codingtechnique/downloads/MyComLib.zip>

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>
Nov 20 '05 #2
This is still giving me an error:

The first time and after every reboot:

when I do the Set p = new Person

This the error information
?err.Description
Automation error
Cannot create a file when that file already exists.
?err.Number
-2147024713
?err.Source
MyComLib

"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:bn************@ID-208219.news.uni-berlin.de...
* "Eric Fortin" <em******@comcast.net> scripsit:
I'm trying to create a classlibrary in VB.net and call it from VB6.

<http://mvps.org/dotnet/dotnet/sample...ds/MyComLib.zi
p>
--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>

Nov 20 '05 #3
I forgot to include the first error:

TItle:
vb6.exe MSCOREE.DLL load error(error code = %X)

Two different copies of MSCOREE.dll have been loaded.

First Copy
<Unknown>

Second Copy
C:\windows\microsoft.net\framework\v1.1.4322\mscor wks.dll

THis is typically caused by having a registered MSCOREE.dll that is
different from the one that is statically linked with the application.

"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:bn************@ID-208219.news.uni-berlin.de...
* "Eric Fortin" <em******@comcast.net> scripsit:
I'm trying to create a classlibrary in VB.net and call it from VB6.

<http://mvps.org/dotnet/dotnet/sample...ds/MyComLib.zi
p>
--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>

Nov 20 '05 #4
EP
I also get this error during an .msi installation.

Does anyone know what causes this?
"Eric Fortin" <em******@comcast.net> wrote in message
news:BnXkb.831202$Ho3.234698@sccrnsc03...
I forgot to include the first error:

TItle:
vb6.exe MSCOREE.DLL load error(error code = %X)

Two different copies of MSCOREE.dll have been loaded.

First Copy
<Unknown>

Second Copy
C:\windows\microsoft.net\framework\v1.1.4322\mscor wks.dll

THis is typically caused by having a registered MSCOREE.dll that is
different from the one that is statically linked with the application.

"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:bn************@ID-208219.news.uni-berlin.de...
* "Eric Fortin" <em******@comcast.net> scripsit:
I'm trying to create a classlibrary in VB.net and call it from VB6.

<http://mvps.org/dotnet/dotnet/sample...ds/MyComLib.zi p>

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>


Nov 20 '05 #5
I got this same error after installing Installshield DevStudio 9. It happens when I try to load a form. I have Enterpries Architect installed. Another machine we have has VS Pro and does not have the problem. I uninstalled IS and the error went away. I still don't know what is going on though

----- EP wrote: ----

I also get this error during an .msi installation

Does anyone know what causes this
"Eric Fortin" <em******@comcast.net> wrote in messag
news:BnXkb.831202$Ho3.234698@sccrnsc03..
I forgot to include the first error
TItle

vb6.exe MSCOREE.DLL load error(error code = %X
Two different copies of MSCOREE.dll have been loaded
First Cop

<Unknown>>> Second Cop
C:\windows\microsoft.net\framework\v1.1.4322\mscor wks.dl
THis is typically caused by having a registered MSCOREE.dll that i

different from the one that is statically linked with the application
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in messag

news:bn************@ID-208219.news.uni-berlin.de..
* "Eric Fortin" <em******@comcast.net> scripsit
I'm trying to create a classlibrary in VB.net and call it from VB6
><http://mvps.org/dotnet/dotnet/sample...ads/MyComLib.z

p>>>>> --
Herfried K. Wagne
MVP · VB Classic, VB.NE
<http://www.mvps.org/dotnet>>>

Nov 20 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Gerry | last post by:
Help needed with this: I have had a guestbook-page in Europe and will now have to move it to a US based-server. This makes the time-function showing time 6 hours wrong. The time should be GMT...
4
by: Gerry | last post by:
As I'm not a PHP-prgrammer at all, I just need Help with this: I have had a guestbook-page in Europe and will now have to move it to a US based-server. This makes the time-function showing time...
4
by: yaffa | last post by:
dear folks, i'm trying to append a semicolon to my addr string and am using the syntax below. for some reason the added on of the ; doesn't work. when i print it out later on it only shows the...
1
by: Jeff | last post by:
I am getting Unable to find operator in query string. Query string currently is INSERT INTO Results (Name,Email,Comments,File) VALUES ('::Name::','::Email::','::Comments::','::File::') Here...
38
by: Red Dragon | last post by:
I am self study C student. I got stuck in the program below on quadratic equation and will be most grateful if someone could help me to unravel the mystery. Why does the computer refuse to execute...
4
by: jereme.goblue | last post by:
The web page at http://www.rossowinspections.com/ has an issue with the left menu. The left menu has 7 links. One of the links doesn't work. Using Firefox 1.5 the Fees link isn't a clickable...
23
by: casper christensen | last post by:
Hi I run a directory, where programs are listed based on the number of clicks they have recieved. The program with most clicks are placed on top and so on. Now I would like people to be apple to...
0
by: Roshawn | last post by:
Hi, I'm doing url rewriting with the help of the Regex class. In my web.config file I have my rewrite rules specified. However, I have a lot of them as I have a dynamic storefront. Here's a...
0
by: xenia200 | last post by:
I HAVE THIS FOR EXAMPLE <misc> <cntextdef /> <vntextdef /> <xreflist> <xrefdef id="1" name="`Heading &amp; Page'"> “<ut value="&lt;$paratext&gt;" />” on page<ut...
1
by: Webstorm | last post by:
Hi, I hope someone can help me sort this out a bit, Im completely lost. Here is the page I am working on: http://www.knzbusinessbrokers.com/default.asp I have 3 search critera that I need to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.