I'm wondering how I can create a Com-Object from my own C# DLL.
I made the following Class in C#:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.InteropServices;
namespace ProgressNet
{
[Guid("a9b1e34d-3ea3-4e91-a77a-5bcb25875485")]
[ClassInterface(ClassInterfaceType.AutoDual)]
[ComVisible(true)]
[ProgId("ProgressNet.Server")]
public class NetServer
{
public NetServer() {}
[DispId(1)]
public string GetString()
{
return "Some String";
}
}
}
In Properties I checked Register for COM Interop.
Then I registered the DLL with regasm.
regasm G:\ProgressTestApp\ProgressNet.dll /tlb:G:\ProgressTestApp\ProgressNet.tlb /codebase
Then I tried in Progress 4GL this Code:
DEFINE VARIABLE NetServer AS COM-HANDLE.
CREATE "ProgressNet.NetServer" NetServer.
MESSAGE NetServer:GetString().
But then I get "The automation server for ProgressNet.NetServer is not registered properly"..
Any Suggestions? :)