如何在自定义 API 上使用此函数
How to use this Function on a custom API
我在使用API时遇到了问题,该API的功能是发送邮件,但问题是邮件的正文正在使用LPCVOID,我不知道如何使用它。我有谷歌搜索,没有关于如何使用它的明确解释。
这是整个函数:
IMTMail::Body(LPCVOID body,const UINT body_size)
参数:
body [in] A pointer to the email body
body_size [in] The size of the body in bytes
我希望你能启发我,如果你有例子,我将不胜感激。
正如评论中已经提到的LPCVOID
是 const void *
的类型定义。因此,您可以将任何指针传递给该函数。以下是示例:
std::string body("Test Email Body!!!!!!!");
mail.Body( body.c_str(), body.size() ); //assume type of mail is IMTMail
与std::wstring
std::wstring body(L"Test Email Body!!!!!!!");
mail.Body( body.c_str(), body.size() ); //assume type of mail is IMTMail
相关文章:
- 为 NewObjectA() 函数创建 jvalues 的参数数组时出错 - JNI Invocation API
- 节点插件 API 将数组作为函数参数传递
- 为什么我在 Windows API 中得到对 TextOut() 函数的未定义引用?
- 调用 Win32 API 函数时未定义的引用
- 谁拥有作为指向 Windows API 函数的指针传递的值?
- 使用 Node.js N-API 调用 C 函数时,不会显示预期的输出
- 如何创建面向C++函数的C API
- 将uint8_t*buffer和size_tbufferlen从C++传递到C中的API函数的最佳方式是什么
- 在类中设置 PubSubClient API 的回调函数
- 使用宏替换工厂模式样式 API 中的"create()"函数
- 是否有一个Windows驱动程序函数可以执行Windows文件api SeFileAttributes的等效功能
- Lua C API 自定义打印函数,在字符串中传递空格时不调用
- 在 MySQL 连接器C++ API 中使用一个函数调用执行多个查询的正确方法是什么?
- 如何仅使用 c/python API 将 c++ 成员函数绑定到 python?
- 是否有任何 C 函数或 API 来获取当前登录用户下运行的进程列表
- 包装 C API 通过C++接受迭代器的函数获取原始指针
- 在Xcode(mac api)上,是否有任何带有Sleep()函数/命令的文件?
- 构造函数中发生异常时如何释放 API 使用的资源
- 如何将CString转换为使用WCHAR的Windows API和自定义函数?
- Win32 C API:替代损坏的execl*()系列函数?