|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Run-time Error 430, WITH non-broken binary compatibility?number of appliations is built. Everything has been working fine, up until today. One class in the library is a FormFactory. The form factory returns pre-created forms. I've got an Enumeration defined, such as: ----- Public Enum EFF EFF_Main = 0 EFF_Login = 1 End Enum ----- And a function in FormFactory: ----- Public Function createForm(byval p_eForm as EFF) as IMyForms Select Case p_eForm ... End Select End Function ----- And finally, an interface, IMyForms, with a single function: ----- Public Function showForm() as Integer ----- In this way, I can create forms from the DLL and show them to the user, with code such as this: ----- Public Sub Foo() Dim oMyForm as IMyForms Dim oFactory as FormFactory Dim iExitStatus as Integer Set oFactory = new FormFactory Set oMyForm = oFactory.createForm(EFF_Main) iExitStatus = oMyForm.showForm ----- (of course, all of my forms implement the IMyForms interface in their code segment). This code has been working fine for months. So today I found a bug in one of the forms, and went to fix it. I did *not* add any public members, functions, subroutines, or change *any* signatures. All of the code I changed was labeled as Private code, tied to control and form events. For example, in the Form_Unload() event I increase a counter, and I changed that code.. So it went from: ----- Private Sub Form_Unload(Cancel as Boolean) c_iMyValue=0 End Sub ----- To: ------ Private Sub Form_Unload(Cancel as Boolean) c_iMyValue=-1 End Sub ----- However, when I compile the DLL and install it, suddenly I get the dreaded Error 430: Class does not support Automation or does not support expected interface. Now, I've got binary compatibility turned on, and nothing "public" has changed. But I still get this error. If I role back to the previuos version of the DLL, then the application works fine (albeit with the original bug that I was trying to fix in the first place). Does anybody have any idea what could be happening here? One more thing. Say the previous version of the DLL is 1.1 and the new version is 1.2. If I re-compile the app against 1.2, it works fine, but then if I role back to 1.1, the app breaks again. Same vice- versa: compile against 1.1, upgrade to 1.2, broken. But if I haven't changed anything, and I get no warnings about breaking compatibility, I was under the impression that having binary compatibility would allow me to use either 1.1 OR 1.2 with the app, *regardless* of the version that it was compiled against. Thanks for *any* help in this! -10d "tendim" <ten***@gmail.com> wrote in message It sounds like the binary compatibility model wasn't kept up to date. It's news:1172610250.977521.128520@p10g2000cwp.googlegroups.com... > > Does anybody have any idea what could be happening here? very easy to forget to update after adding a new public interface. Here's a little bit about that... http://www.vbsight.com/BinaryComp.htm > One more thing. Say the previous version of the DLL is 1.1 and the You don't need to change anything or break compatibilty. All you have to do > new version is 1.2. If I re-compile the app against 1.2, it works > fine, but then if I role back to 1.1, the app breaks again. Same vice- > versa: compile against 1.1, upgrade to 1.2, broken. But if I haven't > changed anything, and I get no warnings about breaking compatibility, is forget to update the model after adding something new. If you add something new, VB generates a new interface ID for that item. If you forget to update the compatibility model, VB will regenerate this new ID each time you compile, without telling you that something's wrong. > I was under the impression that having binary compatibility would Nope... when you compile with a newer version, the app wants that newer > allow me to use either 1.1 OR 1.2 with the app, *regardless* of the > version that it was compiled against. version. > Thanks for *any* help in this! > > -10d -- Ken Halter - MS-MVP-VB - Please keep all discussions in the groups.. In Loving Memory - http://www.vbsight.com/Remembrance.htm On Feb 27, 4:17 pm, "Ken Halter"
<Ken_Halter@Use_Sparingly_Hotmail.com> wrote: > "tendim" <ten***@gmail.com> wrote in message Again, *NOTHING* was changed on the public end. No public members> > news:1172610250.977521.128520@p10g2000cwp.googlegroups.com... > > > > > Does anybody have any idea what could be happening here? > > It sounds like the binary compatibility model wasn't kept up to date. It's > very easy to forget to update after adding a new public interface. were changed, no function or subroutine prototypes, absolutely nothing. All code changes (in fact, only two lines of code, total) were made in private subroutines which represented events of form controls. Yup, read that one a long time ago, that's how I first learned about this stuff. "tendim" <ten***@gmail.com> wrote in message If nothing at all changed, why did the typlib version get incremented? You news:1172668887.235315.288550@8g2000cwh.googlegroups.com... > > Again, *NOTHING* was changed on the public end. No public members > were changed, no function or subroutine prototypes, absolutely > nothing. All code changes (in fact, only two lines of code, total) > were made in private subroutines which represented events of form > controls. > >> Here's a little bit about that...http://www.vbsight.com/BinaryComp.htm > > Yup, read that one a long time ago, that's how I first learned about > this stuff. can download a ComGuard demo (fully functional) and use that to compare the 2 components. It'll show the differences. Either way, once the typelib version changes and you compile something against that new version, you can no longer use the older component, with that specific app. The older component should still work with any previously compiled apps. -- Ken Halter - MS-MVP-VB - Please keep all discussions in the groups.. In Loving Memory - http://www.vbsight.com/Remembrance.htm "Ken Halter" <Ken_Halter@Use_Sparingly_Hotmail.com> wrote in message news:O% forgot the link> can download a ComGuard demo (fully functional) and use that to compare > the http://www.vbsight.com/ComGuard.htm -- Ken Halter - MS-MVP-VB - Please keep all discussions in the groups.. In Loving Memory - http://www.vbsight.com/Remembrance.htm |
|||||||||||||||||||||||