且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

C# - 很好的暴露Nullable< T>到COM

更新时间:2023-11-06 10:17:58

在COM端使用Variant(VT_DATE)如果你声明的成员作为对象,你应该能够传递一个DateTime或null和COM互操作应该处理它确定。有关详细信息,请参阅MSDN上的以下内容。

What about using a Variant (VT_DATE) on the COM side? If you declare the member as object, you should be able to pass a DateTime or null and COM interop should handle it ok. See the following on MSDN for more details.

将对象转换为变体