This function is performed, but does not return:
int getpnt(IAcadUtility* pUtility)
{
//!< Gets the point selected in AutoCAD
//hr = GetPoint(IAcadUtility *This, VARIANT Point, VARIANT Prompt, VARIANT *pResult);
//IAcadUtility_GetPoint(This, Point, Prompt, pResult);
VARIANT* ppnt; // returned to pointer Point as variant
VARIANT vpnt[3]; // var-struct for one 3d-point
vpnt[0].vt = VT_R8;
vpnt[0].dblVal = 10.0;
vpnt[1].vt = VT_R8;
vpnt[1].dblVal = 20.0;
vpnt[2].vt = VT_R8;
vpnt[2].dblVal = 30.0;
BSTR bstr = NULL;
bstr = SysAllocString ( L"pick the existing point--> " );
VARIANT Prompt; // struct tagVARIANT as BSTR
Prompt.vt = VT_BSTR;
Prompt.bstrVal = bstr;
SysFreeString ( bstr );
char sVal[64];
IAcadUtility_GetPoint(pUtility, *vpnt, Prompt, ppnt);
sprintf(&sVal[0], "X=%f\nY=%f\nZ=%f", vpnt[0].dblVal, vpnt[1].dblVal, vpnt[2].dblVal);
MessageBox(0, sVal, "Returned Point", 0);
and also this function:
int getent(IAcadUtility* pUtility)
{
// VBA .Utility.GetEntity returnObj, basePnt, "Select an object"
//!< Gets an object interactively
//hr = GetEntity(IAcadUtility *This, IDispatch** Object, VARIANT* PickedPoint, VARIANT Prompt);
//IAcadUtility_GetEntity(This, Object, PickedPoint, Prompt);
//IAcadPoint *pPoint;
IDispatch** Object;
BSTR bstr = NULL;
bstr = SysAllocString ( L"pick any entity: " );
VARIANT Prompt; // struct tagVARIANT as BSTR
Prompt.vt = VT_BSTR;
Prompt.bstrVal = bstr;
SysFreeString ( bstr );
VARIANT vpnt[3]; // struct for one 3d-point
vpnt[0].vt = VT_R8;
vpnt[0].dblVal = 10.0;
vpnt[1].vt = VT_R8;
vpnt[1].dblVal = 20.0;
vpnt[2].vt = VT_R8;
vpnt[2].dblVal = 30.0;
char sVal[48];
IAcadUtility_GetEntity(pUtility, Object, vpnt, Prompt);
sprintf(&sVal[0], "X=%f\nY=%f\nZ=%f", vpnt[0].dblVal, vpnt[1].dblVal, vpnt[2].dblVal);
MessageBox(0, sVal, 0, 0);
return 0;
}