托管代码是在c ++中使用SMO的唯一方法吗?

时间:2022-09-01 11:35:39

I have to work with SQLSERVER SMO in C++. Is Managed code is the only way to work with SQLSERVER SMO in C++ ?

我必须在C ++中使用SQLSERVER SMO。托管代码是在C ++中使用SQLSERVER SMO的唯一方法吗?

I have tried many ways.. but I found that using managed code is the only option. Are there other ways?

我尝试了很多方法..但我发现使用托管代码是唯一的选择。还有其他方法吗?

1 个解决方案

#1


Technically, you can expose .NET assemblies to standard COM infrastructure, but that requires changes to the source code (see this). You may try and create a COM-aware wrappers around standard SMO objects and then use them as regular COM classes in C++.

从技术上讲,您可以将.NET程序集暴露给标准COM基础结构,但这需要更改源代码(请参阅此内容)。您可以尝试围绕标准SMO对象创建一个支持COM的包装器,然后将它们用作C ++中的常规COM类。

#1


Technically, you can expose .NET assemblies to standard COM infrastructure, but that requires changes to the source code (see this). You may try and create a COM-aware wrappers around standard SMO objects and then use them as regular COM classes in C++.

从技术上讲,您可以将.NET程序集暴露给标准COM基础结构,但这需要更改源代码(请参阅此内容)。您可以尝试围绕标准SMO对象创建一个支持COM的包装器,然后将它们用作C ++中的常规COM类。