Improve company productivity with a Business Account.Sign Up


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
  • 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.
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.


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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

595 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