September 6th, 2013, 12:50 PM
I am writing an MFC app in Visual Studio 2012 that will open a JPG file as binary and read all the contents to a CString.
I am able to read it to a std::Vector, but that doesn't help me much as i need to pass all the binary content as a MFC CString to another function.
Can anyone help me with a sample code for that?
Thanks in advance
Let me explain the problem a little more deeper.
The 1st argument is the JS Function Name and 2nd is the one to pass the Binary Data. 1st argument works fine as i am able to call the JS fucntion called "LoadImage" without any problem. Problem is with 2nd argument that's supposed to take the Binary data of the JPG file.
If i try to pass a std::Vector or std::string then it will give me an error.
But it's happy if i pass CString. But then with CString there's a problem with NULL characters.
Actually my plan is to pass the binary of a JPG to a JS function and let it display the JPG in the HTML page.
Is there a better way of doing this?
Can i typecast a Vector or std::string to a CComVariant*?
Please help. Thanks
Click Here to Expand Forum to Full Width
This is a Codeguru.com survey!