IIS question

I have an IIS application that worked fine for months.  Recently, the server it was on crashed and I attempted to restore the program from backup source code on another server.  I made some changes to the code and everything worked fine before compiling.  After compilation, the program broke with an error saying that ActiveX could not create an object (a .dll called from the IIS app).  I unregistered all the components, rebooted, and attempted to find the error(s) in the code but nothing happens when I press F5 (not even errors).  I tried placing message boxes in the WebClass Start, Terminate, and FatalErrorResponse events but they never appear.  I know that compiled IIS apps do not necessarily behave as they do in the IDE but I'm not even sure where to begin debugging this.  If it helps, IIS otherwise seems to be running well and I can create and run other IIS apps in the IDE.  Long story short, I need help in debugging; even the most general hints might help.  
Mphi1Asked:
Who is Participating?
 
lochianoConnect With a Mentor Commented:
The local recompile of the dll should make the local PC OK without  the RevSvr32 program running but you will need that command for the server when you get to that point.
0
 
Mphi1Author Commented:
Adjusted points from 300 to 500
0
 
lochianoCommented:
It sounds like you just need to recompile all the code, with binary compatibility turned on,  in order and it will start to work again.



Have you read this article?  


http://msdn.microsoft.com/library/periodic/period00/versioning.htm
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
setiawanCommented:
Hi Mphi1,

Check your dll/ocx compability.
note : VB5 without SP different with VB5 with SP3 for example.

  regards

   danny
0
 
ArkCommented:
Hi
Try regsvr32 with your dll which fire the error.
Cheers
0
 
jimvanoverCommented:
The IIS application will probably need to be rebuilt.  

When you recompiled the DLL, a new ClassID was probably generated, it sounds like... you can get the classID from the registry, by looking up the DLL with RegEdit...  Check the reference in the IIS App... if the ClassID's don't match, the call to the DLL will fail with a message like:

"Can't Create ActiveX Object"

The Binary Compatibility comment is right on... you will have less problems, as the ClassID will not be updated, unless the interface has changed, which may or may not have saved you the grief you have now...

Hope that helps!
Jim
0
 
Mphi1Author Commented:
I think lochiano and jimvanover are right.  Binary compatibility was turned off (no compatibility was selected).  Now that I see the error of my ways, how can I rebuild the project?  Do I need to start a new project and copy over all relevant code?  I tried to recompile selecting binary compatibility and I found the same problem (IE5 starts with an empty screen).  Also, how do I find the .dll in RegEdit?  I tried to find it myself and used the "Find" option in RegEdit without success.  Obviously I'm new to the .dll world and will read the white paper that lochiano referenced.  Thanks for your help.
0
 
lochianoCommented:
Assuming that you can locate the source code for the DLL(s) in question as well as the programs that use it then you would.

1)  close all VB except for one
2)  open DLL project
3)  check compatability options
4)  make DLL to your system(32) directory
5)  when all of the DLL are made then open program
6)  make program

If the DLL in question is not one that you have source code to, such as something that came from Microsoft, then reloading a service pack normally takes care of the issue.



Finding the DLL in the class, it is in there several time is a string search for the DLL file name.  The DLL is added to the Reg file via a call to REGSVR32 command on the command line.  If you type the command by it self then the options are listed but normally it is REGSVR32 {DLL file name}

If you have the program be sure to run OLEVIEW.  It is a lot easer then digging around the Reg files.
0
 
jimvanoverCommented:
You can search for the Class Name that's in the DLL... it should find it...

The ClassID is already changed in the project... with the compatibility mode now set, this should be less of a problem, but first, we have to recognize the new DLL's ClassID.

In the application portion, check 'references'... you will probably have to "un-reference" the DLL, then set the reference again... that ought to get the new ClassID in your project.

Ark's suggestion is also something to look at... you may have to re-register your DLL if you haven't yet... This is done using RegSvr32, and it's fairly simple...

First, unregister to older dll...
RegSvr32 myDLLName.DLL /u

Then, register the newer dll...
RegSvr32 myDLLName.DLL

This can be done from the DOS prompt, or the Run dialog (Windows Key, and "R").  If it cannot find it, check your Visual Studio install CD's... it'll be on there somewhere.  Normally, its found in C:\Windows\System...


Jim
0
 
jimvanoverCommented:
Actually, I think the unregister command line is backwards...  I'm not sure if the order I put in my last comment works...

Regsvr32 [/u] [/s] <OCX File Name>

/u - Unregister
/s - Silent (no messages displayed)

Jim
0
 
Mphi1Author Commented:
Before posting my question, I had already tried unregistering and re-registering the project.  I just tried this again with the only difference being that binary compatibility was checked.  The local copy is still not working.  Is this problem more specific to IIS?  Let me give more detail in case it helps.  

The original program that worked fine in tests created an instance of a .dll I had written and was a .dll itself (being an IIS project).  I compiled both .dll's.  I then opened IE5, selected the URL for the IIS project and it loaded fine.  When the project got to the point of creating the other .dll, it gave a "create" error.  I unregistered both components from the command line then opened the source for the IIS project to begin debugging.  But now I couldn't even test the source because IE5 opens with a blank window and no errors when I press F5.    

Note that in IIS apps, when you compile the project, it makes both a project .dll and a Webclass.asp.  I tried to unregister the webclass but regsvr32 failed to do this.

Am I totally misunderstanding what you're telling me to do?  I can successfully register and unregister these components.  I see that the problem might have come about b/c I didn't have binary compatibility checked but I can't even get back to testing the IIS project let alone the .dll it's supposed to call.  Thank you both again for your patience and help.
0
 
Mphi1Author Commented:
I'm thinking that this might have to do with problems in IIS or VB.  I tried to create a new test IIS project and it works fine until being compiled.  When I made it, it didn't say that a "virtual root" with the same name as the project would be created like has happened on other computers.   When I open IIS MMC, the project name isn't found under "Default Web Site" as it should be.  Thus, when I typed in the URL where I should have found the project, nothing appeared.  Could IIS need to be reinstalled?  
0
 
Mphi1Author Commented:
In case points are an issue, I will distribute up to 1000 based on the help I receive.  Both lochiano and jimvanover have been helpful and you will both already receive points (if one can split up points).
0
 
lochianoCommented:
It is sounding more like you might benefit from reloading the current service packs for IE,  VB, IIS, etc.

Also I assume that you are careful to make sure that you do not have two DLL with the same name in different places.


0
 
Mphi1Author Commented:
lochiano and jimvanover gave detailed and quick answers that helped me find the error in my program.
0
 
Mphi1Author Commented:
It looks like my last posting wasn't posted.  I have regained the ability to run the program after I commented out a reference to the bad .dll in the declarations section of the IIS app.  I'll read the white paper before doing anything else.

jimvanover, just answer the question I've posted titled "IIS question 2" to claim your points.

Thank you both again.
0
All Courses

From novice to tech pro — start learning today.