log.h

namespace stuff {

class log {
..........
friend std::wostream& operator<<( std::wostream& oss, const log& error );
};

}

log.cpp

std::wostream& stuff::operator<<( std::wostream& oss, const stuff::log& error )
{
	oss << log.m_message; // log.m_message is a std::wstring
	return oss;
}

1>c:\users\oso\documents\visual studio 2010\projects\moduleinjector\moduleinjector\cdllinjection.cpp(147): error C2679: binary '<<' : no operator found which takes a right-hand operand of type 'const std::wstring' (or there is no acceptable conversion)


Any idea what im doing wrong?

I'm not sure, but this looks like what you want to do.

come on man, just read what computer trying to tell you.
You should have the patient to listen to her.Patient makes
you a good programmer.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.