code_junkie

Returning a value from a method in an ActiveX control

Nov 12th, 2011
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. [id(1)] void GetVersion();
  2.  
  3. BEGIN_DISPATCH_MAP(CDetectorCtrl, COleControl)
  4. DISP_FUNCTION_ID(CDetectorCtrl, "GetVersion", 1, GetVersion, VT_EMPTY, VTS_NONE)
  5. END_DISPATCH_MAP()
  6.  
  7. void CDetectorCtrl::GetVersion()
  8. {
  9. MessageBox(L"Test");
  10. }
  11.  
  12. [id(1)] int GetVersion();
  13.  
  14. BEGIN_DISPATCH_MAP(CDetectorCtrl, COleControl)
  15. DISP_FUNCTION_ID(CDetectorCtrl, "GetVersion", 1, GetVersion, VT_INT, VTS_NONE)
  16. END_DISPATCH_MAP()
  17.  
  18. int CDetectorCtrl::GetVersion()
  19. {
  20. MessageBox(L"Test");
  21. return 1337;
  22. }
  23.  
  24. LONG CDetectorCtrl::GetVersion(void)
  25. {
  26. AFX_MANAGE_STATE(AfxGetStaticModuleState());
  27. return 1337;
  28. }
Add Comment
Please, Sign In to add comment