What DLL do I need to reference to access FilerRegister method(s) of the CRegObject from C#?
[DllImport("ATL90.DLL")]
public static extern int FileRegister(string fileName);
And how would I do that in visual studio?
Any help is greatly appreciated! I can’t seem to find the correct DLL. I looked on pinvoke.net, but couldn’t find it.
Thanks!
You can’t. P/Invoke only works with C APIs, it does not work with C++ APIs. Besides, that particular API is implemented in inline C++, it’s not actually included in the ATL DLL.
I believe the best you could do is write a C++/CLI wrapper and call that from the C# code. Or take the C++ source code (which is included with Visual Studio) and rewrite it in C#.
If you include more details about why you want to call
FileRegister, then maybe there are other alternatives…