²é¿´: 1774  |  »Ø¸´: 7

orential

ľ³æ (СÓÐÃûÆø)

[ÇóÖú] ½¨Á¢µ¥ÎĵµMFCµÄ¹¤³ÌÔõôµ÷ÓÃDLLÎļþ

VC++6.0????????MFC.exe????????????????????¨À??????DLL??????????????????????????????????????????????win32?????????????????????????DOS???????
?????¦Ë???????????????MFC.exe???????????DLL?????????????MFC?§Ñ????????????????????????????????????????
CODE:
#include
#include
#include "REFPROP1.H"

// Some constants...

const long refpropcharlength=255;
const long filepathlength=255;
const long lengthofreference=3;
const long errormessagelength=255;
const long ncmax=20;      // Note: ncmax is the max number of components
const long numparams=72;
const long maxcoefs=50;

int main(int argc, char* argv[])
{

// First create a pointer to an instance of the library
// Then have windows load the library.
HINSTANCE RefpropdllInstance;
//This looks only in the current directory for refprop.dll
???????X?e?N?X????Instance = LoadLibrary("./refprop.dll");

// Then get pointers into the dll to the actual functions.
  ABFL1dll = (fp_ABFL1dllTYPE) GetProcAddress(RefpropdllInstance,"ABFL1dll");
  ABFL2dll = (fp_ABFL2dllTYPE) GetProcAddress(RefpropdllInstance,"ABFL2dll");
  ACTVYdll = (fp_ACTVYdllTYPE) GetProcAddress(RefpropdllInstance,"ACTVYdll");
  AGdll = (fp_AGdllTYPE) GetProcAddress(RefpropdllInstance,"AGdll");
  

// Now use the functions.

// Refprop variables that need to be defined
//
// nc = Number of components in the mixture
// x[NumberOfComponentsInMixtures] = Mole fraction of each component
// ierr =An integer flag defining an error
// hf[] = a character array defining the fluids in a mixture
// hrf[] = a character array denoting the reference state
// herr[] = a character array for storing a string - Error message
// hfmix[] a character array defining the path to the mixture file

  ???N?I????? x[ncmax],xliq[ncmax],xvap[ncmax],f[ncmax];

  long i,ierr;
  char hf[refpropcharlength*ncmax], hrf[lengthofreference+1],
  ????e?e????e?e?N?e????Q?Q????????`??H??+1],hfmix[refpropcharlength+1];

  //Exlicitely set the fluid file PATH
  //char *FLD_PATH;
  //FLD_PATH = "C:\\Program Files\\REFPROP\\fluids\\";
//    strcpy(hf,FLD_PATH);
//    strcpy(hfmix,FLD_PATH);

    //...initialize the program and set the pure fluid component name
  //i=1;
  //strcpy(hf,"nitrogen.fld");
  //strcpy(hfmix,"hmx.bnc");
  //strcpy(hrf,"DEF");
  //strcpy(herr,"Ok");

//...For a mixture, use the following setup instead of the lines above.
  // Use "|" as the file name delimiter for mixtures
  ??=3;
  ?Q?H?e???X??(hf,"nitrogen.fld");
    strcat(hf,"|argon.fld");
    strcat(hf,"|oxygen.fld");
  ?Q?H?e???X??(hfmix,"hmx.bnc");
  ?Q?H?e???X??(hrf,"DEF");
    strcpy(herr,"Ok");
    x[0]=.7812; //Air composition
  ????1]=.0092;
  ????2]=.2096;

    //...Call SETUP to initialize the program
      SETUPdll(i, hf, hfmix, hrf, ierr, herr,
          ?e?????X?e?N?X?????e????`??H??*ncmax,refpropcharlength,
          ????`??H???N???e??????e??`????,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.4f\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);
//...Calculate molecular weight of a mixture
// ?b??=WMOLdll(x)

