'operator <<' is ambiguous - case to CArchive&

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Yasoo (anonymous_at_discussions.microsoft.com)
Date: 05/18/04


Date: Mon, 17 May 2004 21:16:02 -0700

I'm getting the following error: 'operator <<' is ambiguous

Here's what I'm trying to do:

// pCarchive is a pointer to a CArchive object

CArchive& aref=*pCArchive;

aref << "Hello";

The reference seems to be created properly as it doesn't produce and error, but I get the error in the aref << "Hello" line.

Why do I get this error and how do I fix it?

Thank you.