Click to See Complete Forum and Search --> : help.....


Adachi
June 14th, 1999, 04:15 AM
anyone can tell me what's wrong with this code??
i got runtime error when i got into the second line....

DISPPARAMS dispParams;
dispParams.rgvarg[0].vt = VT_I2;
dispParams.rgvarg[0].iVal = 1;
dispParams.cArgs = 1;
dispParams.cNamedArgs = 0;




thanks in advance

adachi

June 14th, 1999, 11:49 AM
you are referencing memory that has not been allocated:
dispParams.rgvarg[0].vt = VT_I2;
look at the definition of DISPPARAMS and you will see that the rgvarg variable is defined like:
VARIANTARG FAR* rgvarg;
which does not allocate memory;