473,326 Members | 2,114 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Error 2 error C2872: 'IDataObject'

Error 2 error C2872: 'IDataObject' : ambiguous symbol C:\Archivos de
programa\Microsoft Visual Studio 8\VC\PlatformSDK\include\objidl.h 7408

this is the error i got by mix managed and unmanaged code
all i do to get this is this

#include "frmUsrPass.h" //this is managed code, no problem
#include "client.cpp" // this is unmanaged code
#include "\utils\utils.h" // this too
#pragma once

namespace SknrF {
using namespace System;
using namespace System::ComponentModel;
using namespace System::Collections;
using namespace System::Windows::Forms;
using namespace System::Data;
using namespace System::Data::SqlClient;
using namespace System::Drawing;
using namespace System::Net;
using namespace System::Net::NetworkInformation;
.....
}

if i put between /* */ client and utils, i can compile the project, but if
not i got the error, i googled and find just this as possible solution

Move all 'using namespace XXXX' from .h to .cpp
http://www.daniweb.com/techtalkforum...d.php?p=152302

but it doesn't works, and this

Both the .NET Windows Forms and COM define an IDataObject interface that are
distinct. You should fully qualify this interface. If you mean to use the
...NET "version" of the IDataObject interface, use
System::Windows::Forms::IDataObject.

at http://www.dotnet247.com/247referenc...43/218228.aspx

but how can i select just one IDataObject?? what setting is this??
Thanks!!!
Feb 16 '06 #1
1 6004
Rick wrote:
Both the .NET Windows Forms and COM define an IDataObject interface that are
distinct. You should fully qualify this interface. If you mean to use the
..NET "version" of the IDataObject interface, use
System::Windows::Forms::IDataObject.

at http://www.dotnet247.com/247referenc...43/218228.aspx

but how can i select just one IDataObject?? what setting is this??


Try to #include the unmanaged unit before the managed one. Try to put
#include <ObjIdl.h> right after the line #include "stdafx.h". Avoid
importing namespaces into the global namespace from header files.

Your problem can easily be reproduced with these 2 lines:

using namespace System::Windows::Forms;
#include <ObjIdl.h>

The solution, of course, is to either change the order of the two lines,
or to not pollute the global namespace by importing stuff to it.

Tom
Feb 21 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: carlos seramos | last post by:
I've got two IIS servers. One public and one staging. On the public server the ASP code works fine however on the staging server I've started getting this error recently: error '8002801d'...
3
by: Balaji | last post by:
I'm trying to do some basic socket programming. here is the line of code which is creating problem.. int FAR PASCAL __declspec (dllexport)(char * addr,int port) Hers is the error I'm...
0
by: Boulent Mustafa | last post by:
Using Microsoft Access 2000, I am defining a bunch of fields all with default values. The reason for this is that I have 5 text fields, each of which can have 5 permutations depending on the...
3
by: SK | last post by:
Hi all, I am dealing with sockets in my code. I open them like - System.Net.IPAddress remoteIPAddress = System.Net.IPAddress.Parse (szIPSelected); System.Net.IPEndPoint remoteEndPoint = new...
5
by: Brian Conway | last post by:
Can anyone help on this error? I can't find anything on it and not sure what it means Server was unable to process request. --> Requested registry access is not allowed. This error happens...
1
by: eSapient | last post by:
I get the following error when I run the XML Schema Definition Tool on a XML schema: Error: Error generating classes for schema 'codeGeoFeatureType'. - Specified cast is not valid. The XSD...
1
by: manfred | last post by:
Hi Together, I tried to build a webservice proxy using a wsdl, generated in the sun/java world. I used the .Net 2003 Version, choosing there VC++. The steps I did: 1. Visual C++ Projekte /...
1
by: SQACPP | last post by:
I have an error when compiling a simple form project... I just start a new Form project and add a new PictureBox in a form(or anything that generate the .resx file) After that when compiling I...
2
by: Mark05 | last post by:
#include<conio.h> #include<iostream> using namespace std; int main() { double ManfCode,ProdCode; int Checkdigit, SecondManf, FourthManf; int FirstProd,ThirdProd,FifthProd; int...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.