最近在做项目的时候遇到了这个问题。 项目需要动态根据添加com组件,获取组件的某个接口函数。 一般情况下,我们创建com组件的方法是根据它的CLSID号,获得相应的interface,然后通过返回的指针调用相应的接口函数。如下: CoInitialize( NULL );IpTest* pMask = NULL;HRESULT hr = CoCreateInstance( CLS... Read More
posted @ 2014-07-31 14:53 忆寒 Views(2460) Comments(0) Diggs(0) Edit
CStdioFile file; file.Open(_T("c:\\a.txt"),CFile::modeCreate |CFile::modeReadWrite); file.WriteString(_T("hello world ,第一句话")); file.Flush(); file.Close();默认状态下,中文无法显示。 _tsetlo... Read More
posted @ 2014-07-29 14:10 忆寒 Views(432) Comments(0) Diggs(0) Edit
代码如下: 1: void CallThreadFun() 2: { 3: CString strPath="C:\\a.txt"; 4: HANDLE hThread=::CreateThread(NULL,NULL,ThreadFunc,(LPVOID)(LPCTSTR)str,0,&thID); 5: ... Read More
posted @ 2014-04-10 12:28 忆寒 Views(1628) Comments(0) Diggs(0) Edit
问题: 最近遇到的一个问题,窗体在win7下编译成功,控件位置显示正常,但是放在xp上运行控件的位置就会错乱,显得界面很乱。 解决方法: C# winform编程默认情况下,form1.AutoScaleMode=AutoScaleMode.Font; 即根据系统字体控制缩放。 MSDN说明: 将默认设置改为: form1.AutoScaleMode=AutoScaleMo... Read More
posted @ 2013-06-02 22:48 忆寒 Views(2378) Comments(0) Diggs(0) Edit
使用前台线程技术使多线程程序完全退出 Read More
posted @ 2013-05-09 15:15 忆寒 Views(1895) Comments(0) Diggs(0) Edit
DataGridView重写绑定数据后不能立即更新UI显示的解决方案 Read More
posted @ 2013-05-08 20:59 忆寒 Views(1063) Comments(0) Diggs(1) Edit