0

I have VB6 ActiveX (e.g. MyActiveX) that is used from MFC:

m_pControl = new CWnd;
m_pControl->CreateControl("MyActiveX.MainControl",
                          "",
                          WS_VISIBLE, 
                          rc,
                          this,
                          5000,
                          NULL,
                          FALSE,
                          NULL);

When I remove some unused function or move variable (not used outside VB ActiveX), VB6 warns about breaking compatibility. I chose to break compatibility but now the VB6 ActiveX is not shown properly from MFC application.

As I understand, breaking compatibility will create new UUID for the interface and type library. That is fine as long as I can do something to make it work again, and since I am using a string ProgID MyActiveX.MainControl, I think my MFC app shouldn't get affected.

Edit:
As I understand from Resetting project compatibility in vb6, breaking compatibility is okay as long as I rebuilt projects that refer to it. But from MFC, I only refer to the VB project using a string MyActiveX.MainControl so I don't see why I should rebuild my MFC app; and even after rebuilding my C++ MFC app, the VB ActiveX is still not properly shown.

Only two functions in VB6 ActiveX that are actually used from C++ MFC side. That's why I removed/moved some other functions and variables that are only used from within VB6 ActiveX. So I'm not sure why it stopped being displayed properly

Community
  • 1
  • 1
Afriza N. Arief
  • 7,696
  • 5
  • 47
  • 74

1 Answers1

0

No. VB6 is right. The Problem is about the Interface you use, the properties and Events. It depends on how you integrated the Control into the MFC. As Long as all DispIds (dispatch Ids from the IDispatch Interface) are stable, and as Long as all function you use are still available you don't have a problem.

If DispIDs are changing, function prototypes change, you will get into Problems.

xMRi
  • 14,982
  • 3
  • 26
  • 59
  • Hi, thanks for your answer. Only two functions in VB6 ActiveX that are actually used from C++ MFC side. That's why I removed/moved some other functions and variables that are only used from within VB6 ActiveX. So I'm not sure why it stopped being displayed properly. – Afriza N. Arief Oct 08 '13 at 06:09
  • Check the old interface and the new interface in OleViewer. As long as you use the same DispIds you don't have a problem. – xMRi Oct 08 '13 at 06:32