"mohan (AT) tek (DOT) com" <mohan (AT) tek (DOT) com> wrote:
Quote:
hanks Barry. But after selecting /MD options ,I am getting some
different error.
Error 1 error C2440:cannot convert from '__const_Char_ptr' to 'wchar_t
__gc *' 28 |
It helps when you supply the full error (the full error is on the Output
page or on the command line). The full error is:
---8<---
error C2440: 'return' : cannot convert from '__const_Char_ptr' to
'wchar_t __gc *'
Conversion loses qualifiers
--->8---
The problem is that __const_Char_ptr has a const qualifier, while the
declared return type of the function is non-const. You need to add
'const':
---8<---
const wchar_t __gc* GetAssemblyPath()
{
return PtrToStringChars(Assembly::GetExecutingAssembly()->Location);
}
--->8---
Or alternatively, use const_cast<> to cast it away.
-- Barry
--
http://barrkel.blogspot.com/