摘要: 这个概念主要用在C++中去实现"委托"的特性. 但现在C++11 中有了 更好用的function/bind 功能.但对于类的成员函数指针的概念我们还是应该掌握的.类函数指针 就是要确定由哪个 类的实例 去调用 类函数指针所指的函数.typedef void (Human::*fp)(); 定义了一个类的函数指针.fp classFunc = &Human::run; // 注意这里是方法的地址.告之具体的指向类中的哪个函数(human->*p)(); 或 (human.*p)(); // 这是使用一个类的实例去调用类的函数指针 *p 就是取得方法的地址 然后 阅读全文
posted @ 2013-10-29 22:14 easyfrog 阅读(3286) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 3 #pragma comment(lib,"strmbase.lib") 4 #pragma comment(lib,"quartz.lib") 5 6 int main() { 7 // Filter Graph Builder 8 IGraphBuilder *pGraph = NULL; 9 // Media Control10 IMediaControl *pControl = NULL;11 // Media Event12 IMediaEvent *pEvent = NULL;13 // 初... 阅读全文
posted @ 2013-10-27 19:12 easyfrog 阅读(431) 评论(0) 推荐(0) 编辑
摘要: 一. 在WPF 中使用 WebBrowser,直接打开 WebPlayer.html以这种方式有一个问题是. 无法在 WebBrowser 的上面 放置其它的控件, 在运行时,都不会显示 .以 HTML为中介, 可以方便的换场景. (真接设置 WebBrowser.Source=new Uri(@"x:\\WebPlayr.unity3d");) 即可. WPF->Unity 或 Unity->WPF 都要通过 HTML的Javascript脚本. 这种方式是目前最简单靠谱的方式 . ~二 .嵌入UntiyWebPlayer 的 ActiveX 控件 ----- 阅读全文
posted @ 2013-09-03 23:38 easyfrog 阅读(9615) 评论(16) 推荐(5) 编辑
摘要: 1 using System; 2 using System.Collections.Generic; 3 using System.Linq; 4 using System.Text; 5 6 namespace CompilerTest 7 { 8 // Compiler 9 class MyCompilter 10 { 11 // Provider 12 private Microsoft.CSharp.CSharpCodeProvider Provider; 13 // CompilerPar... 阅读全文
posted @ 2013-07-03 20:21 easyfrog 阅读(482) 评论(0) 推荐(0) 编辑
摘要: 1 using System; 2 using System.Collections.Generic; 3 using System.Linq; 4 using System.Text; 5 using System.IO; 6 using System.Runtime.Serialization.Formatters.Binary; 7 8 namespace SerializeTest 9 {10 class Program11 {12 static void Main(string[] args) {13 // Create a... 阅读全文
posted @ 2013-06-23 17:31 easyfrog 阅读(1053) 评论(0) 推荐(0) 编辑
摘要: 1. 先有一个普通的 继承自 MonoBehaviour 的脚本.2. 创建一个 Editor 文件夹, 写 关于 UnityEditor 的脚本 都要放在这个文件夹下,不然会编译出错.具体的实现如下: 1 using UnityEngine; 2 using UnityEditor; 3 using System.Collections; 4 5 [CustomEditor(typeof(TestBehaviour))] // 这里是表示,这个Editor是哪个脚本的界面 6 [CanEditMultipleObjects] // 可以一起编辑多个物体 7 public cla... 阅读全文
posted @ 2013-06-19 23:54 easyfrog 阅读(4399) 评论(1) 推荐(0) 编辑
摘要: 1 // 模拟一个处理消息队列的类 2 class MessageHandler 3 { 4 // 消息队列 5 private Queue<string> messageQue = new Queue<string>(); 6 private Thread th = null; 7 private bool can = true; 8 9 // 处理消息队列的方法10 void HandlerMessage() {11 while (can) {12 ... 阅读全文
posted @ 2013-06-17 21:55 easyfrog 阅读(1279) 评论(0) 推荐(0) 编辑
摘要: 1 using System; 2 using System.Collections.Generic; 3 using System.ComponentModel; 4 using System.Data; 5 using System.Drawing; 6 using System.Linq; 7 using System.Text; 8 using System.Windows.Forms; 9 using System.Threading;10 11 namespace InvokeTest12 {13 public partial class Form1 : Form14 ... 阅读全文
posted @ 2013-06-17 21:53 easyfrog 阅读(3288) 评论(3) 推荐(1) 编辑
摘要: 1 using System; 2 using System.Collections.Generic; 3 using System.Linq; 4 using System.Text; 5 using System.Threading; 6 7 namespace ThreadTest 8 { 9 class Program10 {11 // 信号 12 static AutoResetEvent ar = new AutoResetEvent(false);13 14 // 一个公用的变量15 static... 阅读全文
posted @ 2013-06-17 21:49 easyfrog 阅读(385) 评论(0) 推荐(0) 编辑
摘要: JavaScript中, 可以使用 Function创建对象 如:// 定义 MyClassA 对象 function MyClassA() { this.name = "easyfrog"; this.birth = 1982; sayHello = function(str) { alert("hello " + str + " My name is " this.name); } }// 创建 MyClassA对象 var MyClassAObj = new MyClassA();MyClassAObj.sayHello(&qu 阅读全文
posted @ 2013-04-19 14:43 easyfrog 阅读(177) 评论(0) 推荐(0) 编辑