6

I am trying to create an integration between a 3rd party Lisp-based program (Let's call it ABC) and a C# program I have written myself (let's call it DEF). The problem is that ABC can only call assemblies created in C or Fortran. So I started learning C, and I got the "hello world" test to work, where ABC call my C dll and gets "hello world" in return. The I tried to call my DEF dll from the C code using explicit loading and GetProcAddress. It worked if I called another C dll, but not a C# dll. Now I wonder if I must learn C++ and call C# from C++ to create this nice call chain:

ABC -> C -> C++ -> DEF(C#) -> C++ -> C -> ABC

If that is the only way, can anyone help me with some examples etc?

2
  • 1
    Did you register your c# dll for COM interop? I've done it in the past, it is possible. Commented Apr 26, 2012 at 14:27
  • Don't forget to mark your question answered if it is (check the hook under the answer's downvote button). Commented Apr 27, 2012 at 9:24

2 Answers 2

3

When you create a .NET assembly, you can set a checkbox to have the assembly registered for COM interop. This will allow you to access it from any language that can call COM. (C can can't it? Been a long time since I touched C or C++.)

Configuration Properties -> Build page of your project properties. Look for "Register for COM Interop".

Sign up to request clarification or add additional context in comments.

1 Comment

This did not work. C still cannot find the procedure address in the dll.
2

Use this project to export C# functions as native entry points.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.