[Closed] SDK: Problem with ParamBlockDesc2 in 32-bit builds?
I have a plugin that’s working fine with all 64-bit versions of Max, and compiles for 32-bit, but then does not work properly in the 32-bit versions.
Initially I was getting the following dialog when I started 32-bit versions of Max:
ParamBlockDesc2 definition error
Error in ParamBlockDesc2 definition.
Bad option tag in block “my plugin parameters”, parameter “iterations”, option # 4
The pblock2 in question:
static ParamBlockDesc2 my_pblock (
my_params,
_T("my plugin parameters"),
0,
&myPluginDesc,
P_AUTO_CONSTRUCT + P_AUTO_UI, 0,
// rollout
IDD_PANEL, IDS_PARAMETERS, 0, 0, NULL,
// Parameter specifications
my_val,
_T("value"),
TYPE_FLOAT,
P_ANIMATABLE,
IDS_VALUE,
p_default, 0.5f,
p_ms_default, 0.5f,
p_range, 0.0f, float(1.0f),
p_ui,
TYPE_SPINNER, EDITTYPE_FLOAT,
IDC_VAL, IDC_VALSPIN, SPIN_AUTOSCALE,
p_accessor, &myPluginDesc,
end,
my_iter,
_T("iterations"),
TYPE_INT,
P_ANIMATABLE,
IDS_ITERATIONS,
p_default, 1,
p_ms_default, 1,
p_range, 0, 100, //1.0E30, <-- I changed this value
p_ui,
TYPE_SPINNER, EDITTYPE_INT,
IDC_ITER, IDC_ITERSPIN, SPIN_AUTOSCALE,
p_accessor, &myPluginDesc,
end,
end
);
I tried changing the maximum value of the parameter from 1.0E30 to 100 (as noted in the comment), and no longer receive an error message on starting Max. However, when I click on the modifier list in the modifier panel it is completely empty!
This occurs in both Max 2012 and 2013 32-bit versions (I’ve not tried compiling for earlier). As I said before, it seems to run without problems on all 64-bit versions.
Any idea what I’m doing wrong?
I don’t know if this is a related issue or not, but when I run the plugin through the Local Windows Debugger option with the original maximum value (1.0E30), I get the following popup from Visual Studio:
Unhandled exception at 0x74BD7A19 (ole32.dll) in 3dsmax.exe: 0xC0000005: Access violation reading location 0xFEEEFEFE.
If I then select break, Visual Studio opens a new window stating:
compobj.cxx not found
You need to find compobj,cxx to view the source for the current call stack frame
I am given the option “Browse and find compobj.cxx”, which appears to have its default location set as d:\w7rtm\com\ole32\com\class\compobj.cxx
So my question is: wat?
I just realized that I was working with an older file from back before I was taught not to include p_accessor in a ParamBlockDesc2. So I took that out and it helped substantially.
Still not sure why the 32-bit version doesn’t recognize the notation for 1.0E30, but other than that everything is now working fine.
why is that ? – never had a problem with p_accessor
1.0E30, that doesnt fit into a 32-bit int
even too big for a 64-bit int
Just going off what I’ve been told and what has/hasn’t worked for me. I’m still far from an expert at this stuff.
What Klunk told me on the subject was: “It expects an object the inherits from the class PBAccessor not a ClassDesc”