||
最近,写了个小程序,利用C#调用IDL的Pro或者sav程序批处理遥感数据,程序初始化阶段就崩溃,代码如下
COM_IDL_connectClass COM = new COM_IDL_connectClass();
COM.CreateObject(0, 0, 0);
string appPath=Application.StartupPath;
COM.ExecuteString(".COMPILE "+appPath+"\\CalcNDVI.pro");
COM.ExecuteString("CalcNDVI");
通过查看idl安装目录(C:\Program Files\Exelis\IDL85\resource\bridges\export\COM),发现还有另外一个DLL,名为COM_IDL_connect_x86_64.dll,在工程添加引用加载该DLL,代码修改为:
COM_IDL_connect_x86_64Class COM = new COM_IDL_connect_x86_64Class();
COM.CreateObject(0, 0, 0);
string appPath=Application.StartupPath;
COM.ExecuteString(".COMPILE "+appPath+"\\CalcNDVI.pro");
COM.ExecuteString("CalcNDVI");
问题成功解决。
Archiver|手机版|科学网 ( 京ICP备07017567号-12 )
GMT+8, 2024-12-28 15:43
Powered by ScienceNet.cn
Copyright © 2007- 中国科学报社