Notifications
Clear all

[Closed] how to access ParamBlockDesc2 data?

Hi!guys
I am learning about MaxSDK.
I write a plugin bese from Bend sample. I names it “BendTest” and subclass from SimpleMod2.

==============================================================================================================
class BendTest : public SimpleMod2 {

}

Then I create another empty DLL names “BendTestDLL” and add some code in there related with “BendTest”.

The BendTest use LoadLibrary(“stdplugs\BendtestDLL.dll”) to access BendTestDLL data.

==============================================================================================================

The BendTest code

Deformer& BendTest::GetDeformer(
TimeValue t,ModContext &mc,Matrix3& mat,Matrix3& invmat)
{

HMODULE l_mod  ;
l_mod = LoadLibrary("stdplugs\\BendtestDLL.dll");

...
...

}

==============================================================================================================

The BendtestDLL code

extern “C” __declspec(dllexport) Deformer& fDeformer(TimeValue t,ModContext &mc,Matrix3& mat,Matrix3& invmat)
{


static BendTestDeformer_1 deformer_1;
static BendTest* pBendTest ;

pBendTest->pblock2->GetValue(bend_angle,t,angle ,FOREVER); 

deformer_1 = BendTestDeformer_1(t, mc, angle, mat, invmat);
 
return deformer_1;

}

==============================================================================================================

I have a problem, I want to use BendTestDLL to get BendTest ParamBlockDesc2 data , ex. angle, direct, etc.

I try to write:

static BendTest* pBendTest ;	
pBendTest->pblock2->GetValue(bend_angle,t,angle ,FOREVER); 

It is no problem to compiler, but when I put BendTest.dlm and BendTestDLL.dll in 3dsMax and use it,
the 3dsMax will be shutdown, I have no idea how to fix it, any one can help me? thx.