I know this is similar to another post of mine (Why GetOccurrences and get_Occurrences?) but since I'm also new to smart pointers I thought I'd better sort this out in my mind.
When manipulating the name of a sketch I can use three different ways of doing it.
hRes = pSketches->Add (_variant_t((IDispatch *)pWorkPlane), VARIANT_FALSE, &pSketch); wprintf (L"The sketch default name is %s\n",pSketch->Name.GetBSTR()) ; pSketch->Name = L"Tube-Base" ; BSTR bstrSketchName ; pSketch->get_Name (&bstrSketchName) ; wprintf (L"The sketch is now called %s\n",bstrSketchName) ;
So I can use
I understand why there is get_ and Get, but why is the Name and get_Name? Is it a smart pointer thing I need to be wary of? Or can I simply use these methods as I have done in the code example above?
Hi Oransen,
In C++ all the methods come in two flavor, that are named high and low syntax: the high syntax methods are the GetXXXX ones, they usually return directly the result but throw exceptions. The low syntax methods are the get_XXXX ones. They returned error code and take the result as in-out parameter.
Both low and high methods have the same effect, but it is usually a good practice to remain consistent wether you use one or the other.
Regrads,
Philippe.