[prev in list] [next in list] [prev in thread] [next in thread] 

List:       ms-atl
Subject:    IDL, VB and structs
From:       Rob Winchell <rbw () AVS ! COM>
Date:       1997-07-31 15:41:09
[Download RAW message or body]


All -

We are having a difficult problem.

We have the following (sort of) file named Interfaces.idl :
---------------------------------------------------------------
typedef struct tagOUR_COLOR
{
        int color;
} OUR COLOR;

interface ILine : IUnknown
{
        method SetColor([in]OUR_COLOR color);
}

interface ISurface : IUnknown
{
        method SetColor([in]OUR_COLOR color);
}
-------------------------------------------------------------

We have 2 COM objects, in different DLLs built with ATL, which both
"import" the Interfaces.idl in their .IDL files. Each one also has methods
which use the OUR_COLOR struct, so the struct definition ends up in both
TLB files.

Now, in VB5, we have a program which loads both of these objects at the
same time. It seems like VB thinks the OUR_COLOR from one DLL is different
from the OUR_COLOR in the other DLL.

For instance, if we try and declare a tagOUR_COLOR and pass it to a
ILine->SetColor() we end up with a "Compile error: ByRef argument tyoe m
ismatch", when that is obviously the correct type.

If anyone has ever encountered this, or knows of a solution or fix, I'd
appreciate it.

Rob Winchell

----------------------------------------------------------------
Users Guide http://www.microsoft.com/sitebuilder/resource/mailfaq.asp
contains important info including how to unsubscribe.  Save time, search
the archives at http://microsoft.ease.lsoft.com/archives/index.html

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic