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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Question about What happens during Making a DLL

Status
Not open for further replies.

markphsd

Programmer
Jun 24, 2002
758
US
I have a related post on here, about binary compatability. My DLL compiles fine, however when using Binary Compatability, i have been getting a couple of messages, and it seems they are consisistent.

THe messages say i'm using an Obj type rather than the explict type. There are two object types this happens to, where it says: "As Object" rather than, "as ctlist" (an active x control) and "as form" a vb form and a Microsoft Access Form.

I'm early binding these controls, this is in VB 6.

Original definition:
Public mlst As Object

Current definition:
Public mlst As ctList

Original definition:
Property Set mConfigForm(ByVal RHS As Object)

Current definition:
Public mConfigForm As Form

Mark P.
Providing Low Cost Powerful Point of Sale Solutions.
 
Just because you've selected Binaryu Compatibility doesn't mean that you get binary compatibility (it just means that VB does a certain amount of behind the scenes work for you regarding CLSIDs and IIDs), but there are requirements of you as the programmer, which look something like this:

The following rules ensure binary compatibility is maintained:
The name of the project cannot change.
The names of any public classes cannot change.
The names of any public methods or properties cannot change.
The number of parameters to any public method cannot change.
The data types of the parameters cannot change.
The calling convention (ByRef, ByVal) of the parameters cannot change.
The names of public enums cannot change.
The order/values of elements in public enums cannot change.
The names of public user-defined types cannot change.
The names and data types of elements in public user-defined types cannot change.
If a public class implements user-defined interfaces then the 'Implements' statement cannot change.

You've changed the types of your parameters, and thus broken one of the rules. Hence your project is no longer binary compatible. And hence your errors.
 
Excellent post strongm.

>> The number of parameters to any public method cannot change.

I always thought you could add optional parameters without breaking compatibility. Am I mistaken?

-George

Strong and bitter words indicate a weak cause. - Fortune cookie wisdom
 
I didn't make myself clear.

I haven't changed anything at all. What I did was create the DLL in a folder i named c:\vbbinaryreference\mydll.dll, then referenced that dll as the dll to be compatable to. Then i remade the dll in another location, and got the above stated message.

Mark P.
Providing Low Cost Powerful Point of Sale Solutions.
 
Well, you still haven't made yourself clear...in fact, I'm too confused to comment further.
 
I found the problem was this:

I was getting compatability errors when i used a public active x control in a class:

Public mlst As ctList

so i changed it to:
Public mlst As Object

No more compatability problems.


Mark P.
Providing Low Cost Powerful Point of Sale Solutions.
 
Ok. Well, that's because your original would have made mlist an Object rather than a ctList. If you'd like to keep the early binding, you can do this:

1. Unregister your DLL.
2. Remove any copies of your DLL from the disk.
3. Change "binary compatibility" to one of the other settings.
4. Recompile your program.
5. Set binary compatibility again.
6. Recompile again.

HTH

Bob
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top