RE: Creating a COM interop using VS.NET 2005?
- From: v-phuang@xxxxxxxxxxxxxxxxxxxx ("Peter Huang" [MSFT])
- Date: Mon, 26 Dec 2005 07:26:18 GMT
Hi
By default ComVisible() = false,
Please try to code below.
using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.InteropServices;
namespace COMTest3
{
[Guid("EAA4976A-45C3-4BC5-BC0B-E474F4C3C83F"),
InterfaceType(ComInterfaceType.InterfaceIsIDispatch),ComVisible(true)]
public interface ComNameITInterface
{
[DispId(1)]
string GetMyName();
}
[Guid("7BD20046-DF8C-44A6-8F6B-687FAA26FA71"),
InterfaceType(ComInterfaceType.InterfaceIsIDispatch),ComVisible(true)]
public interface ComNameITEvents
{
}
[Guid("0D53A3E8-E51A-49C7-944E-E72A2064F938"),
ClassInterface(ClassInterfaceType.None),
ComSourceInterfaces(typeof(ComNameITEvents)),ComVisible(true)]
public class NameIT : ComNameITInterface
{
public string GetMyName()
{
return "ABCDEF";
}
}
}
Best regards,
Peter Huang
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
.
- Follow-Ups:
- RE: Creating a COM interop using VS.NET 2005?
- From: "Peter Huang" [MSFT]
- RE: Creating a COM interop using VS.NET 2005?
- Prev by Date: Re: killing a process from task manager does not fire console CTRL_CLOSE_EVENT
- Next by Date: Re: Design issue: Struct vs. Class
- Previous by thread: RE: Creating a COM interop using VS.NET 2005?
- Next by thread: RE: Creating a COM interop using VS.NET 2005?
- Index(es):