简体   繁体   中英

DTSearch COM Interop - How do I expose objects to C#?

I know, I'm taking a gamble here. I don't know if I can even be helped on this one at all. But, here is the problem.

The company I work for has a fully licensed, if old, developer copy of DTSearch including the C++ source. They use this in an application I'm updating. I've been told to make use of it in the C# additions to this app that are currently being worked on. However, I don't have the .NET assembly and they refuse to implement it for some reason.

So, I can easily view dtengine in the Object Browser and there are lots of lovely objects waiting for me to use them. But none of them will instantiate. Attempting it gets me

'dtengine.SearchJobClass' cannot be embedded. Use the applicable interface instead.

And there are interfaces galore, I can easily implement any of them. Trouble is, "throw new NotImplementedException" doesn't exactly get my searching done.

Does anyone have any clues?

I've used some COM objects that you have to instantiate like so:

Foo f = new FooClass();

Does the DTSearch have similar looking class names?

I also believe that COM interfaces are special and that you can instantiate a COM object by it's interface though I'm having a hard time finding good examples.

I did find this:

http://www.codeproject.com/KB/COM/COMBasics.aspx

note that if you scroll down you'll see them instantiating the Interface in a special way. I'm not saying this is a solution but it may help in your investigation of how to use the DTSearch COM wrapper in your application.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM