{"id":979,"date":"2010-03-22T16:22:00","date_gmt":"2010-03-22T08:22:00","guid":{"rendered":""},"modified":"2013-11-17T11:41:18","modified_gmt":"2013-11-17T03:41:18","slug":"idl%e4%b8%8ec%e6%b7%b7%e5%90%88%e7%bc%96%e7%a8%8b%e5%ae%9e%e7%8e%b0","status":"publish","type":"post","link":"https:\/\/kyle.ai\/blog\/979.html","title":{"rendered":"IDL\u4e0eC#\u6df7\u5408\u7f16\u7a0b\u5b9e\u73b0"},"content":{"rendered":"<p>\u8f6c\u8f7d\u8bf7\u6ce8\u660e\u51fa\u5904\uff0c\u8c22\u8c22\uff01<\/p>\n<p>\u9996\u9875\u4fdd\u8bc1\u5148\u5b89\u88c5\u4e86IDL7.0\u73af\u5883\u3002\u6253\u5f00VS2008\uff0c\u65b0\u5efaC#\u9879\u76ee\uff0c\u7136\u540e\u5728\u5de5\u5177\u7bb1\u4e2d\u53f3\u952e\uff0c\u9009\u62e9\u9879\uff0c\u627e\u5230COM\u7ec4\u4ef6\u4e2d\u7684IDLDrawWidget Control\uff0c\u6253\u4e0a\u52fe\u3002\u5982\u56fe\uff1a<\/p>\n<p><img decoding=\"async\" src=\".\/wp-content\/uploads\/hibaidu\/3ab6a81f5fb4022a413417b8.jpg\" alt=\"\" border=\"0\" \/><\/p>\n<p>\u786e\u5b9a\u540e\u5de5\u5177\u7bb1\u4e2d\u5c31\u4f1a\u591a\u51fa\u4e00\u4e2a\u5de5\u5177\uff0c\u5c06\u5176\u62d6\u653e\u5230\u7a97\u4f53\u4e0a<\/p>\n<p><img decoding=\"async\" src=\".\/wp-content\/uploads\/hibaidu\/b4ced9cbfca6f573f21fe786.jpg\" alt=\"\" border=\"0\" \/><br \/>\n\u53cc\u51fb\u7a97\u4f53\uff0c\u5199\u7a97\u4f53\u751f\u6210\u65f6\u7684\u521d\u59cb\u5316IDL\u4ee3\u7801\uff1a<\/p>\n<pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\r\nprivate void Form1_Load(object sender, EventArgs e)\r\n        {\r\n            int n;\r\n            axIDLDrawWidget1.IdlPath = @&quot;D:\\Program Files\\IDL7\\IDL70\\bin\\bin.x86\\idl.dll&quot;;\r\n            n = axIDLDrawWidget1.InitIDL((int)this.Handle);\r\n            if (n == 0)\r\n            {\r\n                MessageBox.Show(&quot;IDL\u63a7\u4ef6\u521d\u59cb\u5316\u5931\u8d25&quot;);\r\n            }\r\n        }\r\n<\/pre>\n<p>\u5176\u4e2d<br \/>\nD:\\Program Files\\IDL7\\IDL70\\bin\\bin.x86\\idl.dll \u662f\u81ea\u5df1\u5b89\u88c5IDL\u65f6\u7684\u8def\u5f84\u3002\u5f85\u4f1a\u6211\u4eec\u63d0\u53d6\u76f8\u5e94\u7684dll\u540e\u5c31\u53ef\u4ee5\u6539\u6389\u8fd9\u4e2a\u8def\u5f84\u3002\u7136\u540e\u6211\u4eec\u5199\u4e00\u4e2a\u8fd0\u884cIDL\u547d\u4ee4\u7684\u51fd\u6570\uff0c\u5982\u4e0b\uff1a<\/p>\n<pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\r\npublic int IDLEstr(string cmdstr)\r\n        {\r\n            int n;\r\n            n = axIDLDrawWidget1.ExecuteStr(cmdstr);\r\n            return n;\r\n        }\r\n<\/pre>\n<p>\u7136\u540e\u6211\u4eec\u653e\u4e00\u4e2a\u6309\u94ae\uff0c\u5199\u4e0a\u8fd0\u884c\u6211\u4eec\u4e8b\u5148\u751f\u6210\u597d\u7684sav\u6587\u4ef6\u7684\u4ee3\u7801\uff1a<\/p>\n<pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\r\nprivate void button2_Click(object sender, EventArgs e)\r\n        {\r\n            string cmd = &quot;@print&quot;;\r\n            IDLEstr(&quot;Restore,'print.sav'&quot;);\/\/\u7f16\u8bd1\u7a0b\u5e8f\r\n            IDLEstr(cmd);\r\n        }\r\n<\/pre>\n<p>\u5176\u4e2dprint.pro\u7684\u4ee3\u7801\u5982\u56fe\uff1a<br \/>\n<img decoding=\"async\" src=\".\/wp-content\/uploads\/hibaidu\/ba3575f5635d9decf3d38565.jpg\" alt=\"\" border=\"0\" \/><\/p>\n<p>\u751f\u6210sav\u6587\u4ef6\u7684\u65b9\u6cd5\u5982\u56fe\uff1a<br \/>\n<img decoding=\"async\" src=\".\/wp-content\/uploads\/hibaidu\/c4e48311c084c734213f2e86.jpg\" alt=\"\" border=\"0\" \/><\/p>\n<p>\u751f\u6210\u597dsav\u6587\u4ef6\u540e\u5c06sav\u6587\u4ef6\u8003\u5230\u6211\u4eec\u7684\u9879\u76ee\u6587\u4ef6\u5939\u4e0b\u9762\uff0c\u4e0e\u6211\u4eec\u7684exe\u6587\u4ef6\u5728\u4e00\u8d77\u3002<br \/>\n\u7136\u540e\u6211\u4eec\u518d\u653e\u4e00\u4e2a\u6587\u672c\u6846\uff0c\u4e00\u4e2a\u6309\u94ae\uff0c\u6309\u94ae\u4e8b\u4ef6\u5199\u4e0a\u8fd0\u884c\u6587\u672c\u6846\u91cc\u9762\u7684IDL\u547d\u4ee4\uff0c\u4ee3\u7801\u5982\u4e0b\uff1a<\/p>\n<pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\r\nprivate void button1_Click(object sender, EventArgs e)\r\n        {\r\n            IDLEstr(textBox1.Text.ToString().Trim());\r\n        }\r\n<\/pre>\n<p>OK\uff0c\u5230\u8fd9\u91cc\u5c31\u53ef\u4ee5\u8fd0\u884c\u6211\u4eec\u7684\u7a0b\u5e8f\u4e86\uff0c\u5982\u56fe\uff1a<\/p>\n<p><img decoding=\"async\" src=\".\/wp-content\/uploads\/hibaidu\/040c5261d532a1ea8cb10d6b.jpg\" alt=\"\" border=\"0\" \/><br \/>\n\u4e0b\u9762\u6211\u4eec\u88c5\u63d0\u53d6\u6211\u4eec\u7a0b\u5e8f\u6240\u987b\u8981\u7684IDL\u7cfb\u7edf\u6587\u4ef6\uff0c\u4f7f\u7a0b\u5e8f\u8131\u79bbIDL\u73af\u5883\u4e5f\u53ef\u4ee5\u8fd0\u884c\u548c\u4f7f\u7528\u3002<br \/>\n\u63d0\u53d6\u5176\u5b9e\u5f88\u7b80\u5355\uff0c\u5230\u53e6\u4e00\u4e2a\u73af\u5883\u53bb\u8fd0\u884c\uff0c\u7136\u540e\u7a0b\u5e8f\u63d0\u793a\u5c11\u4ec0\u4e48\u6587\u4ef6\uff0c\u5c31\u628a\u4ec0\u4e48\u6587\u4ef6\u62f7\u8fc7\u6765\u5c31\u884c\u4e86\u3002\u6211\u8fd9\u91cc\u7528\u53e6\u4e00\u79cd\u6bd4\u8f83\u5de7\u5999\u7684\u65b9\u6cd5\u3002<br \/>\n\u6211\u4eec\u8fd0\u884c\u6211\u4eec\u7684\u7a0b\u5e8f\uff0c\u7136\u540e\u5230IDL\u7cfb\u7edf\u76ee\u5f55bin.x86\u4e0b\u9762\uff0c\u4e5f\u5c31\u662fidl.dll\u6587\u4ef6\u6240\u5728\u7684\u6587\u4ef6\u5939\uff0c\u7136\u540e\u6211\u4eec\u5168\u9009\uff0c\u6309\u5220\u9664\u952e\uff0c\u786e\u5b9a\u5220\u9664\uff0c\u8fd9\u65f6\u7cfb\u7edf\u4f1a\u63d0\u793a\u6709\u4e9b\u6587\u4ef6\u4e0d\u80fd\u88ab\u5220\u6389\uff0c\u56e0\u4e3a\u6b63\u5728\u88ab\u6211\u4eec\u7684\u7a0b\u5e8f\u6240\u4f7f\u7528\uff0c\u90a3\u4e48\u8fd9\u4e9b\u6ca1\u80fd\u5220\u6389\u7684\u6587\u4ef6\u5c31\u662f\u6211\u4eec\u7a0b\u5e8f\u6240\u987b\u8981\u7684\u4e1c\u897f\u4e86\uff0c\u6211\u4eec\u628a\u5b83\u4eec\u62f7\u51fa\u6765\u3002<br \/>\n\u7167\u5982\u6b64\u65b9\u6cd5\uff0c\u76f8\u5e94\u4e5f\u53ef\u53d1\u73b0\u6211\u4eec\u8fd8\u987b\u8981resource\/fonts\/hersh1.chr\u6587\u4ef6\uff0c\u8fd8\u6709\u5c31\u662flicence\/licence.dat\u6587\u4ef6\u3002<br \/>\n\u6700\u540e\u5217\u51fa\u6240\u6709\u987b\u8981\u6587\u4ef6\u7684\u7ed3\u6784\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n.exe\r\n.sav\r\nAxInterop.IDLDRAWX3Lib.dll\r\nInterop.IDLDRAWX3Lib.dll\r\nIDL\\include\\bin.x86\\freetype2_1_3.dll\r\nIDL\\include\\bin.x86\\gl_driver.dll\r\nIDL\\include\\bin.x86\\idl.dll\r\nIDL\\include\\bin.x86\\MesaGL6_2.dll\r\nIDL\\include\\bin.x86\\MesaGLU6_2.dll\r\nIDL\\include\\bin.x86\\osmesa6_2.dll\r\nIDL\\include\\bin.x86\\ug3220.dll\r\nIDL\\resource\\fonts\\hersh1.chr\r\nIDL\\license.dat\r\n<\/pre>\n<p><img decoding=\"async\" src=\".\/wp-content\/uploads\/hibaidu\/1fd2c01a4ef002cfae51333f.jpg\" alt=\"\" border=\"0\" \/><\/p>\n<p>\u6700\u540e\u7a0b\u5e8f\u5b8c\u6574\u4ee3\u7801\u5982\u4e0b\uff1a<\/p>\n<pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\r\nusing System;\r\nusing System.Collections.Generic;\r\nusing System.ComponentModel;\r\nusing System.Data;\r\nusing System.Drawing;\r\nusing System.Linq;\r\nusing System.Text;\r\nusing System.Windows.Forms;\r\n\r\nnamespace IDLTest1\r\n{\r\n    public partial class Form1 : Form\r\n    {\r\n        public Form1()\r\n        {\r\n            InitializeComponent();\r\n        }\r\n\r\n        private void Form1_Load(object sender, EventArgs e)\r\n        {\r\n            int n;\r\n            \/\/axIDLDrawWidget1.IdlPath = @&quot;D:\\Program Files\\IDL7\\IDL70\\bin\\bin.x86\\idl.dll&quot;;\r\n            axIDLDrawWidget1.IdlPath = @&quot;IDL\\include\\bin.x86\\idl.dll&quot;;\r\n            n = axIDLDrawWidget1.InitIDL((int)this.Handle);\r\n            if (n == 0)\r\n            {\r\n                MessageBox.Show(&quot;IDL\u63a7\u4ef6\u521d\u59cb\u5316\u5931\u8d25&quot;);\r\n            }\r\n        }\r\n\r\n        public int IDLEstr(string cmdstr)\r\n        {\r\n            int n;\r\n            n = axIDLDrawWidget1.ExecuteStr(cmdstr);\r\n            return n;\r\n        }\r\n\r\n        private void button1_Click(object sender, EventArgs e)\r\n        {\r\n            IDLEstr(textBox1.Text.ToString().Trim());\r\n        }\r\n\r\n        private void button2_Click(object sender, EventArgs e)\r\n        {\r\n            string cmd = &quot;@print&quot;;\r\n            IDLEstr(&quot;Restore,'print.sav'&quot;);\/\/\u7f16\u8bd1\u7a0b\u5e8f\r\n            IDLEstr(cmd);\r\n        }\r\n    }\r\n}\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u8f6c\u8f7d\u8bf7\u6ce8\u660e\u51fa\u5904\uff0c\u8c22\u8c22\uff01 \u9996\u9875\u4fdd\u8bc1\u5148\u5b89\u88c5\u4e86IDL7.0\u73af\u5883\u3002\u6253\u5f00VS2008\uff0c\u65b0\u5efaC#\u9879\u76ee\uff0c\u7136\u540e\u5728\u5de5\u5177\u7bb1\u4e2d\u53f3\u952e\uff0c [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[],"class_list":["post-979","post","type-post","status-publish","format-standard","hentry","category-diary"],"_links":{"self":[{"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/posts\/979","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/comments?post=979"}],"version-history":[{"count":4,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/posts\/979\/revisions"}],"predecessor-version":[{"id":4559,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/posts\/979\/revisions\/4559"}],"wp:attachment":[{"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/media?parent=979"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/categories?post=979"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/tags?post=979"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}