Thanks, Patrick. I'll start playing around with that idea. Here's an
oddity I have yet to figure out...
I got it to work (instantiates in VFP and works as expected). By doing the
following steps:
1. Generated a strong name using sn.exe;
2. Added attributes to the cs file for reflection to identify a version and
use the strong name;
3. Built the DLL using the /define:STRONG switch; and
4. Ran GACUtil to load into the GAC.
I've tried the same process with another .cs file in the same folder, yet it
continues to give the same error. If it helps, here are the starts of both
files:
//This worked:
using System;
using System.Drawing;
using System.Drawing.Imaging;
using System.ComponentModel;
using System.Runtime.InteropServices;
#if STRONG
[assembly: System.Reflection.AssemblyVersion("1.0.0.0")]
[assembly: System.Reflection.AssemblyKeyFile("DotNet.snk")]
#endif
namespace DotNetCOM
{
[ClassInterface(ClassInterfaceType.AutoDual)]
[ProgId("DotNetCOM.wwImaging")]
public class wwImaging : Component
{...}
}
//This builds and adds to the cache but still gives same error (cannot find
the file):
using System;
using System.Drawing;
using System.Drawing.Imaging;
using System.ComponentModel;
using System.Runtime.InteropServices;
using System.Text;
#if STRONG
[assembly: System.Reflection.AssemblyVersion("1.0.0.0")]
[assembly: System.Reflection.AssemblyKeyFile("Calculator.snk" )]
#endif
namespace Mathematics
{
[ClassInterface(ClassInterfaceType.AutoDual)]
[ProgId("Mathematics.Calculator")]
public class Calculator : Component
{...}
}
Thanks again,
John
"Patrick Steele [MVP]" <pa*****@mvps.org> wrote in message
news:MP************************@msnews.microsoft.c om...
In article <ed*************@TK2MSFTNGP11.phx.gbl>, js******@c-comld.com
says... Hi All,
I've been working on building a .dll in C# (framework 1.1) and using it
in VFP8. As always, the example that runs so smoothly in the article fails
at a rather basic point in practice. When attempting to create the object,
After building a dll, I used RegAsm.exe to register and received "Types
registered successfully" message. But upon trying to create the object
in VFP, I get the error:
OLE error code 0x80070002: The system cannot find the file specified.
Anyone have an idea what (probably basic) thing I'm missing here?
Usually, .NET assemblies reside in the same directory as the executable
(even with COM-interop). I've had this happen before when doing stuff
inside the VB6 IDE. I had to place the .NET assembly in the same
directory as the IDE (VB6.EXE). Perhaps VFP needs this to.
--
Patrick Steele
Microsoft .NET MVP
http://weblogs.asp.net/psteele