Wrox Programmer Forums
|
Pro VB 6 For advanced Visual Basic coders working in version 6 (not .NET). Beginning-level questions will be redirected to other forums, including Beginning VB 6.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Pro VB 6 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 30th, 2003, 01:22 PM
Authorized User
 
Join Date: Dec 2003
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default Creating a DLL using VB

I would like to create a DLL using VB, but NOT CREATING a Class, which forces invokation of the routines/functions stored in the DLL to be called as methods of a "ficticious" class. Rather, I would like to create my functions as standard functions in standard modules, so when called they are called as if they were normal VB functions

Is it possible? And, if so, how?

thanks
gisvb

 
Old December 30th, 2003, 01:42 PM
Friend of Wrox
 
Join Date: Aug 2003
Posts: 205
Thanks: 0
Thanked 0 Times in 0 Posts
Default

You can set your class to global multiuse. A class that is global multiuse does not require instantiation.
 
Old December 30th, 2003, 02:48 PM
Authorized User
 
Join Date: Dec 2003
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default

thanks, after tiding my code, the invokation of a function stored in a dll crashes because it can not find the "entry point"

I am using VBA as main language, and the dll has been built using VB Studio 6... I am using a simple function like

public function multiplicar(a as double, b as double) as double
 multiplicar=a*b
end function

Any suggestions for that ?

thanks

 
Old December 30th, 2003, 03:29 PM
Friend of Wrox
 
Join Date: Aug 2003
Posts: 205
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I assume you are working off a dll that has a globalmultiuse class. Try creating a new Dll with the same functions (cut and paste). It may be when switching over the dll went flaky.
 
Old December 30th, 2003, 05:07 PM
Authorized User
 
Join Date: Dec 2003
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default

thanks. I tried creating from scratch, but it can find the entry point.

It should be some basic error on my side, since all the stuff is very simple, but I must have missed something.

Anyway, the VBEditor recognizes de function, because when writing the name and the opening parenthesis it shows (in a tip) the arguments, so...... but at run time something happens.....

Any suggestions on that?

thanks again

 
Old December 30th, 2003, 05:39 PM
Authorized User
 
Join Date: Dec 2003
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Does anyone know how to "extract" the function names contained in a dll?. I have read that the exported names in a dll might have suffixes added to the function names,... so maybe I have to check now what function names/entry points my dll has....



 
Old December 31st, 2003, 11:00 AM
Friend of Wrox
 
Join Date: Aug 2003
Posts: 205
Thanks: 0
Thanked 0 Times in 0 Posts
Default

You said a new dll can find the entry point. Is this a typo? If not, why not just go with the new dll?
 
Old January 1st, 2004, 05:22 PM
Authorized User
 
Join Date: Dec 2003
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default

sorry, yes, it was a typo.... Entry Point CANNOT be found, so I am stuck here, without knowing what more to test... maybe registering through regsvr32???

 
Old January 1st, 2004, 06:52 PM
Friend of Wrox
 
Join Date: Aug 2003
Posts: 205
Thanks: 0
Thanked 0 Times in 0 Posts
Default

If you have not registered, then do so. Regardless of whether you are going to instantiate the DLL it still needs to be registered.
 
Old January 2nd, 2004, 03:00 PM
Authorized User
 
Join Date: Dec 2003
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I registered the dll successfully, but running the program again, crashes as usual because it is unable to find the entry point

Has to be something basic that I am doing wrong, or my computer has a strange setup somewhere...???






Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating dll prafullaborade General .NET 1 July 4th, 2008 01:50 PM
Creating Active X DLL CoolEJ VB Databases Basics 7 November 30th, 2007 02:29 PM
How to convert .NET dll to COM dll used by VB 6.0 gvprashanth .NET Framework 1.x 0 December 4th, 2006 05:05 AM
Creating a DLL at runtime jai2k Beginning VB 6 1 January 5th, 2005 01:23 PM
creating an activex dll amc VB Components 7 June 25th, 2004 05:10 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.