Solved

MTS Components while developing

Posted on 2002-07-01
10
193 Views
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

Manolito
0
Comment
Question by:manolito
  • 3
  • 3
  • 2
  • +2
10 Comments
 
LVL 5

Expert Comment

by:rpai
ID: 7122196
0
 
LVL 38

Expert Comment

by:PaulHews
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.
0
 
LVL 18

Accepted Solution

by:
mdougan earned 100 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.
0
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 

Author Comment

by:manolito
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

Thanks

Manolito



0
 
LVL 18

Expert Comment

by:mdougan
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.
0
 

Author Comment

by:manolito
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?
Thanks
0
 
LVL 5

Expert Comment

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

C:\> mtxstop
0
 
LVL 18

Expert Comment

by:mdougan
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.  
0
 
LVL 49

Expert Comment

by:DanRollins
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
0
 

Author Comment

by:manolito
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.
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

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…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…

777 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