U
urkec
I am testing COM interop (.Net server - COM client). This is a very simple
class I made COM visible:
using System;
using System.Runtime.InteropServices;
namespace COMTest
{
//[GuidAttribute("63745640-F8C1-405c-9206-BBAD3297D05B")]
interface ICOMTest
{
string MachineName
{
get;
}
}
//[GuidAttribute("CCFC70BE-D23E-4988-8F61-E59AF55971E4")]
public class COMTest: ICOMTest
{
public COMTest()
{
}
public string MachineName
{
get { return System.Environment.MachineName; }
}
}
}
I got it to work both with and without explicitly assigned GUIDs. When I
left the GuidAttribute part out, my class still got automatically assigned a
GUID. My question is, when do I want to explicitly assign a GUID to a COM
visible class, and when do I leave it to regasm.exe?
--
urkec
My blog:
http://theadminblog.blogspot.com/
My CodeProject articles:
http://www.codeproject.com/script/Articles/MemberArticles.aspx?amid=4210975
class I made COM visible:
using System;
using System.Runtime.InteropServices;
namespace COMTest
{
//[GuidAttribute("63745640-F8C1-405c-9206-BBAD3297D05B")]
interface ICOMTest
{
string MachineName
{
get;
}
}
//[GuidAttribute("CCFC70BE-D23E-4988-8F61-E59AF55971E4")]
public class COMTest: ICOMTest
{
public COMTest()
{
}
public string MachineName
{
get { return System.Environment.MachineName; }
}
}
}
I got it to work both with and without explicitly assigned GUIDs. When I
left the GuidAttribute part out, my class still got automatically assigned a
GUID. My question is, when do I want to explicitly assign a GUID to a COM
visible class, and when do I leave it to regasm.exe?
--
urkec
My blog:
http://theadminblog.blogspot.com/
My CodeProject articles:
http://www.codeproject.com/script/Articles/MemberArticles.aspx?amid=4210975