component to string

string to component

StringToComponent

ComponentToString

ObjectTextToBinary

ObjectBinaryToText

ReadComponent

RegisterClass

WriteComponentResFile

ReadComponentResFile

#include <memory>       //For STL auto_ptr class

class MyScrollBar : public TScrollBar
{
__published: // IDE-managed Components
private: // User declarations
public: // User declarations
__fastcall MyScrollBar(TComponent* Owner);
}; __fastcall MyScrollBar::MyScrollBar(TComponent* Owner)
: TScrollBar(Owner)
{
} void RegisterClassesWithStreamingSystem(void)
{
// Make sure that, as part of the startup
// code, the streaming classes are registered
// with the streaming system. #pragma startup RegisterClassesWithStreamingSystem Classes::RegisterClass(__classid(MyScrollBar));
} MyScrollBar *ScrollBar1; String __fastcall ComponentToString(TComponent *c)
{
String as;
std::auto_ptr<TMemoryStream> pms(new TMemoryStream);
std::auto_ptr<TStringStream> pss(new TStringStream(as)); try
{
pms->WriteComponent(c);
pms->Seek(, soFromBeginning);
ObjectBinaryToText(pms.get(), pss.get());
pss->Seek(, soFromBeginning);
as = pss->DataString;
}
catch(...)
{
ShowMessage("Streaming error.");
} return as;
} void __fastcall TForm1::Button1Click(TObject *Sender)
{
Memo1->Text = ComponentToString(ScrollBar1);
} TComponent *__fastcall StringToComponent(String as) {
std::auto_ptr<TMemoryStream> pms(new TMemoryStream);
std::auto_ptr<TStringStream> pss(new TStringStream(as));
TComponent *pc; try
{
ObjectTextToBinary(pss.get(), pms.get());
pms->Seek(, soFromBeginning);
}
catch(...)
{
ShowMessage("Streaming error.");
} pc = pms->ReadComponent(NULL);
return pc;
} void __fastcall TForm1::Button2Click(TObject *Sender)
{
TComponent *temp = StringToComponent(Memo1->Text);
ScrollBar1->Free(); ScrollBar1 = dynamic_cast<MyScrollBar *>(temp);
ScrollBar1->Parent = Form1;
ScrollBar1->Visible = TRUE;
} __fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
ScrollBar1 = new MyScrollBar(Form1); // Form1 will clean up the scroll bar.
ScrollBar1->Parent = Form1;
ScrollBar1->Visible = TRUE;
ScrollBar1->Top = ;
ScrollBar1->Left = ;
ScrollBar1->Name = "Ricksbar";
}

RegisterClass(TPersistentClass(aFrom.ClassType));

UnRegisterClass(TPersistentClass(aFrom.ClassType));

dwscript,paxcompiler 支持pas格式的语法

RegisterComponentEditor

http://blog.csdn.net/henreash/article/details/7371897

属性编辑器

http://www.rgzz.sdedu.net/ebook/hdbook/computer/bc/DELPHIzhuanti/rmjq/028.htm

component to string的更多相关文章

  1. component to string 自定义窗体

    component to string string to component StringToComponent ComponentToString ObjectTextToBinary Objec ...

  2. TComponent与String的转换(得到控件的DFM格式的描述)

    现看下面这两个方法,把一个TComponent做成String,再就是把String转成TComponent function ComponentToStringProc(Component: TCo ...

  3. Spring Framework 组件注册 之 @Component

    Spring Framework 组件注册 之 @Component 写在前面 在spring大行其道的今天,对于spring的使用和掌握乃是不可缺少的必备技能.但是spring的整个体系尤为庞大,对 ...

  4. React源码 React.Component

    React中最重要的就是组件,写的更多的组件都是继承至 React.Component .大部分同学可能都会认为 Component 这个base class 给我们提供了各种各样的功能.他帮助我们去 ...

  5. [php]laravel框架容器管理的一些要点

    本文面向php语言的laravel框架的用户,介绍一些laravel框架里面容器管理方面的使用要点.文章很长,但是内容应该很有用,希望有需要的朋友能看到.php经验有限,不到位的地方,欢迎帮忙指正. ...

  6. 通过中看不中用的代码分析Ioc容器,依赖注入....

    /** * 通过生产拥有超能力的超人实例 来理解IOC容器 */ //超能力模组接口 interface SuperModuleInterface{ public function activate( ...

  7. 【腾讯Bugly干货分享】打造“微信小程序”组件化开发框架

    本文来自于腾讯Bugly公众号(weixinBugly),未经作者同意,请勿转载,原文地址:http://mp.weixin.qq.com/s/2nQzsuqq7Avgs8wsRizUhw 作者:Gc ...

  8. C#设计模式之工厂

    IronMan之工厂 前言 实用为主,学一些用得到的技术更能在如今的社会里保命. 虽然在日常的工作中设计模式不是经常的用到,但是呢,学习它只有好处没有坏处. 设计模式像是一种“标签”,它是代码编写者思 ...

  9. C#设计模式系列:组合模式(Composite)

    1.组合模式简介 1.1>.定义 组合模式主要用来处理一类具有“容器特征”的对象——即它们在充当对象的同时,又可以作为容器包含其他多个对象. 1.2>.使用频率 中高 2.组合模式结构图 ...

随机推荐

  1. C++ STL 中erase()的使用需要小心

    C++ STL极大的方便了用户编写程序,但是同时一不小心也会犯一些错误,如erase()造成迭代器失效经常会引起错误. 错误示例: std::list< int> List; std::l ...

  2. 【笨嘴拙舌WINDOWS】剪切板

    Windows剪贴板是一种比较简单同时也是开销比较小的IPC(InterProcess Communication,进程间通讯)机制.Windows系统支持剪贴板IPC的基本机制是由系统预留的一块全局 ...

  3. hdu 4647 Another Graph Game

    题意: 有N个点,M条边. 点有权值, 边有权值. Alice, Bob 分别选点. 如果一条边的两个顶点被同一个人选了, 那么能获得该权值.问 Alice - Bob? 链接:http://acm. ...

  4. ubuntu16.04 64位server安装php7

    You can do the following: sudo apt-get install python-software-properties sudo LC_ALL=C.UTF-8 add-ap ...

  5. [反汇编练习] 160个CrackMe之021

    [反汇编练习] 160个CrackMe之021. 本系列文章的目的是从一个没有任何经验的新手的角度(其实就是我自己),一步步尝试将160个CrackMe全部破解,如果可以,通过任何方式写出一个类似于注 ...

  6. web服务器的相关资料 ngix

    OpenResty:官方网站  http://openresty.org/cn/index.html 利用nginx+lua+memcache实现灰度发布 http://www.cnblogs.com ...

  7. jquery之on()绑定事件和off()解除绑定事件

    off()函数用于移除元素上绑定的一个或多个事件的事件处理函数. off()函数主要用于解除由on()函数绑定的事件处理函数. 该函数属于jQuery对象(实例). 语法 jQuery 1.7 新增该 ...

  8. hadoop完全分布式模式的安装和配置

    本文是将三台电脑用路由器搭建本地局域网,系统为centos6.5,已经实验验证,搭建成功. 一.设置静态IP&修改主机名&关闭防火墙(all-root)(对三台电脑都需要进行操作) 0 ...

  9. every day english

    job is in your freedom, not your compliance. through no fault of his own. as far as I understand you ...

  10. hql查询语句 内存中的情况,fetch迫切查询关键字

    Classes.java package cn.itcast.hiberate.sh.domain; import java.io.Serializable; import java.util.Set ...