Discussion:
atlstr.h
(too old to reply)
Steve W TSI
2003-11-11 17:11:11 UTC
Permalink
I've included atlstr.h to use the CString class to convert from System strings to non-managed strings

Now I'm getting the following compiler errors and warnings

C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\ObjIdl.h(246) : warning C4935: assembly access specifier modified from 'public
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\ObjIdl.h(258) : warning C4935: assembly access specifier modified from 'public
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\ObjIdl.h(7408) : error C2872: 'IDataObject' : ambiguous symbo
could be 'C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\ObjIdl.h(246) : System::Windows::Forms::IDataObject IDataObject
or 'stdafx.cpp(0) : System::Windows::Forms::IDataObject

Any ideas

Steve W.
Igor Tandetnik
2003-11-11 17:21:09 UTC
Permalink
Are you aware that you are compiling to Managed code (with /clr option)?
Is it your intention?
--
With best wishes,
Igor Tandetnik

"For every complex problem, there is a solution that is simple, neat,
and wrong." H.L. Mencken
Post by Steve W TSI
I've included atlstr.h to use the CString class to convert from System
strings to non-managed strings.
Post by Steve W TSI
C:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\PlatformSDK\Include\ObjIdl.h(246) : warning C4935: assembly
access specifier modified from 'public'
Post by Steve W TSI
C:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\PlatformSDK\Include\ObjIdl.h(258) : warning C4935: assembly
access specifier modified from 'public'
Post by Steve W TSI
C:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\PlatformSDK\Include\ObjIdl.h(7408) : error C2872: 'IDataObject'
: ambiguous symbol
Post by Steve W TSI
could be 'C:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\PlatformSDK\Include\ObjIdl.h(246) :
System::Windows::Forms::IDataObject IDataObject'
Post by Steve W TSI
or 'stdafx.cpp(0) : System::Windows::Forms::IDataObject'
Any ideas?
Steve W.
Steve W TSI
2003-11-12 15:26:19 UTC
Permalink
Yes, we are using C++ with the managed code extensions.

I have a previous project (same settings, C++ and .Net) where I included atlstr.h to convert System::Strings to Cstrings to LPCSTR's and it worked fine.

Note: the error messages, there seem to be two definitions of IDataObject.


----- Igor Tandetnik wrote: -----

Are you aware that you are compiling to Managed code (with /clr option)?
Is it your intention?
--
With best wishes,
Igor Tandetnik

"For every complex problem, there is a solution that is simple, neat,
and wrong." H.L. Mencken
Post by Steve W TSI
I've included atlstr.h to use the CString class to convert from System
strings to non-managed strings.
Post by Steve W TSI
Post by Steve W TSI
C:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\PlatformSDK\Include\ObjIdl.h(246) : warning C4935: assembly
access specifier modified from 'public'
Post by Steve W TSI
C:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\PlatformSDK\Include\ObjIdl.h(258) : warning C4935: assembly
access specifier modified from 'public'
Post by Steve W TSI
C:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\PlatformSDK\Include\ObjIdl.h(7408) : error C2872: 'IDataObject'
: ambiguous symbol
Post by Steve W TSI
could be 'C:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\PlatformSDK\Include\ObjIdl.h(246) :
System::Windows::Forms::IDataObject IDataObject'
Post by Steve W TSI
or 'stdafx.cpp(0) : System::Windows::Forms::IDataObject'
Post by Steve W TSI
Any ideas?
Steve W.
Igor Tandetnik
2003-11-12 16:28:51 UTC
Permalink
There seems to be a name conflict between IDataObject COM interface
defined in OLE headers, and IDataObject that is a .NET interface. I
don't program for .NET myself, I have no idea how to work around it.
--
With best wishes,
Igor Tandetnik

"For every complex problem, there is a solution that is simple, neat,
and wrong." H.L. Mencken
Post by Steve W TSI
Yes, we are using C++ with the managed code extensions.
I have a previous project (same settings, C++ and .Net) where I
included atlstr.h to convert System::Strings to Cstrings to LPCSTR's and
it worked fine.
Post by Steve W TSI
Note: the error messages, there seem to be two definitions of
IDataObject.
Post by Steve W TSI
----- Igor Tandetnik wrote: -----
Are you aware that you are compiling to Managed code (with /clr option)?
Is it your intention?
Post by Steve W TSI
I've included atlstr.h to use the CString class to convert from System
strings to non-managed strings.
Post by Steve W TSI
Post by Steve W TSI
C:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\PlatformSDK\Include\ObjIdl.h(246) : warning C4935: assembly
access specifier modified from 'public'
Post by Steve W TSI
C:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\PlatformSDK\Include\ObjIdl.h(258) : warning C4935: assembly
access specifier modified from 'public'
Post by Steve W TSI
C:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\PlatformSDK\Include\ObjIdl.h(7408) : error C2872: 'IDataObject'
: ambiguous symbol
Post by Steve W TSI
could be 'C:\Program Files\Microsoft Visual Studio .NET
System::Windows::Forms::IDataObject IDataObject'
System::Windows::Forms::IDataObject'
Post by Steve W TSI
Post by Steve W TSI
Post by Steve W TSI
Any ideas?
Steve W.
Steve W TSI
2003-11-12 17:06:11 UTC
Permalink
Post by Steve W TSI
I don't program for .NET myself, I have no idea how to work around it
You probably shouldn't responsd to queries unless you know the answer or can help with the issue


