|
In my ParamBlockDesc2 I have this code:
file_string, _T("File_String"), TYPE_STRING, P_ANIMATABLE, IDS_SPIN,
//Zero or more optional tags
p_ui, TYPE_EDITBOX, IDC_RIGHT_EDIT,
end,
later on in a simpleobject::BuildMesh I have this code:
string filename;
pblock2->GetStr (file_string, t, filename );
However it errors:
Error 12 error C2664: ‘IParamBlock2::GetStr’ : cannot convert parameter 3 from ‘std::string’ to ‘int’ widget.cpp 321 Widget
------------------------------------------------------------
It seems that GetStr is trying to return an int… how can I return the string from the parameter into a string variable? Or do I use GetValue to return a string?
--------------------------------------------------------------------------------
solved with a reply on another board:
For a string parameter you have to use “TCHAR*” not “std::string”, Max doesn’t use STL natively for its parameters in paramblocks.
The usage of GetStr is :
Code:
const TCHAR* s = (*pm)->GetParamBlock()->GetStr(pd.ID, t);
First param is the ID of the parameter in the param block, second param of this function is the time at which you want its value for animated parameters.
|