On Jul 11, 11:07 am, Hooyoo <zhao_huy...@126.com> wrote:
On Jul 11, 12:28 pm, "Samant.Tru...@gmail.com"
<Samant.Tru...@gmail.com> wrote:
Hi all,
I have some code that I am unable to understand. Can you please
help?
int _tmain(int argc, _TCHAR* argv[])
{
// Initialize COM environment.
ccLib::CCoInitialize CoInitialize(ccLib::CCoInitialize::eMTAModel);
...}
1. CCoInitialize is a class
to invoke a object of class you write
CCoInitialize cc;
2. CoInitialize is static function.
to invoke static function you write scope resolution "::"
ccLib::CCoInitialize::CoInitialize(ccLib::CCoInitialize::eMTAModel);
when they have "space" instead of "::" what is that mean? What are
they trying to do?
Thanks
Trups
I think ccLib is a namespace, and that line means to instantiate
class CCoInitialize that is defined in namespace ccLib.- Hide quoted text -
- Show quoted text -
Thanks for your answer. Yes ccLib is a namespace. I still have a
question
CoInitialize(ccLib::CCoInitialize::eMTAModel); returns HRESLT so this
function should be
HRESULT result = CoInitialize(ccLib::CCoInitialize::eMTAModel);
and ccLib::CCoInitialize cclib; this should be instantiation
what do you mean when you combine both?
ccLib::CCoInitialize CoInitialize(ccLib::CCoInitialize::eMTAModel);
That space (CCoInitialize CoInitialize) I am confuse with.
Thanks- Hide quoted text -
- Show quoted text -