//...Get saturation properties given t,x; for i=1: x is liquid phase
//.....           ???N?e i=2: x is vapor phase

  ???N?I????? t=100.0;
    double p,dl,dv;

  ??ATTdll(t,x,i,p,dl,dv,xliq,xvap,ierr,herr,errormessagelength);
  ?X?e???`?H??("P,Dl,Dv,xl[0],xv[0] ??10.4f,%10.4f,%10.4f,%10.4f,%10.4f\n",p,dl,dv,xliq[0],xvap[0]);
  ??=2;
  ??ATTdll(t,x,i,p,dl,dv,xliq,xvap,ierr,herr,errormessagelength);
  ?X?e???`?H??("P,Dl,Dv,xl[0],xv[0] ??10.4f,%10.4f,%10.4f,%10.4f,%10.4f\n",p,dl,dv,xliq[0],xvap[0]);

//...Other routines are given in UTILITY.FOR


return 0;
}
[color=Red]Sample Text[/color]4]Sample Text[/size]
typedef void (__stdcall *fp_ABFL1dllTYPE)(double &,double &,double *,long &,double &,double &,double &,double &,double &,double &,long &,char*,long );
typedef void (__stdcall *fp_ABFL2dllTYPE)(double &,double &,double *,long &,long &,double &,double &,double &,double &,double &,double &,double &,double *,double *,double &,double &,double &,double &,double *,double *,double &,long &,char*,long );
typedef void (__stdcall *fp_ACTVYdllTYPE)(double &,double &,double *,double &);
typedef void (__stdcall *fp_AGdllTYPE)(double &,double &,double *,double &,double &);


//Define explicit function pointers
fp_ABFL1dllTYPE ABFL1dll;
fp_ABFL2dllTYPE ABFL2dll;
fp_ACTVYdllTYPE ACTVYdll;
fp_AGdllTYPE AGdll;

[ Last edited by jjdg on 2012-12-19 at 03:35 ]
»Ø¸´´ËÂ¥

» ²ÂÄãϲ»¶

» ±¾Ö÷ÌâÏà¹Ø¼ÛÖµÌùÍÆ¼ö£¬¶ÔÄúͬÑùÓаïÖú:

Â仨ËäÓÐÒ⣬³úÍ·±¾ÎÞÇé
ÒÑÔÄ   »Ø¸´´ËÂ¥   ¹Ø×¢TA ¸øTA·¢ÏûÏ¢ ËÍTAºì»¨ TAµÄ»ØÌû

orential

ľ³æ (СÓÐÃûÆø)

Ôõô´úÂëÕ³µ½ÀïÃæ±ä³ÉÂÒÂëÁË
Â仨ËäÓÐÒ⣬³úÍ·±¾ÎÞÇé
2Â¥2012-12-16 21:33:53
ÒÑÔÄ   »Ø¸´´ËÂ¥   ¹Ø×¢TA ¸øTA·¢ÏûÏ¢ ËÍTAºì»¨ TAµÄ»ØÌû

ºúÊ÷¼á

гæ (³õÈëÎÄ̳)

¡¾´ð°¸¡¿Ó¦Öú»ØÌû

¸Ðл²ÎÓ룬ӦÖúÖ¸Êý +1
ʵÔÚ²»ÄܰïÄ㣬ȫÊÇÂÒÂ룬Èç¹û¿ÉÒԵϰ£¬¿ÉÒÔ°Ù¶ÈһϿ´¿´DLLµÄÓ÷¨
3Â¥2012-12-17 20:34:44
ÒÑÔÄ   »Ø¸´´ËÂ¥   ¹Ø×¢TA ¸øTA·¢ÏûÏ¢ ËÍTAºì»¨ TAµÄ»ØÌû

orential

ľ³æ (СÓÐÃûÆø)

ÒýÓûØÌû:
3Â¥: Originally posted by ºúÊ÷¼á at 2012-12-17 20:34:44
ʵÔÚ²»ÄܰïÄ㣬ȫÊÇÂÒÂ룬Èç¹û¿ÉÒԵϰ£¬¿ÉÒÔ°Ù¶ÈһϿ´¿´DLLµÄÓ÷¨

ллΧ¹Û£¬²»ÖªµÀΪʲôð¤Ìù½øÀ´¾Í³ÉÂÒÂëÁË
Â仨ËäÓÐÒ⣬³úÍ·±¾ÎÞÇé
4Â¥2012-12-18 09:28:25
ÒÑÔÄ   »Ø¸´´ËÂ¥   ¹Ø×¢TA ¸øTA·¢ÏûÏ¢ ËÍTAºì»¨ TAµÄ»ØÌû

zhanglinfeng

