How to Use Int/int32

Hi,
I have made (or attempted to make) several plugins that require integer values in order to function; however, every time I utilize these in my plugin, I get exceptions during runtime. Is there a different way that you serialize these? I have been using the serialization method that is explained in the SDK tutorials.
Sincerely,
Sine On Synth

An int is a fundamental type in c++ and int32 is just an alias for it. Just using these will not throw exceptions. You need to provide more context, some code snippet, where the exception is thrown until someone could give you a hint what is wrong.

To clarify:

  1. after declaring the parameters and then declaring the integers in processor.h, I then
    implement it in processor.cpp using process()method:
process()
{
   //...
   switch (paramQueue->getParameterId())
   {
     //....
     case kN:
            mN = (int)value;
            break;
     case kQ:
            mQ = (int)value;
            break;
   }
   // processing....
   int N = mN;
   int Q = mQ;
   for(int32 i = 0; i < numChannels; i++)
   {
        // declaration of samples, inputs[0], and outputs[0]
       Vst::Sample32 tmp;
       while (--samples >= 0) {
               tmp = (*ptrIn[0]) / sqrtf(Q + powf(FuncX, 2 * N));
       }
   }
}
  1. after this is done, the serialization is as follows:
//processor.cpp
getState(){
       IBStreamer streamer(state, kLittleEndian);
       int ival;
       //...
      streamer.writeInt32(ival);
      ival = mN;
      streamer.writeInt32(ival);
      ival = mQ;
}
  1. then the setState() method:
setState(){
       IBStreamer streamer(state, kLittleEndian);
       int ival;
      // ...
     if (streamer.readInt32(ival) == false)
           return kResultFalse;
    mN = ival;
    if (streamer.readInt32(ival)==false)
         return kResultFalse;
    mQ = ival;
}
  1. then, after parameters are added in the constructor for controller.cpp, I serialize:
setComponentState(){
      //declaration of IBStreamer...
     int ival;
     //...
     if(streamer.readInt32(ival) == false)
         return kResultFalse;
     setParamNormalized(kN, ival);

     if(streamer.readInt32(ival) == false)
         return kResultFalse;
     setParamNormalized(kQ, ival);
}

This is taken from one of my plugins that I have created. It isn’t throwing an exception currently, however, it does say that the parameter 1001 (kN)'s value is not normalized. Is this the root of the exceptions? if so, how do I normalize it? (I’ve done the method shown in my snippet from controller.cpp and also the param->setNormalized(ival) method).
P.S
It seems that these exceptions happen randomly to different projects, one project does
it, but another doesn’t.

I think you should at least read the fundamentals of the vst technical documentation before hacking further. Start here and read at least until the end of this page.
This may prevent you to make mistakes in early stages of your development.

Thank you very much. It delt with the “param is not normalized” issue, and also my question about the integers.
Sincerely,
Sine On Synth