Sorry my bad the error is 0x80004005 which equates to Unspecified error. In
further testing we have created a completely new COM dll and new .NET object
put the most simplistic method that returns only a string. Once again the COM
object creates the .NET assembly calls the method and returns the value
properly to ASP on Windows XP but still fails on Vista. In further research
we thought maybe it might be due to the assembly not being strongly typed and
put in the GAC, so we strongly typed the assembly and then put it in the GAC
with the same result. Works on XP fails on XP. All assemblies were installed
on the Vista Machine with the "Real" Admin not the standard Administrator
that is default. This has not helped, we are now moving to another Vista
machine in case the one we are testing on is corrupt in some manner. To
replicate the issue create a simple COM dll in C++ using ATL add a Simple
Object interface and 1 method parameters and return values not important.
Create a .Net Assembly add a method that returns a value. In the C++ COM dll
use the #using "myassembly.dll" namespace myassembly; to import the assembly
then in your COM method create an instance of the .Net assembly and call the
method on the Assembly. Our sample looks like this:
#using <mscorlib.dll>
#include <vcclr.h>
using namespace System;
#using "MyTestobject.dll"
using namespace MyTestObject;
In my Method I use:
MyTestObject::ImaTesting^ objTest = gcnew MyTestObject::ImaTesting();
System::String^ myString = objTest->ReturnMoFO("This is a Test");
CString str = CString(myString);
*bstrResult = str.AllocSysString();
return S_OK;
My Method is defined as follows:
STDMETHODIMP CTestObject::CallMe(BSTR *bstrResult)
The .NET assembly has no more code than this:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace MyTestObject
{
public class ImaTesting
{
public string ReturnMeMoFO(string strvalue)
{
return "*****" + strvalue + "******";
}
}
}
Not much too it but still cannot get it to work on Vista we broke it down to
the most primary functionality with both objects with no success.
"SvenC" wrote:
Hi viperx1967,
The only exception that is thrown is from IIS 0x800101805 and this is
that is not a valid error code. 0x8001 should be followed by 4 digits
only. Could you please post the correct number.
Is it 0x80010108? That translates to "The object invoked has disconnected
from its clients.". For an inprocess COM object it typically tells you that
your object's code crashed..
You could use OutputDebugString in your C++ code and
System.Diagnostics.Debug.WriteLine in your managed code (remember
to build and use the debug configuration to get the Debug-Output working)
to see how far your object's code gets. Use DebugView to catch the output.
Run Debug View "As Admin" and enable Capture Global Win32 to get
output from the IIS processes.
You could attach the VS debugger to w3wp.exe as well and single step
your code. Make sure to run VS "As Admin" and attach with native and
managed debugging to debug both your native and managed code.
...we were able to narrow it down to the line where it creates
the managed object itself. And this only happens in Classic ASP on
Vista Only
You speak of running IIS on Vista and not of your browser running
on vista, correct?
In visual basic, visual C++ , Visual C# all execute the
code normally without issues. Other then that I am at a loss
It might be due to some parameter limitations in ASP which are basically
just VBScript files. So all your COM objects are used through IDispatch.
To simulate that you might want to check how your object behaves
when used in a vbs file. Just put your crashing code in a vbs file and
see if it can be executed there.
--
SvenC