instanciation problématique dans une méthode ActiveX
Bonjour,
je suis en train de développer un activeX en C++ avec Visual Studio .NET, et j'ai un problème de bug (plantage de IE) quand je lance une méthode de mon activeX à partir du code JavaScript, et cette erreur vient apparemment d'une instanciation dans cette méthode.
[EDIT]
Pour rendre plus simple le problème que j'expose, est-ce que ce code peut poser des problèmes ?
Code:
1 2 3 4 5
|
int Functions::Init(bool _a, bool _b) {
this->myIPB = *(new IPB(_a, _b));
return this->myIPB.Init();
} |
[/EDIT]
Explications plus longues...
la méthode de l'activeX
Code:
1 2 3 4 5 6 7 8 9 10 11 12
|
BSTR CActiveXCtrl::Init(VARIANT_BOOL _a, VARIANT_BOOL _b)
{
AFX_MANAGE_STATE(AfxGetStaticModuleState());
//L'instanciation qui pose problème
int res = funct->Init(true,true);
strcpy(resultat, funct->GetText(res));
CString strResult(resultat);
return strResult.AllocSysString();
} |
la fonction init:
Code:
1 2 3 4 5
|
int Functions::Init(bool _a, bool _b) {
this->myIPB = *(new IPB(_a, _b));
return this->myIPB.Init();
} |
le constructeur de la classe IPB:
Code:
1 2 3 4 5 6
|
IPB::IPB(bool _a, bool _b) {
pObject = NULL;
this->res = _a;
this->comp = _b;
} |
Quand je lance la méthode Init(true,true), internet explorer plante et mon debug me dit:
Code:
1 2 3 4 5
|
int Functions::Init(bool _a, bool _b) {
>>>erreur ici this->myIPB = *(new IPB(_a, _b));
return this->myIPB.Init();
} |
avec:
this 0xcdcdcdcd
|_>myIPB {pObject=??? res=??? comp=???}
|_> pObject CXX0030 expression cannot be evaluated
|_> res CXX0030 expression cannot be evaluated
|_> comp CXX0030 expression cannot be evaluated