Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Problem upgrading ISAPI Extension from VC++5.0 to VC++.NET

Posted on 2004-04-04
6
Medium Priority
?
354 Views
Last Modified: 2013-11-25
Hi Experts:

I have this app. that is running for almost 2 years now. It consists of an application server that is accessed by the ISAPI dll - both writen in C++ - on the server side. On the client side it has an Active/X control (.ocx) embedded in regular HTML that creates an http session with the isapi dll thru the IIS and communicates with it. This ocx is written in MFC based C++.

All this is in use on an NT4.0 server with IIS 4.0. Now I am upgrading it to Windows 2000 , IIS 5.0 and VC++.NET.

So far, all VC++5.0 modules install and run OK in the new server. The problem arises with the .NET version of the ISAPI Dll, which is compiled in the same server. I placed traces that write to the event viewer from each method of the isapi extension and found out that only the constructor and the GetExtensionVersion method are getting invoked, while the Default method is not. The funny thing is that when the same code is compiled using VC++5.0 on a win95 pc, everything works fine.

The following data refers to the environment I have on my lab to get this thing to work:

SERVER
------
Windows 2000 5.00.2195 - Service Pack 2
IIS 5.0
Visual C++.NET
  MS Development Environment 2002 Version 7.0.9500
  MS .NET Framework 1.0           Version 1.0.3705

CLIENT
------
Windows 98 Second Edition
IE 5.00


Regards

Julio
0
Comment
Question by:juliogonzalez
  • 3
  • 3
6 Comments
 
LVL 4

Expert Comment

by:YuriPutivsky
ID: 10761745
Check the dependeces of your new DLL. Probably the .Net code linked to your C++ code depends on the some new DLL(s) loaded dynamically at run-time and you didn't put it on IIS computer.
0
 

Author Comment

by:juliogonzalez
ID: 10766564
Hi Yuri,

There are 2 facts I´d like to mention now.
First is that I forgot to mention that just in order to prevent this kind of dependences problem, the DLL is linked to MFC as a static library. Second, the DLL is actually running (it is posting events to the event viewer from 2 methods) but the "Default" method does not receive control at any time.
This means to me that when the first request for the dll comes from the client, the IIS loads and instantiates the dll (which in turn posts the trace events from the methods mentioned) and then the IIS fails to locate the entry point for the "Default" method, and nothing more happens with the dll, until the IIS is restarted. At this time, the IIS terminates the dll, what I can see in the event viewer by an event posted by the dll destructor method.
When I found out that just one method was not being invoked, I tried to fix it in the .def file wher the wizard didn´t include default as an export. First the linker failed because it found redundancies with the name "default" and asked for a decorated name. Then I got this decorated name (without fully understandig the rules of decoration) using the dumpbin utility and put it in the .def, forcing the linker to success.
But the results were the same, whether omitted or included decorated in the .def, the default method is not getting invoked.

Should I try using MFC as a DLL? What is a decorated name? Why do I get duplicates when I put Default(undecorated) in the .def?

Thanks for your comments, and looking forward for further comments.

Julio
0
 
LVL 4

Expert Comment

by:YuriPutivsky
ID: 10767267
IIS invokes GetExtensionVersion when it loads DLL first time then only HttpExtensionProc. Even you defined in *.def file "Default" method it doesn't change anything. Check if HttpExtensionProc in *.def file. And if yes add some traces up to Default method call walking though the code.
0
 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

 

Author Comment

by:juliogonzalez
ID: 10768525
HttpExtensionProc is in *.def file already. Default method is starting with a trace, this is how I notice it´s not being invoked.
0
 
LVL 4

Accepted Solution

by:
YuriPutivsky earned 2000 total points
ID: 10768744
You can trace it. Put trace staements starting from HttpExtensionProc. Or even better you can do it under debug and see what's going on exactly.
0
 

Author Comment

by:juliogonzalez
ID: 10770913
Hi Yuri,

There was no HttpExtensionProc override in the original code, the wizard didn´t put it either and it was needed never before. So I added it by hand just to place a trace as you suggested and .... voila !! Now everything works fine. It looks like, for some reason, the new compiler requires this override to be coded by hand in the dll extension.
Thank you very much for your help. The 500 points and the grade are yours, but it is much more what you deserve.

Julio
0

Featured Post

[Webinar] Cloud Security

In this webinar you will learn:

-Why existing firewall and DMZ architectures are not suited for securing cloud applications
-How to make your enterprise “Cloud Ready”, and fix your aging DMZ architecture
-How to transform your enterprise and become a Cloud Enabler

Question has a verified solution.

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

Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.

963 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