compiler error

  • Thread starter Thread starter Reza A
  • Start date Start date
R

Reza A

Hi all,
I'm currently reading Microsoft Visual C++ .Net and I'm trying to
compile a Dialog box form that I've just created however I'm getting the
following errors.

Output Window
Compiling...
MyDialog.cpp
c:\Code\CppForm\MyDialog.h(168) : error C2440: '=' : cannot convert from
'System::String __gc *' to 'System::Windows::Forms::Label __gc *'
Types pointed to are unrelated; conversion requires
reinterpret_cast, C-style cast or function-style cast
Form1.cpp
c:\Code\CppForm\MyDialog.h(168) : error C2440: '=' : cannot convert from
'System::String __gc *' to 'System::Windows::Forms::Label __gc *'
Types pointed to are unrelated; conversion requires
reinterpret_cast, C-style cast or function-style cast
Generating Code...



Line 168 is
this->Name = S"MyDialog";



which is under the function InitializeComponent() in the following class

public __gc class MyDialog : public System::Windows::Forms::Form

Any ideas what's going on here? on another form where I use this->Name =
"Form1"; and this->Text = "form1"; I receive no errors.

any help is greatly appreciated.

Thanks,
 
Back
Top