J'ai un contrôle ActiveX simple qui a 4 propriétés et 8 méthodes Set et Get, le problème est que je ne peux pas y accéder à l'exécution, au moment voulu ils fonctionnent bien ci-dessous est le message d'erreur qui se produit lorsque je lanch le programme en Visual basic
et répartir la carte avec file.idl de mon contrôle ActiveX. En Visual C++ j'ai un message "membre non trouvé" quand un accès aux propertys ou aux méthodes. Est-ce que n'importe qui peut m'aider avec ce problème. Merci d'avance.Le contrôle ActiveX Visual Basic ne peut pas accéder aux propriétés et méthodes à l'exécution
Une exception non gérée du type 'System.Runtime.InteropServices.COMException' est produite dans mscorlib.dll Informations complémentaires: échec Catastrophique (exception HRESULT: 0x8000FFFF (E_UNEXPECTED))
File CSliderCtrl1.cpp a expédition carte
BEGIN_DISPATCH_MAP (CSliderCtrl1, COleControl) DISP_PROPERTY_EX_ID (CSliderCtrl1, "backgroundColor", 1, GetbackgroundColor, setBackgroundColor, VT_I4) DISP_PROPERTY_EX_ID (CSliderCtrl1, "backColor", 2, GetbackColor, SetBackColor, VT_I4) DISP_PROPERTY_EX_ID (CSliderCtrl1, "foreColor", 3, GetforeColor, SetforeColor, VT_I4) DISP_PROPERTY_EX_ID (CSliderCtrl1, "positionBar", 4, GetpositionBar, SetpositionBar, VT_I4) END_DISPATCH_MAP()
Slider.idl fichier
comprennent
comprennent
[uuid (F9248E73-F5AD-43B1-815B-91817E91B537), la version (1.0), la commande] bibliothèque SliderLib {importlib (STD OLE_TLB);
// Primary dispatch interface for CSliderCtrl1
[ uuid(093C2CB6-C812-4B91-84CB-1C508439DBFD) ]
dispinterface _DSlider
{
properties:
[id(1)] COLORREF backgroundColor;
[id(2)] COLORREF backColor;
[id(3)] COLORREF foreColor;
[id(4)] unsigned long positionBar;
methods:
[id(5)] COLORREF GetbackgroundColor();
[id(6)] void SetbackgroundColor([in] COLORREF color);
[id(7)] COLORREF GetbackColor();
[id(8)] void SetbackColor([in] COLORREF color);
[id(9)] COLORREF GetforeColor();
[id(10)] void SetforeColor([in] COLORREF color);
[id(11)] unsigned long GetpositionBar();
[id(12)] void SetpositionBar([in] unsigned long position);
};
// Event dispatch interface for CSliderCtrl1
[ uuid(9113AA84-629F-4C34-88A3-EBFFF0F94B2E) ]
dispinterface _DSliderEvents
{
properties:
// Event interface has no properties
methods:
};
// Class information for CSliderCtrl1
[ uuid(FA933E84-1B30-4283-9A2A-9CC1E8D99408), control ]
coclass Slider
{
[default] dispinterface _DSlider;
[default, source] dispinterface _DSliderEvents;
};
};
Salut à tous! Je pense que le code dans votre question pourrait utiliser un formatage, il est à peine lisible comme il est. – damienc