гæ (СÓÐÃûÆø)

¡¾´ð°¸¡¿Ó¦Öú»ØÌû

¸Ðл²ÎÓ룬ӦÖúÖ¸Êý +1
Ê×ÏÈÒª°üº¬ÄãËùÒªÁ¬½ÓµÄ¶¯Ì¬Á¬½Ó¿âµÄÍ·Îļþ,È»ºóÔÚÉèÖñêÇ©ÏÂÓÐÁ¬½ÓÑ¡Ïî,È»ºóÔÚ×îºóÊäÈëÄãË÷ÒªÁ¬½ÓµÄ¶¯Ì¬Á¬½Ó¿âµÄÃû³Æ
5Â¥2012-12-18 18:47:45
ÒÑÔÄ   »Ø¸´´ËÂ¥   ¹Ø×¢TA ¸øTA·¢ÏûÏ¢ ËÍTAºì»¨ TAµÄ»ØÌû

orential

ľ³æ (СÓÐÃûÆø)

ÒýÓûØÌû:
5Â¥: Originally posted by zhanglinfeng at 2012-12-18 18:47:45
Ê×ÏÈÒª°üº¬ÄãËùÒªÁ¬½ÓµÄ¶¯Ì¬Á¬½Ó¿âµÄÍ·Îļþ,È»ºóÔÚÉèÖñêÇ©ÏÂÓÐÁ¬½ÓÑ¡Ïî,È»ºóÔÚ×îºóÊäÈëÄãË÷ÒªÁ¬½ÓµÄ¶¯Ì¬Á¬½Ó¿âµÄÃû³Æ

ÄãÕâ¸öÊÇÒþʽµ÷Óðɣ¬ÎÒÊÇÒªÏÔʾµ÷ÓÃDLLµÄ£¬ÒòΪÈí¼þÌṩµÄDLLÊÇ·â×°ºÃµÄ¡£
Â仨ËäÓÐÒ⣬³úÍ·±¾ÎÞÇé
6Â¥2012-12-19 10:55:59
ÒÑÔÄ   »Ø¸´´ËÂ¥   ¹Ø×¢TA ¸øTA·¢ÏûÏ¢ ËÍTAºì»¨ TAµÄ»ØÌû

¾ý×ÓÖ®½»437

½ð³æ (СÓÐÃûÆø)

ÇëÎÊÄúµÄÕâ¸öÎÊÌâ½â¾öÁËÂð£¬Ð¡µÜÎÒÒ²Óöµ½Á˺ÍÄúÒ»ÑùµÄÎÊÌ⣬ÏëÇë½ÌÄúһϣ¬ÐÐÂð

