I tried this and just want to document the info here. I created a simple XF in UFF called mytest, and here is the code
void mytest(const double& x)
{
//begin code to print the XF path
string strXF = "mytest";// had to hard code the name here
string strPath;
if(okutil_find_file_from_composite_name(&strPath, strXF, SUPPORTFILE_XF, ORIGIN_PATH_UNDEF) == ORIGIN_PATH_UNDEF)
out_str("not found");
else
{
string strOxfPath = GetFilePath(strPath);
out_str(strOxfPath);
}
//end code
}
int mytest_event1(TreeNode& trGetN, int nRow, int nEventID, DWORD& dwEnables, LPCSTR lpcszNodeName, WndContainer& DynaCntrlContainer, string& strAux, string& strErrMsg)
{
if( xf_is_extended_event(nEventID) )
return mytest_event1_ex(trGetN, nRow, nEventID, dwEnables, lpcszNodeName, DynaCntrlContainer, strAux, strErrMsg);
DECLARE_BUTTON_ENABLES
//begin code to print XF path, you can see this by "mytest -d"
//in event1, don't need to asssume XF name since it can be obtained from tree
string strXF, strPath;
trGetN.GetAttribute(STR_CLASS_OPTION_NAME_ATTRIB, strXF);
okutil_find_file_from_composite_name(&strPath, strXF, SUPPORTFILE_XF, ORIGIN_PATH_UNDEF);
out_str("in XF event, path is");
out_str(GetFilePath(strPath));
//end code print XF path
return false;
}