1
votes

Having a lot of problems trying to get a .NET component running on an NT4 machine. Framework 1.1 is installed and the component is compiled under the same framework.

The component is a proxy for a web service which is called by a VB6 application. Unfortunately the VB6 application cannot create an instance of the component and reports the following error message 'ActiveX component can't create object'.

I wrote a simple .NET console test application which creates an instance of the proxy and calls GetStockQty. In this case everything works, the call is successful and the web service returns a valid quantity.

The signed proxy component has the following COM attributes:

[ComVisible(true)]
[Guid("D1576FA8-F3B1-4fa2-8018-677F6E483564")]
public interface IDataFeedProxy
{
    [DispId(1)]
    bool GetStockQty(string sku, out int quantity);
}

[ComVisible(true)]
[Guid("161A22E8-17C4-43f4-96A0-05FC439C7609"),
ClassInterface(ClassInterfaceType.None),
ComSourceInterfaces(typeof(IEvents))]
public class DataFeedProxy : IDataFeedProxy

It has been registered on the NT4 machine using the following:

regasm /codebase DataFeedWebService.dll /TLB

This works fine on an XP machine, Im only having these problems on the NT4 one. Its obviously COM related but Im at a loss as to what it could be.


Edit

This is how its done in the VB6 code:

Dim oProxy As DataFeedWebService.DataFeedProxy
Set oProxy = New DataFeedWebService.DataFeedProxy
bRet = oProxy.GetStockQty(sPluCode, lQuantity)
Set oProxy = Nothing

Ive also tried removing the reference from the VB6 project and creating it late bound with the same result.

Dim oProxy As Object
Set oProxy = CreateObject("DataFeedWebService.DataFeedProxy")
1
probably should consider moving to supported OS, there are many security holes in the old NT4, which is unsupported as of 30 June 2004 for Windows NT 4.0 Workstation and 31 December 2004 for Windows NT 4.0 ServerKris Ivanov
Agreed, but the customer still has a large number of NT4 machines in their estate.Andrew
How are you calling the .Net proxy in VB6? Please post the VB6 code.Polyfun
Also, use the Assembly Binding Log Viewer to see if your assembly is failing to load because of missing dependencies etc.Polyfun
It is actually working though when called from the .NET console app, its only the VB6 application that cant instantiate it.Andrew

1 Answers

0
votes

are you sure that a .net component will run on windows nt4.0. I do remember that it was possible but there were a lot of operations that were not supportted.