Amessihel
Amessihel

Reputation: 6384

No binary compatibility although a declaration is kept identical

I'm stuck on trying generating a new version of a COM DLL with binary compatibility. I don't understand why I get this message :

'init' in the 'Logger' class module has arguments and/or a return type that is incompatible with a similar declaration in the version-compatible component.

Original definition:
 Function init(aLOGDIR As String, Optional aListBox As Object, Optional aMAXLISTBOXLINES As Integer) As Boolean

Current definition:
 Function init(aLOGDIR As String, Optional aListBox As Object, Optional aMAXLISTBOXLINES As Integer) As Boolean

I haven't change init as you can see...

Here's my steps :

Is this because a parameter is an Object ? Thanks for your help.

Upvotes: 4

Views: 639

Answers (1)

Mike Weir
Mike Weir

Reputation: 3189

In my experience, when trying to get VB6 working with COM or C++, one must pay careful attention to the differences in data-types. I'm guessing this might be your issue. I apologize if you are already familiar with this:

aLOGDIR As String implies a char**; consider changing to ByVal aLOGDIR As String, though I doubt this is relevant to your issue.

Optional aMAXLISTBOXLINES As Integer implies a short and not an int. Certain padding issues could arise, but simply changing it to As Long might be sufficient and fix the issue.

As Boolean implies a short and not a bool on systems. It might be safer to just use As Long.

Upvotes: 1

Related Questions