Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ActiveX dll, class modules and modules....HELP 2

Status
Not open for further replies.

x508

Programmer
Jun 26, 2003
396
ZA
Hi

I created an ActiveX DLL and wondered about the following:

Can you not create "functional subs" in the dll's class module. I battled cause I did all my functions in the class module, but I was not able to reference (use) them in any other part of my dll. i.e ClsMOD1."Whateverfunction" is not available.

I then put all my functions in a normal module, and I could use them.....but then, when using the dll....my functions in my module would not be available.

I then creted a "wrapper", i think, in the class module that calls the appropriate function in the normal module and it worked fine...

Do I have to create "wrappers" for all the functions that I want to use..is there an easier way??


**********************************
May the Code Be With You...
----------
x50-8 (X Fifty Eigt)
 
x508,

Put your functions into one specific class, and then set that class's instancing proprty to 6 (GlobalMultiUse).

Any functions declared public within that class with then behave as global functions both within your dll and the projects to which it is applied.

mmilan
 
uhmmm.. I tried that it still didn't work!!!! I really don't know whats going on!!!

**********************************
May the Code Be With You...
----------
x50-8 (X Fifty Eigt)
 
Ok.

How about placing the guts of your code in .bas files in the DLL project, and then including calls to these functions from within the global class?

This way, the outside project would call the class functions, which in turn would call upon the module ones. If you needed the stuff within your DLL, you could simply call on the module functions directly...

Just an idea...

mmilan

 
Yip, thats what I'm currently doing....althoug...this brings us to my question...

Will I have to create a Pointer in the class module for all the functions in my normal module???

Thanks anyway

**********************************
May the Code Be With You...
----------
x50-8 (X Fifty Eigt)
 
Public subs and functions in the bas module are visible to all modules in the dll project but not to dll clients.

Procedures in class modules can be public, private or friend.

Private procedures are only visible within their own class module and not to external clients.

Public procedures are visible within their own class modules, to other class modules in the project and external clients. In the case of the last two, the client has to first create an instance of the class if instancing is Multiuse (5).

Friend procedures are visible within their own class modules and to other class modules in the project but not to external clients. Again, if instancing is Multiuse the calling procedure must create an instance of the class before calling the Friend procedure.

Paul Bent
Northwind IT Systems
 
Not so much of a pointer - more of a wrapper.

I don't think any of that SHOULD be necessary though - I would have expected my original suggestion to work without any problems.

mmilan.

 
Thanks guys...I was stoopid...

I did not dim and set a variable to the class object...doh

I'm a bit new with working with classes, but I now remember that you have to create an object from a class

So i did this in other areas/forms of my dll

dim x as class1
set x = new class1

x."WhatEverFunction" worked fine

thanks fo yar help

*****************************************
May the Code Be With You...[lightsaber]
----------
x50-8 (X Fifty Eigt)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top