Groups | Blog | Home
all groups > visual c libraries > october 2007 >

visual c libraries : CPP Active X to VB.Net application (newbie)


fdmaxey
10/5/2007 10:22:51 AM
I have just started writing a basic Active X application, written
in .NET C++, to be used in a VB.NET application.

I started out with a method ("Squareit") and a property ("Count"). I
used the standard Wizard for both of them. They appeared in the IDL
file as:

interface IFDMApp : IDispatch{
[id(1), helpstring("method SquareIt")] HRESULT SquareIt([in] DOUBLE
dblIn, [out,retval] DOUBLE* SqVal);
[propget, id(2), helpstring("property Count")] HRESULT Count([out,
retval] LONG* pVal);
[propput, id(2), helpstring("property Count")] HRESULT Count([in]
LONG newVal);
};

Everything compiled and linked OK, but when I reference the resulting
DLL in a VB.Net project and load the ActiveX component, neither the
method or propery are exposed.

This would seem to be basic. I've gone through two reference books
and neither of them mentions a thing about this. This has to be
something simple that I'm missing, but what?
SvenC
10/9/2007 5:31:51 PM
Hi fdmaxey,

[quoted text, click to view]

Please show your client code. Do you use the interface IDFMApp or a more
general type Object?

I would expect code like this:

Dim app As IFDMApp
app = CreateObject("Something.FDMApp")
' app.Count and app.SquareIt should be available through intellisense

--
SvenC
AddThis Social Bookmark Button