Click here to Skip to main content
16,011,611 members
Home / Discussions / ATL / WTL / STL
   

ATL / WTL / STL

 
GeneralC++ ATL Server project Pin
devvvy5-Aug-03 23:43
devvvy5-Aug-03 23:43 
GeneralRe: C++ ATL Server project Pin
Steve S6-Aug-03 5:43
Steve S6-Aug-03 5:43 
GeneralRe: C++ ATL Server project Pin
Nemanja Trifunovic6-Aug-03 6:13
Nemanja Trifunovic6-Aug-03 6:13 
GeneralRe: C++ ATL Server project Pin
devvvy6-Aug-03 14:56
devvvy6-Aug-03 14:56 
GeneralRe: C++ ATL Server project Pin
nativespirits30-Dec-03 10:04
nativespirits30-Dec-03 10:04 
GeneralSTL, "upgrade" from sprintf to ostream in a logclass Pin
justin2235-Aug-03 21:01
justin2235-Aug-03 21:01 
GeneralRe: STL, "upgrade" from sprintf to ostream in a logclass Pin
Anonymous5-Aug-03 21:25
Anonymous5-Aug-03 21:25 
GeneralRe: STL, "upgrade" from sprintf to ostream in a logclass Pin
justin2235-Aug-03 21:32
justin2235-Aug-03 21:32 
Yep. I've started to do so.


class CDtLog 
{

private: 
	std::ostringstream	m_os;
	bool		bNewEntry;
	int		m_nPrio;
	char*		m_szGroup[40];

public:
	CDtLog()
	{
		bNewEntry = true;
		m_nPrio = 2;
		m_szGroup[0] = NULL;
	}

	template<class T>
		CDtLog &operator<<(const T &item)
		{
			if (bNewEntry)
			{
				m_os << "<entry prio=\"" << m_nPrio << "\" ";
				if (m_szGroup[0]) m_os << "group=\"" << m_szGroup << "\" ";
				m_os << ">";
				bNewEntry = false; 
			}
			m_os << item ;
			return *this;
		};

		void print()
		{
			printf(m_os.str().c_str());
		}
};


int _tmain(int argc, _TCHAR* argv[])
{
	CDtLog test;
	int i = 10;
	test << "hejsan" << std::setfill(' ') << std::setw(10) << 12 << i;
	test.print();


	return 0;
}
I need a modifier that tells me that a debugentry is done, similiar to endl, but instead of just flushing, it ends the xml tag and then flush it to the file.

I also need to check every entered character to see if it's a < or >, if so I need to translate it to > or <, or it will ****up the xml.

I also want modifiers that I can use to change the prio and group.
GeneralATL and ADO Problem Pin
Popeye Doyle Murray5-Aug-03 2:39
Popeye Doyle Murray5-Aug-03 2:39 
GeneralRe: ATL and ADO Problem Pin
Steve S5-Aug-03 23:17
Steve S5-Aug-03 23:17 
GeneralRe: ATL and ADO Problem Pin
Popeye Doyle Murray6-Aug-03 2:27
Popeye Doyle Murray6-Aug-03 2:27 
GeneralRe: ATL and ADO Problem Pin
Steve S6-Aug-03 5:39
Steve S6-Aug-03 5:39 
GeneralWindows Installer MSI file problem Pin
darseh5-Aug-03 0:03
darseh5-Aug-03 0:03 
GeneralIPropertySheet Pin
Subbu Viji4-Aug-03 5:18
Subbu Viji4-Aug-03 5:18 
GeneralATL ActiveX composite control Pin
Subbu Viji4-Aug-03 5:15
Subbu Viji4-Aug-03 5:15 
GeneralI need a good ATL book; Common Controls and Active X Pin
Stormwind3-Aug-03 21:44
Stormwind3-Aug-03 21:44 
GeneralRe: I need a good ATL book; Common Controls and Active X Pin
valikac4-Aug-03 9:30
valikac4-Aug-03 9:30 
GeneralRe: I need a good ATL book; Common Controls and Active X Pin
Stormwind4-Aug-03 15:43
Stormwind4-Aug-03 15:43 
GeneralConverting ATL example from vs7 to vc++6 Pin
paully3-Aug-03 5:26
paully3-Aug-03 5:26 
GeneralATL Registration in win98 Pin
zxb888888881-Aug-03 23:53
zxb888888881-Aug-03 23:53 
GeneralRe: ATL Registration in win98 Pin
Andrew Walker2-Aug-03 12:12
Andrew Walker2-Aug-03 12:12 
GeneralRe: ATL Registration in win98 Pin
zxb888888882-Aug-03 14:28
zxb888888882-Aug-03 14:28 
GeneralATL - invoke an event in a diffrent thread Pin
Arik Poznanski1-Aug-03 6:08
Arik Poznanski1-Aug-03 6:08 
GeneralRe: ATL - invoke an event in a diffrent thread Pin
geo_m12-Aug-03 3:15
geo_m12-Aug-03 3:15 
GeneralRe: ATL - invoke an event in a diffrent thread Pin
Arik Poznanski12-Aug-03 9:10
Arik Poznanski12-Aug-03 9:10 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.