msvisual.com Forum Index
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Using the functions

 
Post new topic   Reply to topic    msvisual.com Forum Index -> VB Enterprise
Author Message
ThomasE



Joined: 04 Oct 2007
Posts: 3

PostPosted: Tue Jan 15, 2008 11:00 pm    Post subject: Using the functions Reply with quote

For example

I have created many functions and procedures in the AddIn (MyAddin.dll) for
using in other VB6 applications.
One of this function called

Cosh(Alfa as Double) as double (defined as public)

Normaly will be declared Functions from .dll modules in the form

Private Declare Function GetProfileString Lib "kernel32" Alias _
"GetProfileStringA" (ByVal lpAppName As String, _
ByVal lpKeyName As String, ByVal lpDefault As String, _
ByVal lpReturnedString As String, _
ByVal nSize As Long) As Long

What should be the syntax for the function call Cosh(Alfa) in the module
MyAddin.dll (see function definition above)?

Archived from group: microsoft>public>vb>enterprise
Back to top
View user's profile Send private message
Ken Halter



Joined: 04 Oct 2007
Posts: 4150

PostPosted: Tue Jan 15, 2008 2:05 pm    Post subject: Re: Using the functions Reply with quote

"ThomasE" wrote in message
news:%23jC%23vg5VIHA.4768@TK2MSFTNGP02.phx.gbl...
> For example
>
> I have created many functions and procedures in the AddIn (MyAddin.dll)
> for using in other VB6 applications.
> One of this function called

You don't create Declares for ActiveX components. You create references to
them and, at runtime, create instances of their public classes... but, as I
mentioned when you asked this before, your "Add In" is not designed to work
like you might think it is. If you use its functions, you *will need to
package it with any app that uses it*


--
Ken Halter - MS-MVP-VB - Please keep all discussions in the groups..
In Loving Memory - http://www.vbsight.com/Remembrance.htm
Back to top
View user's profile Send private message
Bob Butler



Joined: 04 Oct 2007
Posts: 1081

PostPosted: Tue Jan 15, 2008 2:09 pm    Post subject: Re: Using the functions Reply with quote

"ThomasE" wrote in message
news:%23jC%23vg5VIHA.4768@TK2MSFTNGP02.phx.gbl...
> For example

Please don't start a new thread; reply to a post in the existing thread
instead

> I have created many functions and procedures in the AddIn (MyAddin.dll)
> for using in other VB6 applications.

I think your terminology is confusing people; an addin is something you load
into the VB IDE to help when coding. It is a DLL but it's a special-purpose
one with specific functionality so that VB knows how to call it.

A set of classes can be compiled into a DLL for use by any application that
knows how to call them but that's not generally called an addin, especially
in the VB world.

> One of this function called
>
> Cosh(Alfa as Double) as double (defined as public)
>
> Normaly will be declared Functions from .dll modules in the form

There are two kinds of DLLs; the API call you showed as an example is a
"standard" DLL and that's how windows exposes it's functions. VB can not
create that kind of DLL (at least not without help). When you create a DLL
in VB you create an ActiveX DLL which is used from other projects by adding
a reference to it and creating an instance using new as in:
Dim x As MyAddin.MyClassname
set x=new MyAddin.MyClassname
Call x.Cosh(whatever)
orby using CreateObject
Dim x As Object
Set x=CreateObject("MyAddin.MyClassname")

Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    msvisual.com Forum Index -> VB Enterprise All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group