C++??C#??以????t??????
???????????? ???????[ 2014/1/23 9:28:24 ] ????????C++ C#
???????????????????????????????????y??(??????????)???????DLL??????????DLL?У??????????????????????????????????????????????????????????????????????????鶼??д????????????д??????????????????????????????????????????????????Щ?????C++????????????????????????????????.NET????????????????????????????
???????????C++?????DLL???????????
??????????????WIN7 64BIT+VS2010+MFC+ATL+COM??
????.NET??????????C#??????????????????£?????????Щ??????????????
?????????????????
????1. ??????? ?????????
????COM????????(????????????????????)??????????????????????????????????????????????????????.NET??????????VB.NET??????????????????н??п????
????????.NET?μ????(DLL)????????WIN DLL ????????????й??????????Щ?????????????????????COM??????????????COM??????????????????????????C++?????????????????????á?
?????????????????????????????????????????????????????????????????????
?????????COM?????塣
[ComVisible(true)??
Guid("B86D71F4-FE07-4B60-8246-F5AE283ED2A3")??
InterfaceType(ComInterfaceType.InterfaceIsDual)
]
public interface IHMI
{
[PreserveSig?? DispId(1)]
void OnCreate(int a);
[PreserveSig?? DispId(2)]
void SetRect(int left?? int top?? int width?? int height);
//??????????
}
[ ComVisible(true)??
ClassInterface(ClassInterfaceType.AutoDual)??
ProgId("xxxxxxx.xxxxxxx") //ProgId ?????????????????????????
]
????C#?????????в????????????????????
public class CustomCOMClient : IHMI
{
public CustomCOMClient()
{
}
[DispId(1)]
public void OnCreate(int a)
{
//???
}
[DispId(2)]
public void SetRect(int left?? int top?? int width?? int height)
{
//???
}
}
??????
![](/images/ad-banner/ad-banner.png)
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11