[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

BeeJ

2/4/2012 9:54:00 PM

I have some sample code for a DLL
It has three classes and one module.
It compiles fine to a .dll.

I open it in the IDE and then open a reference it (vbp) in a new Test
IDE.

I can instantiate it fine.
I can see only some of the Public methods in the dll.
All that I can see I can access.

Why can't I see all Public methods? Those are necessary for useage.
What do I need to do the get access to those Publics I cannot see?

Object browser sees, in Test, only the same I see with intellisense but
not the other public methods.
Object browser in the dll IDE sees all the Public methods.


20 Answers

BeeJ

2/4/2012 10:00:00 PM

0

After serious thinking BeeJ wrote :
> I have some sample code for a DLL
> It has three classes and one module.
> It compiles fine to a .dll.
>
> I open it in the IDE and then open a reference it (vbp) in a new Test IDE.
>
> I can instantiate it fine.
> I can see only some of the Public methods in the dll.
> All that I can see I can access.
>
> Why can't I see all Public methods? Those are necessary for useage.
> What do I need to do the get access to those Publics I cannot see?
>
> Object browser sees, in Test, only the same I see with intellisense but not
> the other public methods.
> Object browser in the dll IDE sees all the Public methods.

Further ... although I cannot see the public methods, they can be
accessed simply by coding them as if I could see them. But I want to
see them and have intellisense to assist me.

I there some hidden property in the class that makes the entry point
invisible?


ralph

2/4/2012 10:35:00 PM

0

On Sat, 04 Feb 2012 13:53:33 -0800, BeeJ <nospam@spamnot.com> wrote:

>I have some sample code for a DLL
>It has three classes and one module.
>It compiles fine to a .dll.
>
>I open it in the IDE and then open a reference it (vbp) in a new Test
>IDE.
>
>I can instantiate it fine.
>I can see only some of the Public methods in the dll.
>All that I can see I can access.
>
>Why can't I see all Public methods? Those are necessary for useage.
>What do I need to do the get access to those Publics I cannot see?
>
>Object browser sees, in Test, only the same I see with intellisense but
>not the other public methods.
>Object browser in the dll IDE sees all the Public methods.
>

Check out Instancing properties.

Make sure when developing a Dll you are using Binary compatibility.
And you clean your project/s periodically.

Here is a simple summary:
http://vb-helper.com/howto_active...

Mayayana

2/4/2012 11:30:00 PM

0

You didn't mention whether methods are in
more than one class. If you want access to
public methods in a class then you want type
5 instancing. Or, you can use type 2 instancing
and pass the class via a function. If the class
is private then its public methods are only
available within the project.

Accessing a public object:
Set IE = New InternetExplorer.Application

Accessing a public not creatable object:
Set Doc = IE.Document

You can have as many public classes as you like,
but they're all separate objects.

"BeeJ" <nospam@spamnot.com> wrote in message
news:jgk9cq$uss$1@speranza.aioe.org...
|I have some sample code for a DLL
| It has three classes and one module.
| It compiles fine to a .dll.
|
| I open it in the IDE and then open a reference it (vbp) in a new Test
| IDE.
|
| I can instantiate it fine.
| I can see only some of the Public methods in the dll.
| All that I can see I can access.
|
| Why can't I see all Public methods? Those are necessary for useage.
| What do I need to do the get access to those Publics I cannot see?
|
| Object browser sees, in Test, only the same I see with intellisense but
| not the other public methods.
| Object browser in the dll IDE sees all the Public methods.
|
|


BeeJ

2/5/2012 12:37:00 AM

0

Mayayana laid this down on his screen :
> You didn't mention whether methods are in
> more than one class. If you want access to
> public methods in a class then you want type
> 5 instancing. Or, you can use type 2 instancing
> and pass the class via a function. If the class
> is private then its public methods are only
> available within the project.
>
> Accessing a public object:
> Set IE = New InternetExplorer.Application
>
> Accessing a public not creatable object:
> Set Doc = IE.Document
>
> You can have as many public classes as you like,
> but they're all separate objects.
>
> "BeeJ" <nospam@spamnot.com> wrote in message
> news:jgk9cq$uss$1@speranza.aioe.org...
>> I have some sample code for a DLL
>> It has three classes and one module.
>> It compiles fine to a .dll.
>>
>> I open it in the IDE and then open a reference it (vbp) in a new Test
>> IDE.
>>
>> I can instantiate it fine.
>> I can see only some of the Public methods in the dll.
>> All that I can see I can access.
>>
>> Why can't I see all Public methods? Those are necessary for useage.
>> What do I need to do the get access to those Publics I cannot see?
>>
>> Object browser sees, in Test, only the same I see with intellisense but
>> not the other public methods.
>> Object browser in the dll IDE sees all the Public methods.
>>
>>

Sorry. Two of the classes are public and both are Instancing 5 -
multiUse. The other class is private.

For One Using Set cX = new CXX ' CXX is the resource name of the
dll.

I see only some of the Public methods in both Instancing 5 classes.
I also see a Public variable in the .bas module.

I added a Public Function to one of the MultiUse classes and that shows
with intellisense.

Also, all the same is true whether running the dll from the IDE or
using the compile dll.

I looked at the pure text file for the classes and see nothing that I
recognize as different that might hide a method.


BeeJ

2/5/2012 12:40:00 AM

0

ralph wrote :
> On Sat, 04 Feb 2012 13:53:33 -0800, BeeJ <nospam@spamnot.com> wrote:
>
>> I have some sample code for a DLL
>> It has three classes and one module.
>> It compiles fine to a .dll.
>>
>> I open it in the IDE and then open a reference it (vbp) in a new Test
>> IDE.
>>
>> I can instantiate it fine.
>> I can see only some of the Public methods in the dll.
>> All that I can see I can access.
>>
>> Why can't I see all Public methods? Those are necessary for useage.
>> What do I need to do the get access to those Publics I cannot see?
>>
>> Object browser sees, in Test, only the same I see with intellisense but
>> not the other public methods.
>> Object browser in the dll IDE sees all the Public methods.
>>
>
> Check out Instancing properties.
>
> Make sure when developing a Dll you are using Binary compatibility.
> And you clean your project/s periodically.
>
> Here is a simple summary:
> http://vb-helper.com/howto_active...

Am I wrong that Binary Compatibility matters on subsequent changes to
the dll?

Anyway, on first compile all the problems existed.
I did fiddle with compatibility and had to delete the dll to re-do the
compile when I added a new Function to the multiuse class.

And does compatibility matter when I am running the dll in the IDE and
access that from another IDE test app? Don't think so but what do
know.

What can I use external to VB IDE to examine the interface best?


BeeJ

2/5/2012 12:42:00 AM

0

ralph presented the following explanation :
> On Sat, 04 Feb 2012 13:53:33 -0800, BeeJ <nospam@spamnot.com> wrote:
>
>> I have some sample code for a DLL
>> It has three classes and one module.
>> It compiles fine to a .dll.
>>
>> I open it in the IDE and then open a reference it (vbp) in a new Test
>> IDE.
>>
>> I can instantiate it fine.
>> I can see only some of the Public methods in the dll.
>> All that I can see I can access.
>>
>> Why can't I see all Public methods? Those are necessary for useage.
>> What do I need to do the get access to those Publics I cannot see?
>>
>> Object browser sees, in Test, only the same I see with intellisense but
>> not the other public methods.
>> Object browser in the dll IDE sees all the Public methods.
>>
>
> Check out Instancing properties.
>
> Make sure when developing a Dll you are using Binary compatibility.
> And you clean your project/s periodically.
>
> Here is a simple summary:
> http://vb-helper.com/howto_active...

And one more thing.
Even though intellisense did not expose a method (e.g. "Add") I could
type it in to the test app and get it to step from the test IDE to the
dll IDE without any problem.


ralph

2/5/2012 3:33:00 AM

0

On Sat, 04 Feb 2012 16:40:22 -0800, BeeJ <nospam@spamnot.com> wrote:

>ralph wrote :
>> On Sat, 04 Feb 2012 13:53:33 -0800, BeeJ <nospam@spamnot.com> wrote:
>>
>>> I have some sample code for a DLL
>>> It has three classes and one module.
>>> It compiles fine to a .dll.
>>>
>>> I open it in the IDE and then open a reference it (vbp) in a new Test
>>> IDE.
>>>
>>> I can instantiate it fine.
>>> I can see only some of the Public methods in the dll.
>>> All that I can see I can access.
>>>
>>> Why can't I see all Public methods? Those are necessary for useage.
>>> What do I need to do the get access to those Publics I cannot see?
>>>
>>> Object browser sees, in Test, only the same I see with intellisense but
>>> not the other public methods.
>>> Object browser in the dll IDE sees all the Public methods.
>>>
>>
>> Check out Instancing properties.
>>
>> Make sure when developing a Dll you are using Binary compatibility.
>> And you clean your project/s periodically.
>>
>> Here is a simple summary:
>> http://vb-helper.com/howto_active...
>
>Am I wrong that Binary Compatibility matters on subsequent changes to
>the dll?
>
>Anyway, on first compile all the problems existed.
>I did fiddle with compatibility and had to delete the dll to re-do the
>compile when I added a new Function to the multiuse class.
>
>And does compatibility matter when I am running the dll in the IDE and
>access that from another IDE test app? Don't think so but what do
>know.
>
>What can I use external to VB IDE to examine the interface best?
>

Binary Compatibility is perhaps too severe while developing. Project
Compatibility will do.

The point was you mention you were missing Public elements you thought
should be there. The most common reason for this is having an older
cached version of the typelib. Project or Binary compatibility is
simply a way of reducing confusion.

But latter posts appear to remove this as the problem.

As for a viewer, the built-in object viewer is as good a tool as any.
Consider that ultimately it is what VB "sees" that is the issue that
needs to be resolved, and it essentially uses the same process of
discovery that any other "viewer" would use.

-ralph

ralph

2/5/2012 4:29:00 AM

0

On Sat, 04 Feb 2012 16:42:24 -0800, BeeJ <nospam@spamnot.com> wrote:

>ralph presented the following explanation :
>> On Sat, 04 Feb 2012 13:53:33 -0800, BeeJ <nospam@spamnot.com> wrote:
>>
>>> I have some sample code for a DLL
>>> It has three classes and one module.
>>> It compiles fine to a .dll.
>>>
>>> I open it in the IDE and then open a reference it (vbp) in a new Test
>>> IDE.
>>>
>>> I can instantiate it fine.
>>> I can see only some of the Public methods in the dll.
>>> All that I can see I can access.
>>>
>>> Why can't I see all Public methods? Those are necessary for useage.
>>> What do I need to do the get access to those Publics I cannot see?
>>>
>>> Object browser sees, in Test, only the same I see with intellisense but
>>> not the other public methods.
>>> Object browser in the dll IDE sees all the Public methods.
>>>
>>
>> Check out Instancing properties.
>>
>> Make sure when developing a Dll you are using Binary compatibility.
>> And you clean your project/s periodically.
>>
>> Here is a simple summary:
>> http://vb-helper.com/howto_active...
>
>And one more thing.
>Even though intellisense did not expose a method (e.g. "Add") I could
>type it in to the test app and get it to step from the test IDE to the
>dll IDE without any problem.
>

Sounds bizzare.

Clean up both projects.

Open the DLL project.
Set Project Compatibility
Set the Instancing for each of the public classes.
Open Project Properties.
Under the Debug tab set the debug to start on launch.
Compile
Leave the project open.

Open the Test project (you now have two VBIDEs running)
In Project References set a Reference to the DLL.
ie, the library as Registered. Not the project.
In the test app reference the objects (classes) ...

Dim objA As <library/project>.<class>
Set objA = New <library/project>.<class>

Compile and Run

-ralph

BeeJ

2/5/2012 6:08:00 PM

0

BeeJ presented the following explanation :
> I have some sample code for a DLL
> It has three classes and one module.
> It compiles fine to a .dll.
>
> I open it in the IDE and then open a reference it (vbp) in a new Test IDE.
>
> I can instantiate it fine.
> I can see only some of the Public methods in the dll.
> All that I can see I can access.
>
> Why can't I see all Public methods? Those are necessary for useage.
> What do I need to do the get access to those Publics I cannot see?
>
> Object browser sees, in Test, only the same I see with intellisense but not
> the other public methods.
> Object browser in the dll IDE sees all the Public methods.

I tried more stuff.

I changed the name of the entry point from "Add" to "Addd" but still
this does not appear. The new one "Version" I added still shows.

When I type the class instance I see many of the dll class entriy point
and the module Publics but not all. If I type cXX.Addd if do get the
intellisense for the parameters needed. Sort of prtially works OK but
if I cannot see the Addd when typing cXX it maks it very difficult.

I have moved all the code to a different PC with VB6SP6 and the
problems persist.


ralph

2/5/2012 6:37:00 PM

0

On Sun, 05 Feb 2012 10:08:08 -0800, BeeJ <nospam@spamnot.com> wrote:

>BeeJ presented the following explanation :
>> I have some sample code for a DLL
>> It has three classes and one module.
>> It compiles fine to a .dll.
>>
>> I open it in the IDE and then open a reference it (vbp) in a new Test IDE.
>>
>> I can instantiate it fine.
>> I can see only some of the Public methods in the dll.
>> All that I can see I can access.
>>
>> Why can't I see all Public methods? Those are necessary for useage.
>> What do I need to do the get access to those Publics I cannot see?
>>
>> Object browser sees, in Test, only the same I see with intellisense but not
>> the other public methods.
>> Object browser in the dll IDE sees all the Public methods.
>
>I tried more stuff.
>
>I changed the name of the entry point from "Add" to "Addd" but still
>this does not appear. The new one "Version" I added still shows.
>
>When I type the class instance I see many of the dll class entriy point
>and the module Publics but not all. If I type cXX.Addd if do get the
>intellisense for the parameters needed. Sort of prtially works OK but
>if I cannot see the Addd when typing cXX it maks it very difficult.
>
>I have moved all the code to a different PC with VB6SP6 and the
>problems persist.
>

Whoa!

Need to explain further, as that doesn't quite make sense to me.

For an object (class) in a Dll (library), say

File: MyDll.dll
ActiveX Library: MyDll
ActiveX object: CJunk ' with Add method

In Project References you would set a reference to the Library MyDll.
In code you would do something like this..
Dim cXX As MyDll.CJunk
Set cXX = New MyDll.CJunk
' intellisense will now work for cXX
cXX.Add <stuff>

So are you saying if you do that, intellisense will not work?

-ralph