Solved

Using a vb6 dll-VERY EASY QUESTION

Posted on 2006-06-27
9
205 Views
Last Modified: 2010-04-23
I am trying to refernce a vb6 dll from vb.net.
It should be very easy to do from what I have read but I know vb6 not .NET

I tried:
Dim NewIM As New IMDLL.Sniffer
NewIM.adapter = 1
NewIM.startTrap = 1

and it gives no compile errors however the event that is supposed to be raised is not occuring
0
Comment
Question by:justchat_1
  • 4
  • 3
  • 2
9 Comments
 
LVL 9

Author Comment

by:justchat_1
ID: 16996297
Will award up to 100 points for a simple answer or link, more if it is more complicated then I thought...
0
 
LVL 4

Expert Comment

by:davehunt00
ID: 16996545
I think all you need to do is make sure you're referencing the DLL in the project.

So, right-click on the Project and select Add Reference.  You can browse the DLL (which you should put in \bin) to select.

Try that and see if that helps.
Dave
0
 
LVL 96

Accepted Solution

by:
Bob Learned earned 30 total points
ID: 16997395
Does this work?

Dim WithEvents NewIM As New IMDLL.Sniffer

Bob
0
Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

 
LVL 9

Author Comment

by:justchat_1
ID: 16998191
WOW how did I not see that!
That works in .NET also?
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 17000138
Yep.  There is still some left over from VB6 days, heck even QW-BASIC days with the Goto <label>.

Bob
0
 
LVL 9

Author Comment

by:justchat_1
ID: 17006292
Unfortunatly not the problem...I am trying to pass back a struct with three strings.  I read something about needing to include me.hwnd in the function call?  Are there any differences I should know about when coding in vb6 for vb.NET
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 17008554
Could you give me some kind of picture of what you just described?  Not enough information there to make any sense of what you mean.

Bob
0
 
LVL 9

Author Comment

by:justchat_1
ID: 17018792
Problem solved I believe...as soon as I get confirmation Ill award points anyway

Any objections to a point split between davehunt00 and TheLearnedOne?
0
 
LVL 4

Expert Comment

by:davehunt00
ID: 17018905
Should go to Bob, unless you actually needed my comment. He helped out more.  Dave
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question