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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using a .Net DLL in a COM Application 1

Status
Not open for further replies.

davewelsh

Programmer
Jun 26, 2001
71
CA
I want to create a DLL in VB .Net and use it in a COM program (VFP 6.0, actually). I don't really know where to start. I've read through the MSDN library on the subject but, I can't figure it out.

Can someone give an example of a VB.Net or C# DLL that can be used by COM? Also what special steps are required to build the project (commandline or IDE)?
 
Do a search in the docs for COM Interop. Also look for "CCW", which stands for COM Callable Wrapper.

Chip H.
 
Thanks. I read a few pages on CCW AND RCW. My aaembly is now in the GAC and it's registered for COM. Now my VFP 6.0 app recognizes the DLL but when I call CreateObject I get OLE error code 0x80131522: Unknown COM status code.

To simplify things, my .Net code is now just this:

Code:
<System.Runtime.InteropServices.ComVisible(True)> Public Class QMail

End Class


In FoxPro I have:

Code:
PROCEDURE test
  oMail = CreateObject(&quot;Quality.Mail&quot;)
 
This is supposed to mean that the COM client can't find the DLL. I have both put the assembly in the global assembly cache AND copied the DLL to the client's directory, but I still get the error.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top