惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Simon Willison's Weblog
Simon Willison's Weblog
Help Net Security
Help Net Security
P
Privacy International News Feed
T
Threat Research - Cisco Blogs
C
Cisco Blogs
C
CERT Recently Published Vulnerability Notes
NISL@THU
NISL@THU
L
LINUX DO - 热门话题
Security Latest
Security Latest
A
Arctic Wolf
G
GRAHAM CLULEY
月光博客
月光博客
S
Securelist
D
Docker
J
Java Code Geeks
T
Troy Hunt's Blog
T
Tenable Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
SecWiki News
SecWiki News
S
Security @ Cisco Blogs
量子位
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
L
LINUX DO - 最新话题
Recent Commits to openclaw:main
Recent Commits to openclaw:main
aimingoo的专栏
aimingoo的专栏
博客园 - 【当耐特】
H
Heimdal Security Blog
The Hacker News
The Hacker News
博客园 - 三生石上(FineUI控件)
Application and Cybersecurity Blog
Application and Cybersecurity Blog
N
Netflix TechBlog - Medium
Vercel News
Vercel News
Forbes - Security
Forbes - Security
B
Blog RSS Feed
H
Hackread – Cybersecurity News, Data Breaches, AI and More
IT之家
IT之家
B
Blog
MongoDB | Blog
MongoDB | Blog
博客园 - 聂微东
Google DeepMind News
Google DeepMind News
S
Secure Thoughts
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
C
Check Point Blog
云风的 BLOG
云风的 BLOG
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
T
The Blog of Author Tim Ferriss
L
Lohrmann on Cybersecurity
F
Full Disclosure
D
Darknet – Hacking Tools, Hacker News & Cyber Security
P
Proofpoint News Feed

博客园 - 小水坝

使用双分派解决领域实体和外部机制通信问题 搞定thrift双向消息 读《软件需求最佳实践》有感 【thrift】vc中使用thrift中文字符串乱码问题解决 __declspec(dllimport)的小秘密(转) 跨线程send message 【boost】使用serialization库序列化子类 【boost】ptree 读写中文的问题 【MFC】动态创建CMFCToolbar图标不显示问题 【boost】使用装饰者模式改造boost::thread_group 【VC】VC工具栏图标合并工具(非tbcreator和visual toolbar) 【boost】使用lambda表达式和generate_n生成顺序序列 【boost】BOOST_LOCAL_FUNCTION体验 【boost】MFC dll中使用boost thread的问题 【转帖】C++编译原理 资料 IE6,7下password框长度变短问题 dwz局部表格分页 dwz中combox的value问题 dwz中使用flot,js报表等js插件
动态创建TeeChart的简便方法
小水坝 · 2013-11-08 · via 博客园 - 小水坝

最近在项目中使用Teechart ocx版本替换了labview的老版本控件,显示效果和效率均有提高,但是却遇到多线程下报access violation的问题。

翻遍大小论坛,最后在官网论坛找到相同问题,客服的答复是“多线程情况下,需要在线程中动态创建Teechart控件,不然mouse move事件可能会引起accessviolation 错误”。使用代码动态创建Teechart需要大量代码,在做多项定制并添加tools的情况下简直就是噩梦。labview的图表控件可以将配置导出为文件,动态创建的时候直接载入配置,在翻看Teechart配置工具后,终于让我找到了类似的方法,以下为使用过程(vs2010+teechart2010 ocx,其他版本或语言类似):

1、创建一个dialog,拖入一个teechart控件,在上面做好需要的各种配置。

2、在Export选项下,Native卡中选择binary,导出配置文件,这里配置文件为.tee后缀。

3、在项目中,动态创建控件,并调用CImport类的LoadFromFile方法,载入刚才保存的配置文件,这样就完美的实现了动态加载的目的而避免写出巨量的配置代码

m_dyChart = new CTchart1();
    m_dyChart->Create(NULL, NULL,WS_VISIBLE | WS_CHILD, CRect(0,0,0,0), this, 1234);
    CImport imp = static_cast<CImport>(m_dyChart->get_Import());
    imp.LoadFromFile("dy.tee");