Inside Sabertooth
Learn how Sabertooth uses 3ds Max to create 3D interactive projects, including HBO Go’s Game of Thrones interactive experience
  • 1/3
You are here: Forum Home / Autodesk 3ds® Max® / SDK / getStr from string parameter in ParamBlockDesc2
  RSS 2.0 ATOM  

getStr from string parameter in ParamBlockDesc2
Rate this thread
 
51982
 
Permlink of this thread  
avatar
  • Total Posts: 1
  • Joined: 09 February 2007 03:41 PM

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.



Replies: 0