Click here to Skip to main content
15,886,199 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am writing a middleware library in .Net which will be invoking Web services and respond back to VB6 legacy applications with the service output.
So far I have made the assembly as ComVisible without generating strong-name for it.
The .Net dll will be used to generate a type library (.tlb) which can be added in Project References of the VB6 application and used to invoke the services.

Using regasm tool, the TLB file is generated fine and registered to the local registry.
I first registered the TLB from local system drive and everything worked fine.

Now the system constraint is that, the assembly and type library cannot be stored in end-user machines.
So I need to map to a network drive and register the TLB from there.
The regasm tool registers it from network drove also, but the VB6 application is not able to access the classes in .Net
Command used: WINDIR%\Microsoft.Net\Framework\v2.0.50727\regasm <dllname> /tlb /codebase <network folder path>


Whenever i try to create new object, it is throwing error '430-Automation error. Class does not support the expected interface'.

So I want to know how to resolve this issue?
Posted
Updated 3-Oct-13 23:27pm
v2
Comments
G3Coder 4-Oct-13 8:21am    
Hi,

Can you let us see how you have defined the interface in the middleware; and have you tried to register it on the local machine and run it from there as a test?
Sampath Sridhar 5-Oct-13 2:22am    
Yes, I have registered the TLB from local system drive and it worked fine.
Here is a part of the COM interface. All namespaces and classes not mentioned here.
In the below code, RecordUserService is exposed to VB6 through the interface.


// COM Interface specification
[Guid("D6F88E95-8A27-4ae6-B6DE-0542A0FC7039")]
[InterfaceType(ComInterfaceType.InterfaceIsIDispatch)]
public interface RecordUser
{
[DispId=1]
string callService(int userId);

[DispId=2]
string DBConfigPath;
}

[Guid("13FE32AD-4BF8-495f-AB4D-6C61BD463EA4")]
[ClassInterface(ClassInterfaceType.None)]
public class RecordUserService: RecordUser
{
public RecordUserService() {}
public string callService(int userId)
{
// Create WCF service client and invoke webservice method.
// Return "Success" if service is executed fine and "Error" in case of errors.
}
public string DBConfigPath
{
get
{
// Get private variable for db connection
}
set
{
// Set private variable for db connection
}
}

// Private methods internal to the middleware interface
private void initRequest()
{
// Initialize Web service request
}
private void sendRequest()
{
// Invoke web method and get back the response
}
}

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900