Create a COM module for a VO application using XIDE

begin namespace COMTest
 
using System.Runtime.InteropServices
 
[ComVisible(true)];
[Guid("750E557E-9DA6-4508-A36E-C4141D27B5D4")];
[InterfaceType(ComInterfaceType.InterfaceIsIDispatch)];
interface ICOMTester
 
[DispId(1)];
method Output() as string
 
end interface          
 
end namespace

The GUID needs to be created with the GuidGen.exe tool.

using System.Runtime.InteropServices
 
begin namespace COMTest
 
[ComVisible(true)];
[Guid("7D1DF22E-3A3D-431C-8BEE-A2F40C53A249")];
[ClassInterface(ClassInterfaceType.None)];
[ProgId("COMTest.COMTester")];
class COMTester implements ICOMTester
 
public constructor()
 
	return
 
public virtual method Output() as string
 
	return "Hi from my component"
 
end class	
 
end namespace
METHOD Init(ObjID, fROTCHECK) CLASS ICOMTester
 
self:cProgID := "COMTest.COMTester"
self:cClsID := "{7D1DF22E-3A3D-431C-8BEE-A2F40C53A249}" 
self:cIID := "{750E557E-9DA6-4508-A36E-C4141D27B5D4}"
SUPER:Init(ObjID, 0, .T., fRotCheck)
SELF:_dwFuncs := 1
SELF:_dwVars := 0
 
RETURN SELF
#define RC_RT_MANIFEST 24
#define CREATEPROCESS_MANIFEST_RESOURCE_ID 1
CREATEPROCESS_MANIFEST_RESOURCE_ID RC_RT_MANIFEST "COMTest.dll.manifest"
  <dependency>
  	<dependentAssembly>
  		<assemblyIdentity
  			type="win32"
  			name="COMTest"
  			version="1.0.0.0"
  			publicKeyToken="ff428fdf619029ef"
  			>
  		</assemblyIdentity>
  	</dependentAssembly>
  </dependency>

using the public key token you created with “sn -T”. Pleasy pay attention that the version information must be exactly the same between your manifests and the COM DLL! And to be sure that an export of your application takes care of the .snk file and the manifest file, you should add them to your project.

Possible problems:

sxstrace Trace -logfile:systrace.out
sxstrace Parse -logfile:systrace.out -outfile:sxstrace.txt
notepad sxstrace.txt