I've created a string buffer in VB and then call a c++ MFC dll with an external function as follows. I pass the buffer through by reference. Then...
What I'm not sure about is how declare it as a parameter to the function and populate it with a value from a CString variable.
The code below doesn't work but hopefully gives you an idea of where I'm heading. It's kind of like a API. Also the return value must non-unicode.
Any suggestions will be greatly appreciated.
int __declspec(dllexport) __stdcall ReadXML(CString &MtBuffer, int length, BSTR xmlFilePath, BSTR xmlNode)
CString str_xmlFilePath = BSTR2CString(xmlFilePath);
CString str_xmlNode = BSTR2CString(xmlNode);
m_xml_value = _T("");
inXml.read(str_xmlNode, _label, std::string(""));
m_xml_value = _label.c_str();
MtBuffer = m_xml_value;