[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 199
  • Last Modified:

MTS Components while developing

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

Manolito
0
manolito
Asked:
manolito
  • 3
  • 3
  • 2
  • +2
1 Solution
 
PaulHewsCommented:
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.
0
 
mdouganCommented:
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.
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
manolitoAuthor Commented:
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

Thanks

Manolito



0
 
mdouganCommented:
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.
0
 
manolitoAuthor Commented:
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?
Thanks
0
 
rpaiCommented:
On the Command Prompt, run a MTXSTOP command for the objects to stop running.

C:\> mtxstop
0
 
mdouganCommented:
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.  
0
 
DanRollinsCommented:
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
0
 
manolitoAuthor Commented:
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.
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

  • 3
  • 3
  • 2
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now