ambiguity between c builder

I am new to BCB 6, and have taken over a program which is producing the following error:

[C++ Error] myprog.cpp(150): E2015 Ambiguity between ‘_fastcall Sysutils::GUIDToString(con st _GUID &)’ and ‘_fastcall Comobj::GUIDToString(const _GUID &)’

The statement in question:

The header file includes are as follows:

#include
#include
#include
#include
#include
#include

#include
#include
#include
#include
#include
#include
#include
#include
#include
#include «synachar.hpp»
#include «PERFGRAP.h»
#include «SHDocVw_OCX.h»
#include


    #include
    #include

#include
#include «voip.h»

#include «msxmldom.hpp»
#include «XMLDoc.hpp»
#include «xmldom.hpp»
#include «XMLIntf.hpp»
#include
#include

#include «unit2.h»
#include «math.h»
#include «winuser.h»
#include «stdio.h»
#include «dir.h»
#include
#include

#include «fstream.h»
#include «lang_tr.dat»
#include «string.h»
#include «HttpThread.h»

Please note that the include for SysUtils.hpp has been commented out.

Any help will be most appreciated — the Borland Help is of no use.

I’ve created a .NET COM DLL that I need to use in my C++ Builder 4 project. I’m able to import the DLL using the Import Type Library functionality (in fact I import the TLB file that comes with the DLL when I build it). This creates a Component_TLB.h in my C++ Builder Imports folder. I then #include this _TLB file in my project and I’m able to do the following:

This works as intended.

The Component_TLB.h created from the «Import Type Library» functionality includes (amongst other things) mscorlib :

. which seems to be a dependable of my DLL, here’s what I’ve found in the comments:

The problem is that because this mscorlib is included in my project I can’t use the «String» type like I used to be. The following line:

..gives me the following error:

It looks like this mscorlib has its own String type or something. I’ve found:

I use the String type A LOT in my project, how can I «force» the compiler to use System::String without having to recode everything line with a String type or how could I work around this ?

В Builder 5.0 все компилируется и работает.
Сейчас хочу проект перевести на 6.0, и компилятор выдает ошибку:
[C++ Error] ComCtrls.hpp(2638): E2015 Ambiguity between ‘Windows’ and ‘Word_2k::Windows’
[C++ Error] ComCtrls.hpp(2839): E2015 Ambiguity between ‘Windows’ and ‘Word_2k::Windows’
[C++ Error] ComCtrls.hpp(4140): E2015 Ambiguity between ‘Windows’ and ‘Word_2k::Windows’
[C++ Error] ComCtrls.hpp(4259): E2015 Ambiguity between ‘Windows’ and ‘Word_2k::Windows’
[C++ Error] ComCtrls.hpp(4429): E2015 Ambiguity between ‘Windows’ and ‘Word_2k::Windows’

Вот на эти строки:
typedef void __fastcall (__closure *TLVDrawItemEvent)(TCustomListView* Sender, TListItem* Item, const Types::TRect &Rect, Windows::TOwnerDrawState State);
virtual void __fastcall DrawItem(TListItem* Item, const Types::TRect &Rect, Windows::TOwnerDrawState State);
virtual bool __fastcall MsgSetRange(int Flags, Windows::PSystemTime SysTime) = 0 ;
virtual bool __fastcall MsgSetRange(int Flags, Windows::PSystemTime SysTime);

Что мне надо сделать чтоб все нормально компилировалось?

Оцените статью