operator BSTR (void) const{ return m_bstr;}
表示操作符函数BSTR,const在末尾修饰该函数,说明是个常量函数,在函数体里不会有修改对象的数据成员;reinterpret_cast操作符,可以将一种指针类型转变为任何类型的指针
也可以把一个整数转变为一个指针套间是COM对象生存的空间
SCM, Service Control Manager
服务程序由main作为程序入口点
ServiceMain作为服务的入口点
Handle或HandleEx作为服务的控制及接收服务的请求

解决方案 »

  1.   

    reinterpret_cast Operator
    The reinterpret_cast operator allows any pointer to be converted into any other pointer type. It also allows any integral type to be converted into any pointer type and vice versa. Misuse of the reinterpret_cast operator can easily be unsafe. Unless the desired conversion is inherently low-level, you should use one of the other cast operators.Syntaxreinterpret_cast < type-id > ( expression )The reinterpret_cast operator can be used for conversions such as char* to int*, or One_class* to Unrelated_class*, which are inherently unsafe.The result of a reinterpret_cast cannot safely be used for anything other than being cast back to its original type. Other uses are, at best, nonportable.The reinterpret_cast operator cannot cast away the const, volatile, or __unaligned attributes. See const_cast Operator for information on removing these attributes.The reinterpret_cast operator converts a null pointer value to the null pointer value of the destination type.
    上面说得很详细了^_^
      

  2.   

    operator BSTR (void) const{ return m_bstr;}能说得清楚一些吗?BSTR是一种类型?
    这也可以重载吗?