----- Igor Tandetnik wrote: ----

There seems to be a name conflict between IDataObject COM interfac
defined in OLE headers, and IDataObject that is a .NET interface.
don't program for .NET myself, I have no idea how to work around it
--
With best wishes
Igor Tandetni

"For every complex problem, there is a solution that is simple, neat
and wrong." H.L. Mencke
Post by Steve W TSI
Yes, we are using C++ with the managed code extensions
I have a previous project (same settings, C++ and .Net) where
included atlstr.h to convert System::Strings to Cstrings to LPCSTR's an
it worked fine
Post by Steve W TSI
Note: the error messages, there seem to be two definitions o
IDataObject
Post by Steve W TSI
Post by Steve W TSI
----- Igor Tandetnik wrote: ----
Are you aware that you are compiling to Managed code (with /cl
option)
Post by Steve W TSI
Is it your intention
I've included atlstr.h to use the CString class to convert fro
Syste
Post by Steve W TSI
strings to non-managed strings
Post by Steve W TSI
Now I'm getting the following compiler errors and warnings
C:\Program Files\Microsoft Visual Studio .NE
2003\Vc7\PlatformSDK\Include\ObjIdl.h(246) : warning C4935
assembl
Post by Steve W TSI
access specifier modified from 'public
C:\Program Files\Microsoft Visual Studio .NE
2003\Vc7\PlatformSDK\Include\ObjIdl.h(258) : warning C4935
assembl
Post by Steve W TSI
access specifier modified from 'public
C:\Program Files\Microsoft Visual Studio .NE
2003\Vc7\PlatformSDK\Include\ObjIdl.h(7408) : error C2872
'IDataObject
Post by Steve W TSI
: ambiguous symbo
could be 'C:\Program Files\Microsoft Visual Studio .NE
2003\Vc7\PlatformSDK\Include\ObjIdl.h(246)
System::Windows::Forms::IDataObject IDataObject
or 'stdafx.cpp(0)
System::Windows::Forms::IDataObject
Post by Steve W TSI
Post by Steve W TSI
Any ideas
Steve W
Brian Muth
2003-11-12 17:26:55 UTC
Permalink
Post by Steve W TSI
You probably shouldn't responsd to queries unless you know the answer or
can help with the issue.
Take a hike, Steve.

Igor is probably the most valued resource in this newsgroup. You don't have
to read many posts to appreciate his contributions.

Rudeness isn't going to get you very far.

Brian Muth MVP
Steve W TSI
2003-11-12 18:01:22 UTC
Permalink
Brian,
Post by Brian Muth
Rudeness isn't going to get you very far.
I wasn't intending to be rude, and I apologize if someone misconstrued my comment.
Post by Brian Muth
Take a hike, Steve.
Ok if I pull a golf bag while I hike?

To keep the focus on an issue I'm having with atlstr.h....

I've included atlstr.h to use the CString class to convert from System strings to non-managed strings.

Now I'm getting the following compiler errors and warnings:

C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\ObjIdl.h(246) : warning C4935: assembly access specifier modified from 'public'
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\ObjIdl.h(258) : warning C4935: assembly access specifier modified from 'public'
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\ObjIdl.h(7408) : error C2872: 'IDataObject' : ambiguous symbol
could be 'C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\ObjIdl.h(246) : System::Windows::Forms::IDataObject IDataObject'
or 'stdafx.cpp(0) : System::Windows::Forms::IDataObject'

I've done this in another project with no trouble.

Any ideas?
Thanks,
Steve Wellens




----- Brian Muth wrote: -----
Post by Brian Muth
You probably shouldn't responsd to queries unless you know the answer or
can help with the issue.
Take a hike, Steve.

Igor is probably the most valued resource in this newsgroup. You don't have
to read many posts to appreciate his contributions.

Rudeness isn't going to get you very far.

Brian Muth MVP
Kim Gräsman
2003-11-12 19:35:42 UTC
Permalink
Hi Steve,
Post by Steve W TSI
I've included atlstr.h to use the CString class to convert from
System strings to non-managed strings.
ATL pretty thoroughly puts all its classes into namespace ATL.
IDataObject is not part of ATL, though...

Maybe you could do something like:

namespace Unmanaged
{
#include <objidl.h>
};

to force it into a separate namespace, since you won't be using it anyway.
Or will you?

Kim
Steve W TSI
2003-11-13 15:51:24 UTC
Permalink
Kim,

Thanks, I tried a few variations of your idea, but I'm not including objidl.h directly...it caused boat loads of errors.

By the way, including atlstr.h to get a CString to use in converting System::Strings to character pointers is from Microsoft Knowledgebase Article: 311259

I used it in another application and it worked as advertised.

Still puzzled,

Steve

----- Kim Gräsman wrote: -----

Hi Steve,
Post by Steve W TSI
I've included atlstr.h to use the CString class to convert from
System strings to non-managed strings.
ATL pretty thoroughly puts all its classes into namespace ATL.
IDataObject is not part of ATL, though...

Maybe you could do something like:

namespace Unmanaged
{
#include <objidl.h>
};

to force it into a separate namespace, since you won't be using it anyway.
Or will you?

Kim

Loading...