component to string
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的更多相关文章
- component to string 自定义窗体
component to string string to component StringToComponent ComponentToString ObjectTextToBinary Objec ...
- TComponent与String的转换(得到控件的DFM格式的描述)
现看下面这两个方法,把一个TComponent做成String,再就是把String转成TComponent function ComponentToStringProc(Component: TCo ...
- Spring Framework 组件注册 之 @Component
Spring Framework 组件注册 之 @Component 写在前面 在spring大行其道的今天,对于spring的使用和掌握乃是不可缺少的必备技能.但是spring的整个体系尤为庞大,对 ...
- React源码 React.Component
React中最重要的就是组件,写的更多的组件都是继承至 React.Component .大部分同学可能都会认为 Component 这个base class 给我们提供了各种各样的功能.他帮助我们去 ...
- [php]laravel框架容器管理的一些要点
本文面向php语言的laravel框架的用户,介绍一些laravel框架里面容器管理方面的使用要点.文章很长,但是内容应该很有用,希望有需要的朋友能看到.php经验有限,不到位的地方,欢迎帮忙指正. ...
- 通过中看不中用的代码分析Ioc容器,依赖注入....
/** * 通过生产拥有超能力的超人实例 来理解IOC容器 */ //超能力模组接口 interface SuperModuleInterface{ public function activate( ...
- 【腾讯Bugly干货分享】打造“微信小程序”组件化开发框架
本文来自于腾讯Bugly公众号(weixinBugly),未经作者同意,请勿转载,原文地址:http://mp.weixin.qq.com/s/2nQzsuqq7Avgs8wsRizUhw 作者:Gc ...
- C#设计模式之工厂
IronMan之工厂 前言 实用为主,学一些用得到的技术更能在如今的社会里保命. 虽然在日常的工作中设计模式不是经常的用到,但是呢,学习它只有好处没有坏处. 设计模式像是一种“标签”,它是代码编写者思 ...
- C#设计模式系列:组合模式(Composite)
1.组合模式简介 1.1>.定义 组合模式主要用来处理一类具有“容器特征”的对象——即它们在充当对象的同时,又可以作为容器包含其他多个对象. 1.2>.使用频率 中高 2.组合模式结构图 ...
随机推荐
- 总结Selenium自动化测试方法(五)自动化测试框架
五.自动化测试框架 1.单元测试框架unittest class loginTests(unittest.TestCase): ①开始的初始化部分 @classmethod def setUpClas ...
- gitflow workflow
https://www.atlassian.com/git/tutorials/comparing-workflows/forking-workflow Dream big, work smart, ...
- python-unexpected content storage modification出错
提示以上错误,然后在pycharm中的文件内容和实际内容不一致 去我的文档-.PyCharm-system_cache,全部删除
- 1038: [ZJOI2008]瞭望塔
半平面交. 半平面指的就是一条直线的左面(也不知道对不对) 半平面交就是指很多半平面的公共部分. 这道题的解一定在各条直线的半平面交中. 而且瞭望塔只可能在各个点或者半平面交折线的拐点处. 求出半平面 ...
- PHP几个几十个G大文件数据统计并且排序处理
诸多大互联网公司的面试都会有这么个问题,有个4G的文件,如何用只有1G内存的机器去计算文件中出现次数最多的数字(假设1行是1个数组,例如QQ号 码).如果这个文件只有4B或者几十兆,那么最简单的办法就 ...
- 转:整理一下Entity Framework的查询
Entity Framework是个好东西,虽然没有Hibernate功能强大,但使用更简便.今天整理一下常见SQL如何用EF来表达,Func形式和Linq形式都会列出来(本人更喜欢Func形式). ...
- Android 开源项目DiskLruCache 详解
有兴趣的同学可以读完这篇文章以后 可以看看这个硬盘缓存和volley 或者是其他 图片缓存框架中使用的硬盘缓存有什么异同点. 讲道理的话,其实硬盘缓存这个模块并不难写,难就难在 你要考虑到百分之0.1 ...
- jquery ajax jsonp跨域调用实例代码
今天研究了AJAX使用JSONP进行跨域调用的方法,发现使用GET方式和POST方式都可以进行跨域调用,这里简单分享下,方便需要的朋友 客户端代码 复制代码 代码如下: <%@ Page Lan ...
- Informatica9.6.1在Linux Red Hat 5.8上安装遇到的有关问题整理_4
4.创建Integration Service后无法启动 1)错误日志: 2)解决办法: 进入Repository Service的属性页面,将其运行模式改成Normal.
- 【PHP入门到精通】:Ch04:流程控制语句
Ch04: 流程控制语句4.1 条件控制语句(1)if (expr) { statement1;statement2;} (2)if (expr) { statement1; } else { s ...