[ ·¢×ÔÊÖ»ú°æ http://muchong.com/3g ]
7Â¥2013-05-11 03:28:51
ÒÑÔÄ   »Ø¸´´ËÂ¥   ¹Ø×¢TA ¸øTA·¢ÏûÏ¢ ËÍTAºì»¨ TAµÄ»ØÌû

coralmaomao

гæ (³õÈëÎÄ̳)

Â¥Ö÷£¬ÎÒÓõÄͬÑùµÄ½Ó¿Ú³öÏÖÁËaccess voilation ´íÎó£¬Çó°ï棡·Ç³£¸Ðл£¡£¡£¡£¡
8Â¥2015-06-06 11:06:37
ÒÑÔÄ   »Ø¸´´ËÂ¥   ¹Ø×¢TA ¸øTA·¢ÏûÏ¢ ËÍTAºì»¨ TAµÄ»ØÌû
Ïà¹Ø°æ¿éÌø×ª ÎÒÒª¶©ÔÄÂ¥Ö÷ orential µÄÖ÷Ìâ¸üÐÂ
×î¾ßÈËÆøÈÈÌûÍÆ¼ö [²é¿´È«²¿] ×÷Õß »Ø/¿´ ×îºó·¢±í
[¿¼ÑÐ] 285»¯¹¤Ñ§Ë¶Çóµ÷¼Á£¨081700£© +7 ²ñ¿¤Ã¨_ 2026-03-12 7/350 2026-03-17 09:20 by ÎíÉ¢ºóÏàÓölc
[¿¼ÑÐ] 08¹¤¿Æ 320×Ü·Ö Çóµ÷¼Á +3 À滨çóÍí·ç 2026-03-17 3/150 2026-03-17 09:04 by êÏêϵ÷¼ÁÉϰ¶
[»ù½ðÉêÇë] ¹ú×Ô¿ÆÃæÉÏ»ù½ð×ÖÌå +6 iwuli 2026-03-12 7/350 2026-03-16 21:18 by sculhf
[¿¼ÑÐ] 286Çóµ÷¼Á +3 lemonzzn 2026-03-16 5/250 2026-03-16 20:43 by lemonzzn
[¿¼ÑÐ] 085601Çóµ÷¼Á +3 Du.11 2026-03-16 3/150 2026-03-16 20:42 by Î޼ʵIJÝÔ­
[¿¼ÑÐ] ²ÄÁÏר˶306Ó¢Ò»Êý¶þ +4 z1z2z3879 2026-03-16 6/300 2026-03-16 19:38 by z1z2z3879
[¿¼ÑÐ] 283Çóµ÷¼Á +10 С¥¡£ 2026-03-12 14/700 2026-03-16 16:08 by 13811244083
[¿¼ÑÐ] 0703 ÎïÀí»¯Ñ§µ÷¼Á +3 ÎÒ¿ÉÒÔÉϰ¶µÄ¶Ô 2026-03-13 5/250 2026-03-16 10:50 by ÎÒ¿ÉÒÔÉϰ¶µÄ¶ÔÂ
[¿¼ÑÐ] ²ÄÁÏ080500µ÷¼ÁÇóÊÕÁô +3 Ò»¿Åmeteor 2026-03-13 3/150 2026-03-14 10:54 by peike
[»ù½ðÉêÇë] ÓбØÒª¸ü»»É걨¿ÚÂð 20+3 fannyamoy 2026-03-11 3/150 2026-03-14 00:52 by zhanghaozhu
[¿¼ÑÐ] Ò»Ö¾Ô¸»ªÖÐũҵ´óѧ071010£¬×Ü·ÖÈý°Ù¶þ,Çóµ÷¼Á +3 À§À§À§À§À¤À¤ 2026-03-10 3/150 2026-03-14 00:35 by JourneyLucky
[¿¼ÑÐ] 279Çóµ÷¼Á +3 ×¥×ÅÐÇÐǵÄÅ®º¢ 2026-03-10 3/150 2026-03-13 23:47 by userper
[¿¼ÑÐ] ²ÄÁÏ371Çóµ÷¼Á +9 öùÓã? 2026-03-11 11/550 2026-03-13 22:53 by JourneyLucky
[¿¼ÑÐ] 0703£¬333·ÖÇóµ÷¼Á Ò»Ö¾Ô¸Ö£ÖÝ´óѧ-ÎïÀí»¯Ñ§ +3 Àîħٶ·Åñ 2026-03-11 3/150 2026-03-13 22:24 by JourneyLucky
[¿¼ÑÐ] 0703»¯Ñ§Ò»Ö¾Ô¸211 ×Ü·Ö320Çóµ÷¼Á +5 Â꿨°Í¿¨°¡¹þ 2026-03-11 5/250 2026-03-13 21:40 by JourneyLucky
[¿¼ÑÐ] 333Çóµ÷¼Á +3 ÇòÇò¹ÅÁ¦ 2026-03-11 3/150 2026-03-13 21:27 by JourneyLucky
[¿¼ÑÐ] 281Çóµ÷¼Á +9 Koxui 2026-03-12 11/550 2026-03-13 20:50 by Koxui
[¿¼ÑÐ] 328»¯¹¤×¨Ë¶Çóµ÷¼Á +4 ¡££¬¡££¬¡££¬¡£i 2026-03-12 4/200 2026-03-13 14:44 by JourneyLucky
[¿¼ÑÐ] 0856»¯¹¤Ô­Àí +6 z2839474511 2026-03-10 6/300 2026-03-13 10:41 by houyaoxu
[¿¼ÑÐ] 321Çóµ÷¼Á£¨Ê³Æ·/ר˶£© +3 xc321 2026-03-12 6/300 2026-03-13 08:45 by xc321
ÐÅÏ¢Ìáʾ
ÇëÌî´¦ÀíÒâ¼û