I am working on a project that was written(a HID inteface for STM32) by a person who worked before in visual c++ 2008. So to imitate the line that is causing problem, I created a sample winform application in VC++ 2008. Here is the click event with this one line giving build error only when built for x64, but a win32 build doesn't give any building error and works fine.
private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) {
String^ devPath = this->textBox1->Text;
MessageBox::Show(devPath);
pin_ptr<const TCHAR> pPath = PtrToStringChars(devPath); *error line
}
};
and the the build error that appears only for x64 build is:
Error 1 error C2440: 'initializing' : cannot convert from 'cli::interior_ptr<Type>' to 'cli::pin_ptr<Type>'
Thanks.
This fixed the problem.