[TRNSYS-users] functions get.. type char

javier mota fjmi_3i at hotmail.com
Wed Aug 10 03:48:20 PDT 2005


I think i will try to Recompile trnlib.dll with release mode. as i have 
told.
Where is this lybrary and how I must recompile it.
Thanks in advance


>From: Yoshihiro Yamaguchi <yamaguti at alpha-net.ne.jp>
>To: "javier mota" <fjmi_3i at hotmail.com>, trnsys-users at engr.wisc.edu
>Subject: Re: [TRNSYS-users] functions  get.. type char
>Date: Wed, 10 Aug 2005 17:59:08 +0900
>
>Dear Javier,
>
>I am trying to write trnsys16 components in C++.
>But, there are a few problem, as far as I see.
>
>In your case, I think C++ runtime library, which is linked with
>your DLL, is inconsistent with that of trnlib.dll.
>
>Try to do followings,
>
>- Recompile trnlib.dll with release mode.
>(The problem in debug mode is trnlib.dll is linking both msvcrt.dll
>and msvcrtd.dll.  It is not good.  I could not fix the conflict for now.)
>- In your DLL project, change the compile option like the attached png
>file.  ( you don't care where it is release or debug mode ).
>
>It worked at least in my environment.
>
>Good luck.
>
>Yoshihiro
>
> > Dear all:
> > IƒGm Javier mota from 3i, Madrid;once more.
> > I have a problem with the functions getwhich returns a character type 
>like
> > (e.g. getDeckFileName).
> > I am using trnsys16 and I would like use this functions in c++
> >
> > I have among other lines in Trnsys.h
> >
> > extern "C" __declspec(dllimport) char*_cdecl
> > TRNSYSFUNCTIONS_mp_GETDECKFILENAME(void);
> > and
> > #define getDeckFileName	TRNSYSFUNCTIONS_mp_GETDECKFILENAME
> >
> > and in TRNSYSFUNCTIONS.f90 something like
> >
> > function getTrnsysInputFileDir()
> >     !dec$ attributes dllexport, c, reference, nomixed_str_len_arg ::
> > getTrnsysInputFileDir
> >     !dec$ attributes alias:"TRNSYSFUNCTIONS_mp_GETTRNSYSINPUTFILEDIR",
> > decorate :: getTrnsysInputFileDir
> >     use TrnsysData
> >     character (len=maxPathLength) :: getTrnsysInputFileDir
> >     getTrnsysInputFileDir = TrnsysInputFileDir
> > end function getTrnsysInputFileDir
> >
> > so I write in my program:
> > char *gg;
> > gg= getTrnsysInputFileDir();
> >
> >
> > I donƒGt have problem in making dll but when I run the program in trnys 
>I get
> > an access violation error
> > You mus be sure I would like solve this problem,
> > Thank you
>
>=====================================
>   Yoshihiro Yamaguchi    ŽRŒû@–FO
>   yamaguti at alpha-net.ne.jp
>=====================================
><< setting.PNG >>

_________________________________________________________________
Moda para esta temporada. Ponte al día de todas las tendencias. 
http://www.msn.es/Mujer/moda/default.asp




More information about the TRNSYS-users mailing list