- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have an application in Fortran needs to connect to .Net WCF service, which is written in VS C++. The WCF service allows client to connect to it and access the functions defined inside it. I have a smple of Wcfclient written in C++ to show how to access WCF service.The WCF service should allow both Fortran and C++ client to access.
However, how do I call functions defined in WCF service since .Net WCF doesn't allow to use traditional C++ libraray attributes, such as "extern C.."
The source code of .Net WCF service and sample of C++ client code are attached.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Roanna,
I haven´t examined your code because I don´t have much time today...
Here is what I did when I added CORBA functionality to my fortran code. I wrote a C++ lib that received the CORBA calls from a WPF GUI and this lib called the proper fortran routines. Then I linked this lib into my fortran project. Here is an example:
[cpp]
extern "C" void SAVEPROJECT(const char*, CORBA::Long*);
void DataExchange_i::saveDFCProjectFile(const char* filename)
{
CORBA::Long lenFilename = sizeof(filename);
SAVEPROJECT(filename, &lenFilename);
}[/cpp]
[fortran]
subroutine saveProject(filename)
!DEC$ ATTRIBUTES DLLEXPORT :: saveProject
!DEC$ ATTRIBUTES ALIAS: '_SAVEPROJECT' :: saveProject
! some code
end subroutine saveProject
[/fortran]
From my WPF GUI I call saveDFCProjectFile and this calls saveProject in my fortran code. Maybe you could do something like this with WCF too.
Markus
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Markus,
This is a very good idea. Insteading of making Fortran to call WCF, I could make a C++ program to call both Fortran and WCF to exchange data. I am going to give a try.
Thanks.
Roanna

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page