Solved

IIS question

Posted on 2000-05-10
16
317 Views
Last Modified: 2008-03-17
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.  
0
Comment
Question by:Mphi1
  • 7
  • 4
  • 3
  • +2
16 Comments
 

Author Comment

by:Mphi1
ID: 2797747
Adjusted points from 300 to 500
0
 
LVL 1

Expert Comment

by:lochiano
ID: 2797857
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
 
LVL 6

Expert Comment

by:setiawan
ID: 2798677
Hi Mphi1,

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

  regards

   danny
0
 
LVL 27

Expert Comment

by:Ark
ID: 2798857
Hi
Try regsvr32 with your dll which fire the error.
Cheers
0
 
LVL 1

Expert Comment

by:jimvanover
ID: 2798977
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
 

Author Comment

by:Mphi1
ID: 2800248
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
 
LVL 1

Expert Comment

by:lochiano
ID: 2800395
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
 
LVL 1

Expert Comment

by:jimvanover
ID: 2800423
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
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 
LVL 1

Expert Comment

by:jimvanover
ID: 2800452
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
 
LVL 1

Accepted Solution

by:
lochiano earned 500 total points
ID: 2800591
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
 

Author Comment

by:Mphi1
ID: 2800716
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
 

Author Comment

by:Mphi1
ID: 2800886
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
 

Author Comment

by:Mphi1
ID: 2800901
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
 
LVL 1

Expert Comment

by:lochiano
ID: 2801012
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
 

Author Comment

by:Mphi1
ID: 2801014
lochiano and jimvanover gave detailed and quick answers that helped me find the error in my program.
0
 

Author Comment

by:Mphi1
ID: 2801097
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

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
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…
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…
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…

757 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now