RE: VC++ Class Library and Implenting COM Interfaces??
From: Peter Huang (v-phuang_at_online.microsoft.com)
Date: 12/01/04
- Next message: Juan Ignacio Gelos: "Re: MprAdminInterfaceEnum"
- Previous message: Christian Correa: "Performance decrease after migration to .NET"
- In reply to: Brian R.: "VC++ Class Library and Implenting COM Interfaces??"
- Next in thread: Brian R.: "RE: VC++ Class Library and Implenting COM Interfaces??"
- Reply: Brian R.: "RE: VC++ Class Library and Implenting COM Interfaces??"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 01 Dec 2004 06:01:00 GMT
Hi
Based on my understanding, you wants to expose the .NET class to the COM
interface, if I have any misunderstanding, please feel free to let me know.
In MC++, we can do the job below to expose the IMyInterface to the COM
client, after built we need to use the regasm to generate the tlb file for
com client to use.
using namespace System;
using namespace System::Windows::Forms;
using namespace System::Runtime::InteropServices;
namespace MCPP
{
[InterfaceTypeAttribute(ComInterfaceType::InterfaceIsDual)]
public __gc __interface IMyInterface
{
void HelloWorld();
};
[ClassInterface(ClassInterfaceType::None)]
public __gc class MyClass : public IMyInterface
{
public:
void HelloWorld()
{
Form* fm = new Form();
fm->Show();
}
};
}
Here are two links you may take a look.
http://groups.google.com/groups?hl=zh-CN&lr=&c2coff=1&threadm=mTfn46d2CHA.18
76%40cpmsftngxa06&rnum=2&prev=/groups%3Fhl%3Dzh-CN%26lr%3D%26c2coff%3D1%26q%
3Dimplement%2Binterface%2Bmc%252B%252B
http://groups.google.com/groups?hl=zh-CN&lr=&c2coff=1&threadm=a5ebf44c.02123
01430.42609045%40posting.google.com&rnum=5&prev=/groups%3Fhl%3Dzh-CN%26lr%3D
%26c2coff%3D1%26q%3Dimplement%2Binterface%2Bmc%252B%252B
Although the MC++ IDE did not did all the job as C# do, but we still can do
the similar job with C#.
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.
- Next message: Juan Ignacio Gelos: "Re: MprAdminInterfaceEnum"
- Previous message: Christian Correa: "Performance decrease after migration to .NET"
- In reply to: Brian R.: "VC++ Class Library and Implenting COM Interfaces??"
- Next in thread: Brian R.: "RE: VC++ Class Library and Implenting COM Interfaces??"
- Reply: Brian R.: "RE: VC++ Class Library and Implenting COM Interfaces??"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|