Last post Jul 01, 2014 04:55 AM by May Wang
Jun 30, 2014 06:23 AM|joshi.ravi.kumar|LINK
I am trying to read a file created by Remote Sensing and Mining helper Hardware file where data is stored in BSTR format. I'm not sure from where i have to start? I have tried to read a file using C# code and convert into readable String. Below's code i'm
trying to use :
byte theBytes = File.ReadAllBytes(PathOfFile);
IntPtr pBStr = Marshal.StringToBSTR(Encoding.Default.GetString(theBytes, 0, theBytes.Length));
string output = Marshal.PtrToStringBSTR(pBStr);
I know code will not work but i don't know from where to start with this task. Below is the file (trying to convert into readable string) and pdf document.
File can be found here : http://www.inspirants.com/Default2_0008.asd
Document for file :
Any kind of help will be highly appreciable.
Jul 01, 2014 04:55 AM|May Wang|LINK
Thanks for posting here. Based on your description, I know that you want to find a way to convert BSTR into a readable string. You can refer to the links below.
conversion from BSTR to string
BSTR to std::string (std::wstring) and vice versa
Hope it helps.