博客园 - hbhbice
uuid:24b78886-0ed1-41c2-8670-e3f31dcf42c4;id=188824
2017-10-19T18:07:16Z
hbhbice
https://www.cnblogs.com/hbhbice/
feed.cnblogs.com
https://www.cnblogs.com/hbhbice/p/6543285.html
错误88error C2248: “CObject::CObject”: 无法访问 private 成员(在“CObject”类中声明)c:\program files (x86)\microsoft visual studio 9.0\vc\atlmfc\include\afxcoll.h590 - hbhbice
最近接收了以前新公司遗留的代码,一个函数动不动就少的一千行,多的几千行,真是受不了这编码风格! 于是便使用了VS自带的重构工具,选择代码后右键-重构-提取方法,提取完方法就编译不过,想了好久原因,原来是参数的问题, 参数中大量使用了CStringArray,例如: static void Handl
2017-03-13T07:58:00Z
2017-03-13T07:58:00Z
hbhbice
https://www.cnblogs.com/hbhbice/
【摘要】最近接收了以前新公司遗留的代码,一个函数动不动就少的一千行,多的几千行,真是受不了这编码风格! 于是便使用了VS自带的重构工具,选择代码后右键-重构-提取方法,提取完方法就编译不过,想了好久原因,原来是参数的问题, 参数中大量使用了CStringArray,例如: static void Handl <a href="https://www.cnblogs.com/hbhbice/p/6543285.html" target="_blank">阅读全文</a>
https://www.cnblogs.com/hbhbice/p/4286643.html
WinCE\Window Mobile程序桌面化总结 - hbhbice
1、系统API处理将桌面、移动API分开处理2、一份代码,两个工程,分别编译添加已有文件时,使用添加链接,而不是添加附本3、桌面窗体出现位置不规律,样式不统一问题首先,在窗体类成员加入两个成员变量 publicForm parentForm; privatebool inited; 然后添加如下代...
2015-02-11T09:18:00Z
2015-02-11T09:18:00Z
hbhbice
https://www.cnblogs.com/hbhbice/
【摘要】1、系统API处理将桌面、移动API分开处理2、一份代码,两个工程,分别编译添加已有文件时,使用添加链接,而不是添加附本3、桌面窗体出现位置不规律,样式不统一问题首先,在窗体类成员加入两个成员变量 publicForm parentForm; privatebool inited; 然后添加如下代... <a href="https://www.cnblogs.com/hbhbice/p/4286643.html" target="_blank">阅读全文</a>
https://www.cnblogs.com/hbhbice/archive/2013/06/07/3125141.html
JNI itoa 不能使用的问题 - hbhbice
在JNI中使用 itoa函数,总是说没有这个函数,jni/TestJni.cpp:22:18: error: 'itoa' was not declared in this scope而我新建一个C++工程(使用的是MinGW),itoa可以正常使用,后来我看了一下两者的头文件,发现JNI中使用的是D:\Android\android-ndk-r8e\platforms\android-14\arch-arm\usr\include\stdlib.h而MinGW则使用的是C:\MinGW\include\stdlib.hNDK中的stdlib.h的确不支持 itoa所以以后使用
2013-06-07T12:48:00Z
2013-06-07T12:48:00Z
hbhbice
https://www.cnblogs.com/hbhbice/
【摘要】在JNI中使用 itoa函数,总是说没有这个函数,jni/TestJni.cpp:22:18: error: 'itoa' was not declared in this scope而我新建一个C++工程(使用的是MinGW),itoa可以正常使用,后来我看了一下两者的头文件,发现JNI中使用的是D:\Android\android-ndk-r8e\platforms\android-14\arch-arm\usr\include\stdlib.h而MinGW则使用的是C:\MinGW\include\stdlib.hNDK中的stdlib.h的确不支持 itoa所以以后使用 <a href="https://www.cnblogs.com/hbhbice/archive/2013/06/07/3125141.html" target="_blank">阅读全文</a>
https://www.cnblogs.com/hbhbice/archive/2013/05/10/3071578.html
C#编译成x86与x64区别 - hbhbice
static void Main(string[] args) { Console.WriteLine("This applications is compiled to run on all processors."); Console.WriteLine("Checking IntPtr.Size to see if this application is running as a 32bit or 64bit application."); Console.WriteL...
2013-05-10T09:24:00Z
2013-05-10T09:24:00Z
hbhbice
https://www.cnblogs.com/hbhbice/
【摘要】static void Main(string[] args) { Console.WriteLine("This applications is compiled to run on all processors."); Console.WriteLine("Checking IntPtr.Size to see if this application is running as a 32bit or 64bit application."); Console.WriteL... <a href="https://www.cnblogs.com/hbhbice/archive/2013/05/10/3071578.html" target="_blank">阅读全文</a>
https://www.cnblogs.com/hbhbice/archive/2013/05/05/3061227.html
javah用法 - hbhbice
进入到工程的bin目录,javah -classpath 包的绝对路径(图1)或相对路径(图2),包名+类名。例如:E:\Eclipse\workspace\AndroidFileTest\bin>javah -classpath classes com.ice.androidfiletest.MainActivity
2013-05-05T09:32:00Z
2013-05-05T09:32:00Z
hbhbice
https://www.cnblogs.com/hbhbice/
【摘要】进入到工程的bin目录,javah -classpath 包的绝对路径(图1)或相对路径(图2),包名+类名。例如:E:\Eclipse\workspace\AndroidFileTest\bin>javah -classpath classes com.ice.androidfiletest.MainActivity <a href="https://www.cnblogs.com/hbhbice/archive/2013/05/05/3061227.html" target="_blank">阅读全文</a>
https://www.cnblogs.com/hbhbice/archive/2013/05/05/3061188.html
没有Root 时Data/Data文件夹不可见 - hbhbice
公司的一款Android平板没有Root工具,没有Root 时Data/Data文件夹不可见可以使用adb.exe shell,进入shell模式,然后使用chmod 777 (目录全路径进行设置)# chmod 777 /data/datachmod 777 /data/data# chmod 777 /data/data/com.zhd.serialtoolandroidchmod 777 /data/data/com.zhd.serialtoolandroid# chmod 777 /data/data/com.zhd.serialtoolandroid/shared_prefschmo
2013-05-05T09:04:00Z
2013-05-05T09:04:00Z
hbhbice
https://www.cnblogs.com/hbhbice/
【摘要】公司的一款Android平板没有Root工具,没有Root 时Data/Data文件夹不可见可以使用adb.exe shell,进入shell模式,然后使用chmod 777 (目录全路径进行设置)# chmod 777 /data/datachmod 777 /data/data# chmod 777 /data/data/com.zhd.serialtoolandroidchmod 777 /data/data/com.zhd.serialtoolandroid# chmod 777 /data/data/com.zhd.serialtoolandroid/shared_prefschmo <a href="https://www.cnblogs.com/hbhbice/archive/2013/05/05/3061188.html" target="_blank">阅读全文</a>
https://www.cnblogs.com/hbhbice/archive/2013/04/23/3038559.html
软键盘 WinCE Mobile - hbhbice
public static uint SIPF_OFF = 0x00;//软键盘关闭 public static uint SIPF_ON = 0x01;//软键盘打开 [DllImport("coredll.dll")] public extern static void SipShowIM(uint dwFlag);
2013-04-23T11:12:00Z
2013-04-23T11:12:00Z
hbhbice
https://www.cnblogs.com/hbhbice/
【摘要】public static uint SIPF_OFF = 0x00;//软键盘关闭 public static uint SIPF_ON = 0x01;//软键盘打开 [DllImport("coredll.dll")] public extern static void SipShowIM(uint dwFlag); <a href="https://www.cnblogs.com/hbhbice/archive/2013/04/23/3038559.html" target="_blank">阅读全文</a>
https://www.cnblogs.com/hbhbice/archive/2013/04/20/3033252.html
C# 实现 类似Android的Toast - hbhbice
public partial class ToastForm : Form { /// <summary> /// 显示毫秒 /// </summary> private int _wait_ms = 1000; public ToastForm(double seconds, string text, Form parent) : this(seconds, text, parent, Color.Blue, 15, ContentAlignment.TopCenter) ...
2013-04-20T14:38:00Z
2013-04-20T14:38:00Z
hbhbice
https://www.cnblogs.com/hbhbice/
【摘要】public partial class ToastForm : Form { /// <summary> /// 显示毫秒 /// </summary> private int _wait_ms = 1000; public ToastForm(double seconds, string text, Form parent) : this(seconds, text, parent, Color.Blue, 15, ContentAlignment.TopCenter) ... <a href="https://www.cnblogs.com/hbhbice/archive/2013/04/20/3033252.html" target="_blank">阅读全文</a>
https://www.cnblogs.com/hbhbice/archive/2013/04/19/3030319.html
JNI由C编译方式改成C++编译方式 - hbhbice
以 hello-jni为例1、将hello-jni.c 改为hello-jni.cpp2、将原代码中 (*env)->NewStringUTF(env, "Hello from JNI !"); 改为: return env->NewStringUTF("Hello from JNI !");3、mk文件中 LOCAL_SRC_FILES := hello-jni.c改为: LOCAL_SRC_FILES := hello-jni.cpp4、#ifdef __cplusplusextern "C" { jstring Ja
2013-04-19T03:26:00Z
2013-04-19T03:26:00Z
hbhbice
https://www.cnblogs.com/hbhbice/
【摘要】以 hello-jni为例1、将hello-jni.c 改为hello-jni.cpp2、将原代码中 (*env)->NewStringUTF(env, "Hello from JNI !"); 改为: return env->NewStringUTF("Hello from JNI !");3、mk文件中 LOCAL_SRC_FILES := hello-jni.c改为: LOCAL_SRC_FILES := hello-jni.cpp4、#ifdef __cplusplusextern "C" { jstring Ja <a href="https://www.cnblogs.com/hbhbice/archive/2013/04/19/3030319.html" target="_blank">阅读全文</a>
https://www.cnblogs.com/hbhbice/archive/2013/01/09/2852930.html
C#封送回调函数和委托 - hbhbice
C#封送回调函数和委托因需要,需要封装一个C++网络库到C#环境使用,而C++网络库是使用的事件的方式,也就是说,发生网络事件时,C++网络库发出事件通知,而真正的处理函数在C#端。这就要求,在封装时需要封装一个函数指针以实现回调。下面代码实现了如上功能。上网找了一下,找到的一般都是封送值,结构,一般函数的,所以就想写出来分享一下。关键词:C# C++ 互操作 封送 封送回调函数 封送函数指针 C#C++回调建两个工程//CallBackDelegate.csusingSystem;usingSystem.Collections.Generic;usingSystem.Text;usingSy
2013-01-09T06:38:00Z
2013-01-09T06:38:00Z
hbhbice
https://www.cnblogs.com/hbhbice/
【摘要】C#封送回调函数和委托因需要,需要封装一个C++网络库到C#环境使用,而C++网络库是使用的事件的方式,也就是说,发生网络事件时,C++网络库发出事件通知,而真正的处理函数在C#端。这就要求,在封装时需要封装一个函数指针以实现回调。下面代码实现了如上功能。上网找了一下,找到的一般都是封送值,结构,一般函数的,所以就想写出来分享一下。关键词:C# C++ 互操作 封送 封送回调函数 封送函数指针 C#C++回调建两个工程//CallBackDelegate.csusingSystem;usingSystem.Collections.Generic;usingSystem.Text;usingSy <a href="https://www.cnblogs.com/hbhbice/archive/2013/01/09/2852930.html" target="_blank">阅读全文</a>
https://www.cnblogs.com/hbhbice/archive/2012/12/28/2836988.html
新建udl文件自动生成连接字符串 - hbhbice
生成数据连接字符串通常比较麻烦,可以新建一个udl文件自动生成。但有时有的电脑用这种方法找不到数据库的服务器。可以用以下步骤进行设置。1、关闭防火墙2、开启SQL Brower服务3、开启TCPIP服务,并设置其动态端口为1433。
2012-12-28T03:07:00Z
2012-12-28T03:07:00Z
hbhbice
https://www.cnblogs.com/hbhbice/
【摘要】生成数据连接字符串通常比较麻烦,可以新建一个udl文件自动生成。但有时有的电脑用这种方法找不到数据库的服务器。可以用以下步骤进行设置。1、关闭防火墙2、开启SQL Brower服务3、开启TCPIP服务,并设置其动态端口为1433。 <a href="https://www.cnblogs.com/hbhbice/archive/2012/12/28/2836988.html" target="_blank">阅读全文</a>
https://www.cnblogs.com/hbhbice/archive/2012/04/19/2457794.html
WindowProc WndProc - hbhbice
LRESULTCALLBACKWindowProc(HWNDhwnd,UINTuMsg,WPARAMwParam,LPARAMlParam);ms-help://MS.VSCC.v90/MS.MSDNQTR.v90.chs/winui/winui/windowsuserinterface/windowing/windowprocedures/windowprocedurereference/windowprocedurefunctions/windowproc.htm
2012-04-19T12:17:00Z
2012-04-19T12:17:00Z
hbhbice
https://www.cnblogs.com/hbhbice/
【摘要】LRESULTCALLBACKWindowProc(HWNDhwnd,UINTuMsg,WPARAMwParam,LPARAMlParam);ms-help://MS.VSCC.v90/MS.MSDNQTR.v90.chs/winui/winui/windowsuserinterface/windowing/windowprocedures/windowprocedurereference/windowprocedurefunctions/windowproc.htm <a href="https://www.cnblogs.com/hbhbice/archive/2012/04/19/2457794.html" target="_blank">阅读全文</a>
https://www.cnblogs.com/hbhbice/archive/2012/04/19/2457775.html
VS2008新建一个Console项目,里面使用WinMain函数 - hbhbice
错误提示:错误 1 error LNK2019: 无法解析的外部符号 _main,该符号在函数 _mainCRTStartup 中你建立的是console工程,console工程的入口是main,而不是WinMain,在链接时,就会找不到main 工程--> Setting--> Link 将/subsystem:windows 改为 /subsystem:console 即可http://zhidao.baidu.com/question/252575445.html
2012-04-19T11:56:00Z
2012-04-19T11:56:00Z
hbhbice
https://www.cnblogs.com/hbhbice/
【摘要】错误提示:错误 1 error LNK2019: 无法解析的外部符号 _main,该符号在函数 _mainCRTStartup 中你建立的是console工程,console工程的入口是main,而不是WinMain,在链接时,就会找不到main 工程--> Setting--> Link 将/subsystem:windows 改为 /subsystem:console 即可http://zhidao.baidu.com/question/252575445.html <a href="https://www.cnblogs.com/hbhbice/archive/2012/04/19/2457775.html" target="_blank">阅读全文</a>
https://www.cnblogs.com/hbhbice/archive/2011/07/11/2102921.html
解决串口死锁 - hbhbice
代码boolclosing=false;boollistening=false;//打开or关闭串口btnOpen_Click(){if(btnOpen.Text=="Open"){serial.Open();}else{closing=true;while(listening)Application.DoEvents();serial.Close();closing=false;}}//串口数据监听serial_DataReceived(){if(closing)return;try{listening=true;//读取数据等相关操作……}catch{}finally{
2011-07-11T04:54:00Z
2011-07-11T04:54:00Z
hbhbice
https://www.cnblogs.com/hbhbice/
【摘要】代码boolclosing=false;boollistening=false;//打开or关闭串口btnOpen_Click(){if(btnOpen.Text=="Open"){serial.Open();}else{closing=true;while(listening)Application.DoEvents();serial.Close();closing=false;}}//串口数据监听serial_DataReceived(){if(closing)return;try{listening=true;//读取数据等相关操作……}catch{}finally{ <a href="https://www.cnblogs.com/hbhbice/archive/2011/07/11/2102921.html" target="_blank">阅读全文</a>
https://www.cnblogs.com/hbhbice/archive/2011/01/05/1926525.html
让自定义控件设计时全部可见(而不是只有一个占位符代码) - hbhbice
[代码]Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--//让自定义控件设计时可见全部(而不是只有一个占位符代码)?xmlversion="1.0"encoding="utf-16"?Classesxmlns="http://schemas.microsoft.com/VisualStudio/2004/03/SmartDevices/XMTA.xsd"ClassName="LaserGunZHD.LaserGunConnect"De
2011-01-05T09:12:00Z
2011-01-05T09:12:00Z
hbhbice
https://www.cnblogs.com/hbhbice/
【摘要】[代码]Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--//让自定义控件设计时可见全部(而不是只有一个占位符代码)?xmlversion="1.0"encoding="utf-16"?Classesxmlns="http://schemas.microsoft.com/VisualStudio/2004/03/SmartDevices/XMTA.xsd"ClassName="LaserGunZHD.LaserGunConnect"De <a href="https://www.cnblogs.com/hbhbice/archive/2011/01/05/1926525.html" target="_blank">阅读全文</a>
https://www.cnblogs.com/hbhbice/archive/2010/12/27/PInvoke.html
P/Invoke 返回bool 值 - hbhbice
在平台调用时,会遇到被调用的函数返回的是bool值,这时使用C#调用时便会得到错误的bool值,在网上查了一下,有2种解决方法1.定义被调用函数时不返回bool,直接回返回int.2.在声明方法时加一个 [return: MarshalAs(UnmanagedType.I1)]我的示例代码:C++ 编写的示例程序代码(Win32 DLL):编译完成后,生成一个名为 DllTest.dll 的 DLL[代码]C#调用端代码:[代码]有些朋友可能不知道我的入口点是怎么来的,为什么是一串奇怪的字符串,我是通过 Depends 工具找到的,呵呵如下图如果不加[return: MarshalAs(Unm
2010-12-27T07:11:00Z
2010-12-27T07:11:00Z
hbhbice
https://www.cnblogs.com/hbhbice/
【摘要】在平台调用时,会遇到被调用的函数返回的是bool值,这时使用C#调用时便会得到错误的bool值,在网上查了一下,有2种解决方法1.定义被调用函数时不返回bool,直接回返回int.2.在声明方法时加一个 [return: MarshalAs(UnmanagedType.I1)]我的示例代码:C++ 编写的示例程序代码(Win32 DLL):编译完成后,生成一个名为 DllTest.dll 的 DLL[代码]C#调用端代码:[代码]有些朋友可能不知道我的入口点是怎么来的,为什么是一串奇怪的字符串,我是通过 Depends 工具找到的,呵呵如下图如果不加[return: MarshalAs(Unm <a href="https://www.cnblogs.com/hbhbice/archive/2010/12/27/PInvoke.html" target="_blank">阅读全文</a>
https://www.cnblogs.com/hbhbice/archive/2010/12/08/1900222.html
求两直线交点程序 - hbhbice
//以下是一个直线类 ,其中包括了一个方法(Cross),用于求直线的交点 , 其实求直线交点不难,但有时在斜率不存在时不好处理,//所以可以用AX + BX + C =0 这个一般式来描述直线。而不用 Y = KX + B[代码]下在是一个界面,用于测试效果, 以下左图是斜率为0和斜率不存在的两条直线的相交效果。 右图是 一般的直线的相交效果 界面部分代码如下:[代码]
2010-12-08T06:35:00Z
2010-12-08T06:35:00Z
hbhbice
https://www.cnblogs.com/hbhbice/
【摘要】//以下是一个直线类 ,其中包括了一个方法(Cross),用于求直线的交点 , 其实求直线交点不难,但有时在斜率不存在时不好处理,//所以可以用AX + BX + C =0 这个一般式来描述直线。而不用 Y = KX + B[代码]下在是一个界面,用于测试效果, 以下左图是斜率为0和斜率不存在的两条直线的相交效果。 右图是 一般的直线的相交效果 界面部分代码如下:[代码] <a href="https://www.cnblogs.com/hbhbice/archive/2010/12/08/1900222.html" target="_blank">阅读全文</a>
https://www.cnblogs.com/hbhbice/archive/2010/12/02/1894095.html
SQLiteTest - hbhbice
[代码][代码]
2010-12-02T02:01:00Z
2010-12-02T02:01:00Z
hbhbice
https://www.cnblogs.com/hbhbice/
【摘要】[代码][代码] <a href="https://www.cnblogs.com/hbhbice/archive/2010/12/02/1894095.html" target="_blank">阅读全文</a>
https://www.cnblogs.com/hbhbice/archive/2010/12/02/1894085.html
WinCE 上截图 - hbhbice
核心代码如下:[代码]
2010-12-02T01:52:00Z
2010-12-02T01:52:00Z
hbhbice
https://www.cnblogs.com/hbhbice/
【摘要】核心代码如下:[代码] <a href="https://www.cnblogs.com/hbhbice/archive/2010/12/02/1894085.html" target="_blank">阅读全文</a>
https://www.cnblogs.com/hbhbice/archive/2010/11/06/1870670.html
C#设置DataGrid的列宽 - hbhbice
DataGridTableStyle dataGridTableStyle = new DataGridTableStyle(); //dataGridTableStyle.GridColumnStyles dataGrid1.TableStyles.Add(dataGridTableStyle); dataGrid1.TableStyles[0].GridColumnStyles[0].Wid...
2010-11-06T09:30:00Z
2010-11-06T09:30:00Z
hbhbice
https://www.cnblogs.com/hbhbice/
【摘要】DataGridTableStyle dataGridTableStyle = new DataGridTableStyle(); //dataGridTableStyle.GridColumnStyles dataGrid1.TableStyles.Add(dataGridTableStyle); dataGrid1.TableStyles[0].GridColumnStyles[0].Wid... <a href="https://www.cnblogs.com/hbhbice/archive/2010/11/06/1870670.html" target="_blank">阅读全文</a>