Posted By: BitFlipper | Oct 5th @ 11:11 PM
page 1 of 1
Comments: 5 | Views: 597

I am working on a C# 3.5 plugin that is used by an unmanaged C++ host application. This C++ application is a 3rd party commercial application and I don't have the source code to it.

 

Anyway, I have the plugin working using a managed C++ helper DLL that handles all of the unmanaged to managed API calls. My plugin has a managed UI that is embedded into a native window that is supplied by the unmanaged application. I use NativeWindow to do this.

 

But now I have run into a problem where I can't get Drag & Drop to work. This has something to do with COM not being initialized or something, and I am looking at ways to solve this. 

 

Anyway, that is not the main reason I'm here. I heard rumors that there could be an easier way to do something like this in C# 4.0. Is this true? Ideally, it would be something like:

 

[DllExport]

private static void MyMethod(...)

{

  ...

}

 

So what happens is that the method is exported so that it becomes visible as a C entry point using the same marshalling features that DllImport gives you. This way I can write my plugin as a single C# DLL that exposes C entry points. Hopefully it will also do proper COM initialization etc.

 

Does anyone know if something like this is forthcoming in C# 4.0?

 

 

figuerres
figuerres
???

making the dll visible to COM will not work for you?  that is the normal way to let unmanaged code call into a managed dll.

and com-vivible is very simple to do in .net and vs.

figuerres
figuerres
???

Ah...

 

perhaps a spot for you to write and then license a plugin for .net for this?

 

you write a C++ /CLR aware plugin that becomes a wrapper for other plugins to connect with...

 

a "bridge" between the two so to speak.

 

page 1 of 1
Comments: 5 | Views: 597
Microsoft Communities