How do you use the VbTopicData?
MaximE 0
Posts
-
What the Heck? -
Nanosecond timer resolution for Windows OSThe best you can get it a 100ns resolution. Search for the "multimedia timer" in MSDN.
-
Memory leakJesus!!! Does this code work???
(_bstr_t)"DATABASE/TABLE[@Left]"
What is this? Never, never do like this. Do:_bstr_t(OLESTR("DATABASE/TABLE[@Left]"))
pIXMLDOMNode->Release(); pIXMLDOMNode=NULL;
It's not bad, but pIXMLDOMNode = 0 is enough.(LPARAM)(char *)(_bstr_t)Tablename
Should be:reinterpret_cast<LPARAM>(static_cast<TCHAR*>(_bstr_t(Tablename)))
Such a bad cast should be explicit.pIXMLDOMNode->get_attributes(&pIXMLDOMNamedNodeMap1);
You are working with very smart pointer. Instead, do like this:pIXMLDOMNamedNodeMap1 = pIXMLDOMNode->attributes;
What is:CHECK_AND_RELEASE(pIXMLDOMDocument2);
May be it a:#define CHECK_AND_RELEASE(x) x->AddRef()
I don't know. Summary. 1. Never, never use c-casts (like (_bstr_t)x, (LPARAM)y, etc). They are the worst evil, unless you damn sure that you do. It's very hard to find a bug in a such code. 2. Read about _com_ptr_t. Learn how it's intended to use. 3. Avoid macros. 4. Optional, but strongly recommended. Get a Stroustrup.