I got stuck in an issue and had googled a lot regarding it but got no relevant help.
I am upgrading a legacy ASP Classic code to ASP.NET. The old code uses a COM dll coded in c++(I have no knowledge of c++). Most of the methods are straightforward and easily accessible through Interop except one method:
.....
[DispId(76)]
int GetPagesToStream(object pResponse, int nPage,......
This method looks for a parameter of the type object and in code this pResponse object is used as:
ASPResponse oResponse((IResponse*)pResponse);
Here ASPResponse is struct defined in c++ code.
If I tries to pass a simple object from .NET then the following exception is thrown:
An unhandled exception of type 'System.Runtime.InteropServices.COMException' occurred in mscorlib.dll
Additional information: Type mismatch. (Exception from HRESULT: 0x80020005 (DISP_E_TYPEMISMATCH))
The old ASP code calls the same method by passing the ASP Page Response as the first argument which I can't pass from .net.
In the old code this method actually writes the PDF content to the page response using the Response.Write(). It seems to be the dll code is very tightly coupled with ASP due to which I am not able to pass any object from my code to get the data and got stuck very badly.
Any help is highly appreciable. Thanks in advance :).
User contributions licensed under CC BY-SA 3.0