[英]Implementing Active Directory with C++ Builder
We want to implement Active Directory using C++ Builder (10.2 Tokyo). 我们想使用C ++ Builder(东京10.2版)实现Active Directory。 I've managed to download the SDK from Microsoft and even used C++ Builder's implib/coff2omf utilities to convert the .Lib files to work with C++ Builder. 我已经设法从Microsoft下载了SDK,甚至使用C ++ Builder的implib / coff2omf实用程序将.Lib文件转换为可与C ++ Builder一起使用。
I've found some sample code from the Microsoft docs , but now its trying to use a CComBSTR function from Microsoft. 我已经从Microsoft 文档中找到了一些示例代码,但是现在它试图使用Microsoft的CComBSTR函数。 As I'm going through this the more I am doubting this is the correct way. 我正在经历的过程中,我越来越怀疑这是正确的方法。 Regardless, here's the line: 无论如何,这是一行:
hr = pCont->Create(CComBSTR("user"), CComBSTR("cn=jeffsmith"), &pDisp );
Is there a better way to approach this? 有没有更好的方法来解决这个问题?
CComBSTR
is a smart wrapper class in the ATL framework for a COM BSTR
string. CComBSTR
是ATL框架中COM BSTR
字符串的智能包装器类。 C++Builder officially dropped support for ATL in XE (but you can still use it ). C ++ Builder在XE中正式放弃了对ATL的支持(但是您仍然可以使用它 )。
C++Builder's RTL has its own smart wrappers for BSTR
( WideString
and TOleString
), for example: C ++ Builder的RTL具有自己的BSTR
智能包装器( WideString
和TOleString
),例如:
hr = pCont->Create(WideString("user").c_bstr(), WideString("cn=jeffsmith").c_bstr(), &pDisp );
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.