Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


MTS Components while developing

Posted on 2002-07-01
Medium Priority
Last Modified: 2013-11-25
Guys, just a question,
Can anybody explain me the flow  necessary to follow in order to change MTS components and clients during development?, I really get a lot of confusion with "No compability"/"Project compability"/"Binary Compability".
I don't know exactly when to shut down the component, when to re-create the package, export and install it again in the client, etc etc etc. I'll appreciate if somebody send me a link to a web page showing the steps
as a flow diagram or just tell me the exact the steps to do an efficient development.

Many Thanks in advance

Question by:manolito
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
  • 2
  • +2
LVL 38

Expert Comment

ID: 7122472
When developing use project compatibility.  It is designed for maintaining compatibility while debugging your application.  If you don't use this, you have to reset the references in your client with each change to the component.

When you compile the DLL for release the first time, use binary compatibility.  Then any subsequent changes to the component will be tested against the binary compatible version and if compatibility is broken, you will be advised and you will have to recompile your clients.
LVL 18

Accepted Solution

mdougan earned 300 total points
ID: 7122531
I'm not sure if you're developing under DCOM or COM+, but here is the process as I learned it (through much pain) for developing with COM+

First, make sure that all of your component projects use Binary Compatibility.  This setting ensures that you will keep the same GUID (ClassID?) each time you compile. This has two beneficial effects.  One, it keeps your registry free from multiple entries for the same component (more or less), and, any other program that might have been compiled with a reference to that object will still continue to work, when instantiating an instance of that object.

When compiling with binary compatibility, if you have changed anything that would change the components "Interface", such as removing any public methods, or changing the parameter list of any public function, or changing any public ENUMS, then you will get a message warning you that you are about to break the binary compatibility.  This is OK, but then it will be up to you to test each program that might instantiate an object of that type to ensure that they still work.  If they do not, then you have to open those projects, fix the reference if necessary, and recompile.  

To fix a missing reference, ALWAYS click the browse button and locate the component's DLL manually, never select it from the list of checkboxes in the Project|References menu.  Sometimes, for unknown reasons, you might have to do this more than once to get the checkmark to stick.  If you try browsing for the reference a few times and it never seems to check the checkbox in the Project|References menu, then make sure to uncheck the checkmark next to the missing reference, save the project and close out of VB.  Now, reopen the project, go to properties|references and Browse to find the component.  Keep doing this until it works.

For the most part, it is suggested that you use "Late Binding" in your code, so, code that calls your component should use CreateObject instead of New.  This means that the code will probably not be affected if you break binary compatibility, at least as far as it's references are concerned.  Still, the code may need to change if you were calling one of those deleted public functions etc.

Now, while developing the components, I found that this somewhat lengthy set of steps almost always assured me that my references were managed well.

Let's say that you need to make a change to a component, then you want to recompile it.  Before recompiling, shutdown the component in the Component Manager, and delete the component from the project/package.  Doing this may actually remove the registry entries for the component (at least, I've found that if I don't do this before recompiling and breaking the compatibility, I'll get multiple entries for the same component).

Now, go ahead and compile.  You may or may not break compatibility.  Either way, now, go ahead and add the component back to the project/package.  However, when you do this, if you are provided with a list of installed components to choose from, don't pick from the list.  ALWAYS click the browse button and navigate down to the DLL that you just compiled.  That way, you can always be sure that the correct version of the component is being added to your package.

Now, you can resume your testing.  Again, if you've broken compatibility, then you have to double-check any code that uses that component to make sure it still works.

If you change a component that is referenced by another component that is referenced from some client code, then just to be sure, I recompile everything.

First, change and recompile (following all the steps listed above) the highest level component.  Then, edit any component that referenced that highest level component, fix any references if necessary, recompile, then test the client (and fix any references there if necessary).

If you follow these steps, you shouldn't have too many problems.
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!


Author Comment

ID: 7146732
Hello mdougan sorry that I didn't get back to u before,
thanks for your response, I'm using VB COMs for this project, as far as I know people suggest to use "Project Compability" once the components are done and ready for production we change them to "Binary Compability", my question is:
Do you suggest to work without MTS I mean just registering the COMS with regsvr and then when everything is alright put them working under MTS? I see that much easier, what do you think? Now I don't know what will happen since I have ObjectControl methods as well as conditional compilation inside my COM



LVL 18

Expert Comment

ID: 7148019
No, I think that you should develop in the same environment that your components will be running under.  It's not a problem to do all the things that I mentioned, and if you follow the instructions then it wont clutter up your registery too much.  Then, when you are ready, just release the component.

Author Comment

ID: 7148495
mdougan when I try to "shut down"
the component nothing happens,
I tried selecting the component in MTS then right click
(SHUT DOWN) and nothing the component still working without problems any clue why is not shuting down? is there something else?. any clue?

Expert Comment

ID: 7149086
On the Command Prompt, run a MTXSTOP command for the objects to stop running.

C:\> mtxstop
LVL 18

Expert Comment

ID: 7151930
Shutting the component doesn't always work.  Sometimes you have to stop the whole package (I forget the correct term, but if you go up one or two levels, and stop that, it will work.  
LVL 49

Expert Comment

ID: 7970983
Hi manolito,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will ask a Community Support Moderator to:

    Split points between: rpai and mdougan

manolito, if you think your question was not answered at all or if you need help, just post a new comment here; Community Support will help you.  DO NOT accept this comment as an answer.

EXPERTS: If you disagree with that recommendation, please post an explanatory comment.
DanRollins -- EE database cleanup volunteer

Author Comment

ID: 7972501
Just to add that all the hassle of VB COM development
in regarding to Project Compatibility/No Compatibility/Binary Compatibility and old COM references sticked in the registry are sorted out using Windows 2000, instead of WinNT.

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

721 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question