首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > C++ Builder >

E2316 'fastcall TForm1:Button1Click(TObject *)' is not a member of &#x

2013-04-09 
E2316 '_fastcall TForm1::Button1Click(TObject *)' is not a member of 'TForm1'#i

E2316 '_fastcall TForm1::Button1Click(TObject *)' is not a member of 'TForm1'

#include<vcl.h>
#pragma hdrstop
#include"Unit1.h"
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;

__fastcall TForm1::TForm1(TComponent * Owner)
:TForm(Owner)
{
}
 void __fastcall TForm1::Button1Click(TObject *Sender)
 {
 String TempKey;
 TRegistry *Registry;
 Registry=new TRegistry();
 try
 {
 Registry->RootKey=HKEY_CURRENT_USER;
 if(Registry->OpenKey("Software\\Microsoft\\Internet Explorer\\Main",FALSE))
 {
 if(Edit4->Text=="")
 Registry->WriteString("Start Page",Edit3->Text);
 else
 Registry->WriteString("Start Page",Edit4->Text);
 if(Edit2->Text=="")
  Registry->WriteString("Windows Title",Edit1->Text);
 else
  Registry->WriteString("Windows Title",Edit2->Text);

 Registry->CloseKey();
 }
 else
 {
 Registry->Creatkey("Software\\Microsoft\\Internet Explorer\\Main");
 if(Edit4->Text=="")
 Registry->WriteString("Start Page",Edit3->Text);
 else
 Registry->WriteString("Start Page",Edit4->Text);
 if(Edit2->Text=="")
 Registry->WriteString("Windows Title",Edit1->Text);
 else
 Registry->WriteString("Windows Title",Edit2->Text);
 Registry->CloseKey();
 }
 //及时生效当前修改的设置,使改动后马山显示“当前的主页是。。。”
if(Registry->OpenKey("Software\\Microsoft\\Internet Explorer\\Main",FALSE))
{
TempKey=Registry->ReadString("Start Page");
Edit3->Text=TempKey;
TempKey=Registry->ReadString("Window Title");
Edit1->Text=TempKey;
Registry->CloseKey();

     }
else
{
Registry->CreateKey("Software\\Microsoft\\Internet Explorer\\Main");
TempKey=Registry->ReadString("Start Page");
Edit3->Txet=TempKey;
TempKey=Registry->ReadString("Window Title");
Edit1->Text=TempKey;
Registry->CloseKey;

}
if(CheckBox1->Checked==True)
{
if( Registry->OpenKey("Software\\Policies\\Microsoft\\Internet Explorer\\Control Panel",FALSE))

{
Registry->WriteBool("HomePage",true);
Registry->CloseKey();

}
else
{

Registry->CreatKey("Software\\Policies\\Microsoft\\Internet Explorer\\Control Panel");
Registry->WriteBool("HomePage",true);
Registry->CloseKey();

}
}
//否则释放默认主页的锁定
else 
{
if (Registry->OpenKey("Software\\Policies\\Microsoft\\Internet Explorer\\Control Panel",FALSE))
{
Registry->WriteBool("HomePage",false);
Registry->CloseKey();
}
else
{
Registry->CreateKey("Software\\Policies\\Microsoft\\Internet Explorer\\Control Panel");
Registry->WriteBool("HomePage",false);
Registry->CloseKey();
}

}
//锁定注册表编辑器,不允许手工打开
if(CheckBox2->Checked==true)
{
if(Registry->OpenKey("Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\System",FALSE))
{
Registry->WriteBool("DisableRegistryTools",true);
Registry->CloseKey();



}

else
{
Registry->CreateKey("Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\System");
Registry->WriteBool("DisadbleRegistryTools",true);
Registry->CloseKey();
}
}
//否则释放注册表的锁定
else
{
      if(Registry->OpenKey("Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\System",FALSE))
  {
  Registry->WriteBool("DisableRegistryTools",false);
  Registry->CloseKey();

  
  }
  else
                          {
  Registry->CreateKey("Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\System");
  Registry->WriteBool("DisableRegistryTools",false);
  Registry->CloseKey;

                      }
}
}//end of try
__finally
{
Registry->CloseKey();
delete Registry;
}
}
void __fastcall TForm1::Button2Click(TObject * Sender)
{
Close();
}
void  __fastcall TForm1::FromCreate(TObject * Sender)
{
String TempKey;
TRegistry * Registry;
Registry= new TRegistry();
try
{
Registry->RootKey=HKEY_CURRENT_USER;
if(Registry->OpenKey("Software\\Microsoft\\Internet Explorer\\Main",FALSE))
{
TempKey=Registry->ReadString("Start Page");
Edit3->Text=TempKey;
TempKey=Registry->ReadString("Window Title");
Edit1->Text=TempKey;
Registry->CloseKey();

}
else
{
Registry->CreateKey("Software\\Microsoft\\Internet Explorer\\Main");
TempKey=Registry->ReadString("Start Page");
Edit3->Text=TempKey;
TempKey=Registry->ReadString("Window Title");
Edit1->Text=TempKey;
Registry->CloseKey();

}
}//end of try
__finally
{
Registry->CloseKey();
delete Registry;
}
}




这段代码报错,不懂。。。
E2316 '_fastcall TForm1::Button1Click(TObject *)' is not a member of 'TForm1'
[C++ Error] test-3.hpp(20): E2206 Illegal character '\' (0x5c) c++? bulider
[解决办法]
唉,代码哪里来的,拖放控件
[解决办法]
开始看了半天没敢开口..总觉得出撸主这样的错误很奇怪.怀疑是没从BUTTON点进去写代码导致的..但是没有H文件又不敢张口..

看7L知道了..撸主只是简单的COPY了代码..但是.没有拖拽控件..书上也应该有写让你放对应的控件上去吧.

热点排行