views:

30

answers:

1

Hello folks, I'm writing a custom ATL ActiveX component, but I'm having this little weeny problem: Visual Studio insists that every function defines in the *.idl file has to have a HRESULT return type, even though I want to have a ULONG return type.

[id(3), helpstring("method addh3h3")] ULONG addh3h3([in] ULONG x, [in] ULONG y);

It gives me this error:

error MIDL2269 : procedures in an object interface must return an HRESULT 

So how do I go on about defining a function with a ULONG return type? My ultimate goal is to call this function of the ActiveX object from within JavaScript in a webpage.

Thank you for your time!

+1  A: 

Add the [local] attribute to either the interface or the method. (from http://support.microsoft.com/kb/192626).

Michael Burr
Thanks a lot for the help, it worked!
Voulnet