Forcal程序设计基础教程
Forcal程序设计基础教程:循序渐进Forcal例程Forcal程序设计基础教程:如何在Forcal中添加对象
Forcal程序设计基础教程:Forcal扩展动态库
Forcal程序设计基础教程:如何在Forcal扩展库中添加对象
Forcal程序设计基础教程:在软件中加入Forcal & MForcal支持
什么是forcal? 什么是forcal?
chendongyi 发表于 2010-9-24 20:16 http://www.madio.net/static/image/common/back.gif
参考:http://www.madio.net/thread-102175-1-1.html
一个简单的c#调用Forcal的例子using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.InteropServices;
public class forcal
{
public static extern bool InitForcal();
//使用Unicode字符集
public static extern int RealCom(string ForStr, int nModule, ref int hFor, ref int nPara, ref int Para, ref int ErrBegin, ref int ErrEnd);
public static extern double RealCal(int hFor, double[] d);
public static extern void FreeForcal();
}
namespace CsharpForcal
{
class Program
{
static void Main(string[] args)
{
bool flag = false;
int code = 0;
int hFor = 0; //必须为0,否则是一个加锁模块的函数指针
int nModule = 1;
int len = 0;
int Para = 0;
int e1 = 0;
int e2 = 0;
double[] MyArgs = new double { 2, 3 };
flag = forcal.InitForcal();
string s = "f(x,y)=x+y";
code = forcal.RealCom(s, nModule, ref hFor, ref len, ref Para, ref e1, ref e2);
Console.Write(code);
if (code == 0)
{
double dd = forcal.RealCal(hFor, MyArgs);
Console.Write("\r\n结果=");
Console.Write(dd);
Console.Write("\r\n");
}
forcal.FreeForcal();
}
}
} 本站名称:IT9网络学院论坛
IT9网络学院描述简介:'IT9网络学院,中国IT远程培训门户网站,一直致力于提供全面、专业、权威的电脑技术培训,内容包括视频教程,语音教程,黑客教学,软件技巧,软件新闻,业内资讯,平面设计,图片处理,三维设计,FLASH动画,网络应用,组网,病毒信息,QQ聊天,ADSL,网页设计,系统优化,系统技巧等各种软件应用、技巧以及解决方案等是国内大的计算机教程库.IT9网络学院是大家学习专业计算机知识的最佳场所
主站地址:it9.com
论坛地址:bbs.it9.com
VIP站地址:vip.it9.com
还希望斑竹手下留情,不要删此帖!谢谢。诚心和贵站交换友情连接!
static/image/common/sigline.gif
*****************************************************
IT9网络学院 it9.com/
IT9学院论坛 bbs.it9.com/
内容最全、实力最强、专业的网络技术及IT精英培养基地 辛苦辛苦,谢谢了~~
页:
[1]