Michael,
I assume you are using TRNSYS16 coding style in your component. I'm not sure that the getMaxLabelLength() function works with the coding style.However, the function works fine in my TRNSYS'17' coding style component. The getDeckFileName() seems to me that the function does not care about C/C++ strings. I have got exactly same error. Unless, you modified the function to cope with C/C++ style, I think that you can not avoid the access violation error. For example, I have added the following new function in the TrnsysFunction.f90 to avoid the error. -TrnsysFunction.f90 Function getDeckFileNameEx() bind(c,name="getDeckFileNameEx") !dec$ attributes dllexport :: getDeckFileNameEx Use TrnsysData Use, intrinsic :: iso_c_binding type(C_ptr) :: getDeckFileNameEx Character(len=maxPathLength) ret ret = trim(deckn1)//CHAR(0) getDeckFileNameEx = C_LOC(ret) End Function getDeckFileNameEx - C/C++ Component sourcecode extern "C" __declspec(dllimport) char* _cdecl getDeckFileNameEx(void); char *dckfilename; dckfilename = getDeckFileNameEx(); I do not like this idea because an expensive Fortran compiler is needed to build. Does anyone know that how to call FORTRAN function returns characters? Best regards, Yuichi Yasuda quattro corporate design co.,ltd T2000 Bld. 4F, 1-11-29 Mita, Meguro-ku, Tokyo, 153-0062, Japan Tel:+81 (0)3 5768 6744 Fax:+81 (0)3 5768 6745 Email: yasuda@qcd.co.jp http://www.qcd.co.jp/ On 2016/05/21 0:22, Michael Holzhauser via TRNSYS-users wrote: Hello all,
|