0

I have a solution that is built in Visual Studio 2019 using C# 3.5.0. I have my mother application that is coded with RStudio running R3.6.x. My objective is to use the solution (Project files are with me) and integrate with R. The input data flows from R and uses the C# code to produce the intermediate outputs.

My attempts: 1. I tried dyn.load to build the dll but it fails with "module not found" error message. 2. I did not find ".cs" as one the objects accepted by shlib cmd tool for building R loadable dll packages. 2. Tried to install rClr and it failed as there is no library for R3.6.x

So the challenge is to find an efficient way to load the COM object in R 3.6.x. Suggestions welcome.

HexGuy
  • 38
  • 5
  • It depends on the type of dll if you can use in c#. There are basically 3 types of dll 1) Managed generated in c# 2) dlls that are window compatible (not managed Win XP and later) that you have to use DllImport 3) dll that are older than Win XP (or not windows compatible). You need to write a c++ wrapper to work with c#. – jdweng Apr 24 '20 at 12:25

1 Answers1

0

You might want to take a look at Exporting a C# function. This will only allow c-style function calls. There are also R-Interop that uses named pipes for communication. A third way might be to use Component object model.

JonasH
  • 28,608
  • 2
  • 10
  • 23