0

I've a library in C++ to run a string matching (PFAC library)PFAC-lib. How do i run this library from WinForm C#?

I also used managedCuda to run cuda code from my C#. Any idea?

Cleptus
  • 3,446
  • 4
  • 28
  • 34
Thomas Yap
  • 15
  • 3

1 Answers1

0

"PFAC library provides C-style API. Programmers can link the library to C/C++ code or other language."

You should be able to dllimport the parts you need for the code to work.

but you might have a hard time as i just looked at the struct create needs. good luck

  • how can i import "the parts" that i want ? is create new c++ file and then debug to dll and then import it in c#? is that possible? how about the cu file? hahaha.. I'm sorry for the burden – Thomas Yap Jul 25 '18 at 16:40
  • an example of this would be [DllImport(nativeLibName, EntryPoint = "PFAC_create")] public static extern IntPtr PFAC_create(IntPtr PfHandle); You would need to create replicas of the structs in c# to meet the creation requirements tho – Courtney The coder Jul 25 '18 at 16:47
  • I've got only 24 hours to finish it.. And i'm also new to CUDA. My thought would be anything but without convert it manually in C#. But it seems impossible – Thomas Yap Jul 25 '18 at 16:59