Using .dll's created in Visual C++ in VB [both forums]
-
hey guys, I am trying to get an idea of how I can write functions in C++ which can be used by visual basic 6 programmers.. anyone have any suggestions on where to get started? i have seen how dlls work looking at the introduction to com article, but that dll doesnt seem to work in vb, keeps giving me 'can't fint dll entry point' errors.. im also considering switching to c#, is it easier to write dlls in c# that to learn how to in c++? if i could just have one example that would work in vb that would help so much.. anyone got any links? thanks a bunch! still a newb.. cut me some slack :P -dz
-
hey guys, I am trying to get an idea of how I can write functions in C++ which can be used by visual basic 6 programmers.. anyone have any suggestions on where to get started? i have seen how dlls work looking at the introduction to com article, but that dll doesnt seem to work in vb, keeps giving me 'can't fint dll entry point' errors.. im also considering switching to c#, is it easier to write dlls in c# that to learn how to in c++? if i could just have one example that would work in vb that would help so much.. anyone got any links? thanks a bunch! still a newb.. cut me some slack :P -dz
use ATL library to create a com component and register it.. from VB instanciate an object of this component..ATL has minimum dependencies... if you want to call the function using (Declare) as you do with API functions..you need to export the C++ functions using a *.def file
LIBRARY LibName //Your dll library name. EXPORTS MakeFile @1 //function name and an optional ordinal position
or See this : http://www.codeguru.com/forum/showthread.php?s=&threadid=225783 -
hey guys, I am trying to get an idea of how I can write functions in C++ which can be used by visual basic 6 programmers.. anyone have any suggestions on where to get started? i have seen how dlls work looking at the introduction to com article, but that dll doesnt seem to work in vb, keeps giving me 'can't fint dll entry point' errors.. im also considering switching to c#, is it easier to write dlls in c# that to learn how to in c++? if i could just have one example that would work in vb that would help so much.. anyone got any links? thanks a bunch! still a newb.. cut me some slack :P -dz
dazinith wrote: anyone have any suggestions on where to get started? The best article that I found if you are strictly going from C++ to VB 6.0 is Calling a C++ DLL from Visual Basic - Introduction[^] dazinith wrote: im also considering switching to c#, is it easier to write dlls in c# that to learn how to in c++? There are many options if you choose to work with .NET. Keep in mind that the .dll's that are created under .NET are assemblies, different than what what VC++ 6.0 would produce as a .dll even though they share the same file extension. -Nick Parker
-
hey guys, I am trying to get an idea of how I can write functions in C++ which can be used by visual basic 6 programmers.. anyone have any suggestions on where to get started? i have seen how dlls work looking at the introduction to com article, but that dll doesnt seem to work in vb, keeps giving me 'can't fint dll entry point' errors.. im also considering switching to c#, is it easier to write dlls in c# that to learn how to in c++? if i could just have one example that would work in vb that would help so much.. anyone got any links? thanks a bunch! still a newb.. cut me some slack :P -dz
dazinith wrote: still a newb.. cut me some slack I'll take this is consideration when answering your questions: dazinith wrote: hey guys, I am trying to get an idea of how I can write functions in C++ which can be used by visual basic 6 programmers.. There are several ways: the simplest form is creating a COM DLL. Not too easy for a newbie, though. dazinith wrote: im also considering switching to c#, is it easier to write dlls in c# that to learn how to in c++? Yes, much simpler: You only need to create a library project, create a class, and in project properties, you set "Register for COM interop" as true. Your DLL is now ready to go in VB 6. There are step-by-step tutorials about this on CP which show how to do this in greater detail, but this is the general procedure.
It's not the fall that kills you: it's the sudden stop - Down by Law, Jim Jamursch (1986)