Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

Error in COM Server project

kissmequick
Principiante
1.165 Vistas
I have made my first COM Sever project with intel fortran compiler 11.0 yesterday.I followed the steps as

the web page shows(http://software.intel.com/sites/products/documentation/hpc/compilerpro/en-

us/fortran/win/compiler_f/bldaps_for/win/bldaps_create_fortcomsrv.htm),but unfortunately itfailed.

The error message I receive is given below,I want help to solve this iproblem! thank you

1 command line error MIDL1003 : error returned by the C preprocessor (1) midl

PS:I am a newbie in fortran programming and I need to learn mix programming between fortran and C# to

accomplish my research,I have no ideas how to make it ,I need some suggestion and I wish to get the skills

via some simple example
0 kudos
6 Respuestas
anthonyrichards
Nuevo Colaborador III
1.165 Vistas
Do you want to call Fortran from C# or access C# objects from Fortran?

Is VC++ installed? Is the source of your problem that you should specify that the MIDL compiler use the Fortran pre-processor instead of the default VC++ preprocessor, as described in the link?
kissmequick
Principiante
1.165 Vistas

My ultimate goal is to call a fortran EXE in a UI build by C#,and it can control the fortran EXE to suspend,quit or go on with new given parameters

I am sure VC++ is installed. I do not clearly understand the rules ofassigning the preprocessor,and I only made my setting the same way as the link shows

anthonyrichards
Nuevo Colaborador III
1.165 Vistas

So you have a C# GUI and want to do computations in Fortran?
Have you thought of just building a DLL from your Fortran code and exporting functions and routines for use by the C# driver? If that is the case, then search this forum for 'C#' and you may find previous posters have good advice for you.

kissmequick
Principiante
1.165 Vistas
yes,I have a C# GUI and want to do computations in Fortran,and Iintend to makethe computationin a seperate thread,becuse I want the computation always go on his work,and meanwhile I may use the data form the computation to do some visual displaying,so I thinkit isneed a Interface to delivery the data between the computational module and visualize module,that is the reason I choose COM Server,Is my way reasonable or not? or I still should try it with Dll?
I kown the real parallel work is difficult,so I am in a exploring to find a compromise way to do it.
anthonyrichards
Nuevo Colaborador III
1.165 Vistas
This reminds me of the old joke about a lost motorist seeking directions in Ireland. The reply he got was 'Well, If I was to go to Ballynahinch, I wouldn't be starting from here'.

Why are you using C# and COM? Why not use Vbasic or VC++, for which there loads of code available out there for using Dynamic Data Exchange, for example, to communicate between programs. You could bolt on the required C++ or VB code and use it to communicate with your Fortran programs. See here for a description of why DDE is faster and better than COM and for simple sample code.

http://www.angelfire.com/biz/rhaminisys/ddeapps.html

anthonyrichards
Nuevo Colaborador III
1.165 Vistas
It would appear that your initial query was not about a problem directly with the Fortran server but a problem in the IDL code that you have to write to access the com server from within your C# project.
Is that correct?
Does MIDL work with c#? That might be your problem.

You almost certainly need to talk to users of IDL and the MIDL compiler for clarification of your preprocessor problem. You will have to post the code that is giving you the errors you listed if you want any sensible help.
Responder