Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win


IIS Stopping because of COM

Posted on 2002-03-11
Medium Priority
Last Modified: 2013-11-25
Sometime ago we wrote a COM object to use on IIS.  Nothing fancy, we just use it to control the layout of our navigation on our web site (btw we used COM because of the inherent problems in IIS 4 of memory hogging when using asp include files).  The COM works fine under NT Server.

We've now moved to Windows 2000 and IIS5.  We're experiencing problems where IIS just stops (and needs to be reset).  This seems to be random.  We are wondering if it could be something to do with the COM.

Are there project/build settings or other considerations that we need to think about and change that could be causing this issue.

It's on our production servers so it's pretty urgent.

We're not experts in VB or COM but are ok, but the more details the better.

Question by:martinbw
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

Author Comment

ID: 6855564
btw we do if possible want to keep using the COM.  We understand that IIS5 is better in terms of resource allocation with include files, but the COM contains a fair bit of functionality and we don't have the time right now to convert the site.
LVL 18

Expert Comment

ID: 6855655
Well, since you are not on windows 2000, I'd recommend that you turn your COM object into a COM+ object.  It will then run out of the process of the web server, so, even if your COM object crashes, it won't take down the webserver.  I think that you had an option with MTS to run a COM out of process, but that might have only been for Active-X EXEs....  no such limitation under COM+
LVL 18

Expert Comment

ID: 6855661
read that as "since you are NOW on windows 2000"
Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.


Author Comment

ID: 6855710
Thanks.  How do we build/turn the COM object into a COM+

Expert Comment

ID: 6857281

mdougan is correct.  Make your object a COM+ app, and you will find it much more stable anyway.  You don't have to rebuild the object, just set up a com+ app that points to it.  

To do so, you need to use "Componenet Services" of Windows 2000.  You can find this on Start->Settings->Control Panel->Component Services.  

Here are the steps you need to take:

1) Unregister your component:  At the command prompt, type
     regsvr32 /u c:\the_path_here\file_name.dll

   Also a good idea is to run iisreset at this point.

2) Open Component Services, and navigate to:
     /Component Services/Computers/My Computer/COM+ Applications

3) Right click on COM+ Applications, and select "New Application" to open the wizard.

4) Click "Create an empty application", Select the type of process activation you want, give the application a user to run as.  (Note that if you specify a user, and have a password change policy, when the password is changed this will fail to authenticate.)

5) Navigate to the empty COM+ application, then down to its Components.  Right Click on "Components" and select "New Component" to start yet another wizard.

6) Select your components in the wizard.  This will register the COM object with the system.  Complete the wizard.

7) Go back to the COM+ application level, right click on your application, and select "Start".

That should do it for you.

Test this on your staging machine before you do it on production.

Good luck,
LVL 18

Expert Comment

ID: 6858863
Well, that might be true.  It depends on what your component does.  You have to make sure that it is set up to run under MTS Transactions.  Either UsesTransactions or RequiresTransactions if you're updating a database.  Your methods should either call GetObjectContext.SetComplete or GetObjectContext.SetAbort (one of them must be called if you've specified uses or requires transactions).

You'll want to make sure that you instantiate the object using CreateObject and not Dim x as New MyObject.  And, if you create any other COM objects inside of this COM object, then you'll need to use:

Dim oClients as MyClass.MyClient

Set oClients = GetObjectContext.CreateInstance("MyClass.MyClient")

So that any transactions that occur in oClients gets wrapped in the transaction for the original COM+ object that you're calling.

Microsoft has some good white papers on Programming Guidelines for Visual Basic COM+ Applications
LVL 18

Expert Comment

ID: 6887042
Has your original question been answered?

Author Comment

ID: 6888168
No, not really.  We've installed the COM as a COM+ but the servers still going down. Now, it could be something else or it could be the COM (when we ran the site in a non-com version it worked OK) as soon as we put the com on it became unstable and unpredictable.

The COM was designed and developed under NT.  We don't have that much expertise in VB here, hence the question.  What should the build configurations really be for the dll?  Maybe we've been doing something wrong right from the start...
LVL 18

Accepted Solution

mdougan earned 400 total points
ID: 6890939
Well, that could be.  The first question I'd have for you is how are you creating an instance of your COM+ object?  If you are using New as in Dim x as New MyObject, then even if you have this object loaded into a COM+ application, you'll be using COM and not COM+ to load it.  You'll need to ensure that you are using CreateObject instead.  There is another thread where I've gone into detail about various pieces of syntax in switching a COM object to a COM+ object, and rather than pasting all of that text here, I'll just give you the link:


There is also a link on one of the comments there about a document called complus from microsoft.  You should download this document and read through it.  I followed the recommendations closely and had great success.
LVL 49

Expert Comment

ID: 7618177
Hi martinbw,
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:

    Accept mdougan's comment(s) as an answer.

martinbw, 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: 7645638
We resolved this by removing a call to another COM object within our own COM object.  This was causing the problem.  So none of the answers really resolved it for us.  Can we close it and give 50 points to mdougan (for the effort and suggestions) and refund 50 to my account.


Featured Post

Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

Question has a verified solution.

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

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…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
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…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Suggested Courses

636 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