Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can I expose C# dll functions to IntelliSense in VFP 9? 1

Status
Not open for further replies.

DanWalter

Programmer
Nov 29, 2000
58
0
0
US
Hi All:
I have developed a C# (VS 2008 class library project) DLL. This DLL is registered for COM Interop and is COM visible.

I can consume the DLL in VFP 9 using the CreateObject command, then invoking the methods in the DLL.

However, the DLL is not exposed to VFP IntelliSense. I get no list of functions/methods for the object and of course, no lists of parameters.

Is there a way I can expose these methods to IntelliSense in VFP 9?

TIA,
Dan


Dan Walter
Daniel.Walter@uvm.edu
try { succeed(); } catch(E) { tryAgain(); } finally { rtfm(); }
 
Yes you can. This is not clearly documented but you need to add ClassInterface attribute. ie:

Code:
using System;
using System.Runtime.InteropServices;

namespace DotNetUtils
{
    [ProgId("MyDotNetUtils.CB")]
    [ClassInterface(ClassInterfaceType.AutoDual)]
    [ComVisible(true)]
    public class MyUtilLib
    {
//...
    }
}


Cetin Basoz
MS Foxpro MVP, MCP
 
Dear Cetin Basoz:
Thanks so much for the tip - that rocks! [thumbsup]

Because my application was marked for COM Interop, the [ComVisible(true)] attribute was true by default. Removing that attribute did no harm at all, and the code worked great!

Now I have an Intellisense-d DLL available to VFP.

Thanks again!
Dan

Dan Walter
Daniel.Walter@uvm.edu
try { succeed(); } catch(E) { tryAgain(); } finally { rtfm(); }
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top