Solved

Using a vb6 dll-VERY EASY QUESTION

Posted on 2006-06-27
9
203 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
Comment Utility
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
Comment Utility
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
Comment Utility
Does this work?

Dim WithEvents NewIM As New IMDLL.Sniffer

Bob
0
 
LVL 9

Author Comment

by:justchat_1
Comment Utility
WOW how did I not see that!
That works in .NET also?
0
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

 
LVL 96

Expert Comment

by:Bob Learned
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
Should go to Bob, unless you actually needed my comment. He helped out more.  Dave
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

743 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now