Go Back  Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > General > import classes from dll's???


Reply
 
Thread Tools Display Modes
  #1  
Old 09-14-2005, 02:26 AM
vb-3d vb-3d is offline
Regular
 
Join Date: Jul 2004
Posts: 71
Default import classes from dll's???


any one knows how to import classes from dll files in vb6?
in .net
Imports System.IO
what is the equivelant of it???
i am trying to import the class MemoryStream fro mscorlib.dll
any idea how to do that in vb6???
Reply With Quote
  #2  
Old 09-14-2005, 02:36 AM
Flyguy's Avatar
Flyguy Flyguy is offline
Lost Soul

Super Moderator
* Guru *
 
Join Date: May 2001
Location: Vorlon
Posts: 18,883
Default

If mscorlib.dll is an activex dll then you first have to make a reference to the dll.
Then you can use the available classes (I used a fake name):
Code:
Dim cMemoryStream As clsMemoryStream
Reply With Quote
  #3  
Old 09-14-2005, 09:14 AM
vb-3d vb-3d is offline
Regular
 
Join Date: Jul 2004
Posts: 71
Default

the problem is it cant be added to refrences
i think it has to be called in same way of calling functions from dll
where we say
declare function XXXXXXXX lib XXXXX.dll
we use this way without add the dll in refrences
Reply With Quote
  #4  
Old 09-14-2005, 09:20 AM
OnErr0r's Avatar
OnErr0r OnErr0r is offline
Obsessive OPtimizer

Administrator
* Guru *
 
Join Date: Jun 2002
Location: Debug Window
Posts: 13,685
Default

You'll have to create a CCW (COM Callable Wrapper) in .net that wraps the MemoryStream methods. Then call that in VB6.

Alternatively, consider using the IStream interface and writing a wrapper around it.
__________________
Quis custodiet ipsos custodues.
Reply With Quote
  #5  
Old 09-14-2005, 09:33 AM
vb-3d vb-3d is offline
Regular
 
Join Date: Jul 2004
Posts: 71
Default

i dont understand that
i am still studying .NET and i am not that strong to do that
all i am asking for is
what is the equvelant statment of
"#include" or "imports" in vb6
is that too hard to be done??????
Reply With Quote
  #6  
Old 09-14-2005, 10:09 AM
OnErr0r's Avatar
OnErr0r OnErr0r is offline
Obsessive OPtimizer

Administrator
* Guru *
 
Join Date: Jun 2002
Location: Debug Window
Posts: 13,685
Default

VB6 and .Net are not compatible with one another, not without creating a compatibility layer. This is what CCW does.

COM Callable Wrapper
__________________
Quis custodiet ipsos custodues.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->