24小时热门版块排行榜    

查看: 1040  |  回复: 2

zhangqian657

银虫 (小有名气)

[求助] C++调用NIST物性出错。。。求大神分析

这是NIST9.0里面Examples文件夹里面自带的c++调用物性的例子,但是编译之后就出错。。。小弟不才,求大神分析分析,什么原因??谢谢!!
源代码:
#include <windows.h>
#include <stdio.h>
#include "C:\Program Files\REFPROP\Examples\refprop1.h"
const long refpropcharlength=255;
const long filepathlength=255;
const long lengthofreference=3;
const long errormessagelength=255;
const long ncmax=20;               
const long numparams=72;
const long maxcoefs=50;


void main(int argc, char* argv[])
{
HINSTANCE RefpropdllInstance;
RefpropdllInstance = LoadLibrary("C:\program Files\refprop\refprop.dll";


      long i,ierr;
      char hf[refpropcharlength*ncmax], hrf[lengthofreference+1],
      herr[errormessagelength+1],hfmix[refpropcharlength+1];

      char *FLD_PATH;  
      FLD_PATH = "C:\\Program Files\\REFPROP\\fluids\\";
      strcpy(hf,FLD_PATH);
      strcpy(hfmix,FLD_PATH);

      i=1;
      strcpy(hf,"co2.fld";
      strcpy(hfmix,"hmx.bnc";
      strcpy(hrf,"DEF";
      strcpy(herr,"Ok";

      SETUPdll(i, hf, hfmix, hrf, ierr, herr,
      refpropcharlength*ncmax,refpropcharlength,
      lengthofreference,errormessagelength);
      if (ierr != 0) printf("%s\n",herr);

double wm,ttp,tnbp,tc,pc,dc,zc,acf,dip,rgas;
long info_index=1;
INFOdll(info_index,wm,ttp,tnbp,tc,pc,dc,zc,acf,dip,rgas);   //调用工质基本属性
printf("WM,ACF,DIP,TTP,TNBP   %10.4f,%10.4f,%10.4f,%10.4f,%10.4\n",wm,acf,dip,ttp,tnbp);
printf("TC,PC,DC,RGAS         %10.4f,%10.4f,%10.4f,%10.4f,%10.4f\n",tc,pc,dc,rgas);
}

编译后出错:
Loaded 'ntdll.dll', no matching symbolic information found.
Loaded 'C:\Windows\SysWOW64\kernel32.dll', no matching symbolic information found.
Loaded 'C:\Windows\SysWOW64\KernelBase.dll', no matching symbolic information found.
First-chance exception in 111.exe: 0xC0000005: Access Violation.
弹出对话框:
Unhandled exception in  111.exe: 0xc0000005:Access Violation.

求问大神,这是哪里有问题??这是软件自带的例子啊!!!谢谢了
回复此楼

» 收录本帖的淘帖专辑推荐

关注点

» 猜你喜欢

» 本主题相关价值贴推荐,对您同样有帮助:

已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

zhangqian657

银虫 (小有名气)

自顶一记,求大神
2楼2014-04-29 15:19:30
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

zhangqian657

银虫 (小有名气)

3楼2014-04-30 20:36:46
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
相关版块跳转 我要订阅楼主 zhangqian657 的主题更新
最具人气热帖推荐 [查看全部] 作者 回/看 最后发表
[基金申请] 咱们一起用铁证分析2026国家社科基金中标与否 +7 启萌科技 2026-08-12 27/1350 2026-08-18 21:44 by Noways
[教师之家] 为什么余额宝的年化利率越来越低?主要原因有哪些? +3 瞬息宇宙 2026-08-15 3/150 2026-08-18 21:40 by xiaohuixin
[基金申请] 2027广东省杰青 +3 奶牛小黑 2026-08-15 9/450 2026-08-18 20:09 by 奶牛小黑
[基金申请] 朋友圈看到的 +4 wangzilk 2026-08-18 5/250 2026-08-18 19:25 by wangzilk
[基金申请] 欢迎发来filecode的Mz6后的代码验证其规律 +51 医学老男孩 2026-08-13 110/5500 2026-08-18 19:07 by icerianxia
[基金申请] 明天放榜? +5 Shxjjxjkx 2026-08-18 5/250 2026-08-18 18:14 by -大大大大大-
[基金申请] 时间戳变了,能看出什么问题? +8 基诺咪客 2026-08-17 11/550 2026-08-18 17:13 by 悠然熊猫
[基金申请] 重要消息,中午系统在维护 +9 yuleib84 2026-08-18 10/500 2026-08-18 16:52 by archvillain
[论文投稿] 投稿咨询 +4 wwm09 2026-08-17 6/300 2026-08-18 15:36 by wwm09
[基金申请] 时间戳又变了8-15 +14 archvillain 2026-08-15 26/1300 2026-08-18 13:37 by phantomgost
[基金申请] 今天维护系统维护 祝所有人 高中 +8 gjjjzhong 2026-08-18 9/450 2026-08-18 13:01 by 家与远方
[基金申请] 哪位老哥知道今年的国自然具体哪一天放榜? +13 Ldrop2023 2026-08-13 16/800 2026-08-18 12:25 by 淀粉搬运工
[基金申请] 93BebMhtakh前后11位开头都是大写 +4 且听虎啸 2026-08-17 5/250 2026-08-18 00:49 by 蔡棒棒菂
[基金申请] 感觉是下周放榜了 +6 angus9576 2026-08-17 11/550 2026-08-17 23:57 by angus9576
[基金申请] filecode=后面第一个是大写字母 +8 wangze12014 2026-08-14 10/500 2026-08-17 17:05 by xter9665
[基金申请] 今天系统多次维护,明天很可能放榜! +8 zju2000 2026-08-16 9/450 2026-08-17 12:20 by lmz0216
[基金申请] 各位道友,我要去昆明玩几天,回来见。 +7 Tide man 2026-08-14 8/400 2026-08-15 01:11 by arzu_hma
[基金申请] 重要来源:本周末出结果 +10 瞬息宇宙 2026-08-12 10/500 2026-08-13 15:46 by likettle
[基金申请] 不应该看fileCode +7 且听虎啸 2026-08-12 9/450 2026-08-13 14:27 by flydreamws
[基金申请] 结合人工智能,周易传统文化,filecode打分制来了,3分以上希望很大。 +3 Tide man 2026-08-12 4/200 2026-08-13 08:35 by ZJTJZ
信息提示
请填处理意见