473,725 Members | 2,243 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.d ll /tlb:ClassLibrar y1.tlb

It seemed to work.

So I added the tlb to my vb6 references.

I can:

dim obj as ClassLibrary1.C lass1

but when I execute:

set obj = new ClassLibrary1.C lass1

I get a:

Automation error

cannot create a file when that file already exists

dim obj as object
set obj = createobject("C lassLibrary1.Cl ass1")

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 2670
* "Eric Fortin" <em******@comca st.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.Descriptio n
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******@comca st.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\micr osoft.net\frame work\v1.1.4322\ mscorwks.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******@comca st.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******@comca st.net> wrote in message
news:BnXkb.8312 02$Ho3.234698@s ccrnsc03...
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\micr osoft.net\frame work\v1.1.4322\ mscorwks.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******@comca st.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******@comca st.net> wrote in messag
news:BnXkb.8312 02$Ho3.234698@s ccrnsc03..
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\micr osoft.net\frame work\v1.1.4322\ mscorwks.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******@comca st.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
2011
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 minus 6 hours. Can anyone help me with that? Her's the code: <?php header("Cache-Control: no-cache, must-revalidate"); header("Pragma: no-cache"); ?>
4
2279
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 6 hours wrong. The time should be GMT minus 6 hours. Can anyone help me with that? Her's the code: <?php header("Cache-Control: no-cache, must-revalidate"); header("Pragma: no-cache");
4
2577
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 original value of addr. addr = incident.findNextSibling('td') addr.append('%s;') thanks
1
1924
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 is the ASP Code..From Frontpage. <html>
38
2537
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 my scanf ("%c",&q); On input 3 4 1 (for a,b and c) I had real roots OK On input 1 8 16 I had same real roots OK. However on 4 2 5, (for imaginary roots ) the computer cannot see the scanf ("%c",&q); statement. It just jumps...
4
2750
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 link, if viewed as a full screen. If you shrink the window down the Fees link then becomes a link. The link works in IE and Mozilla. I've validated the CSS and XHTML, the CSS had no errors, the XHTML has no errors other than the paramaters for the...
23
2794
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 place a link on there site so people can vote for their program, "ad a click". eg someone clicks the link on some page and it counts +1 click on my page. if some one clicks the link below it will count a click on my page.
0
768
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 sample: <Urls> <add key="/Shoes/-pg(\d+)\.aspx" value="/Shoes/Default.aspx?pg=$1"/> <add key="/Shoes/-t(\d+)\.aspx" value="/Shoes/Default.aspx?t=$1"/> <add key="/Shoes/-t(\d+)-pg(\d+)\.aspx" value="/Shoes/Default.aspx?t=$1&amp;pg=$2"/> <add...
0
920
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 value="&lt;$pagenum&gt;" /> </xrefdef> <xrefdef id="2" name="`Page'">
1
2796
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 use when querying the database. Right now it is only looking for a match on one of those dropdowns and not all 3. can anyone help? Here is the code: <form BOTID="0" METHOD="POST" action="businessforsale_interface/Results/test3.asp">
0
8889
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9257
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9179
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9116
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8099
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6702
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4784
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3228
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2637
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.