ATL with VB

Hi!

I finally created a DLL with ATL!... I build an object and use it from within Visual Basic.
I use the ATL app wizard from VC++ 5.0, then I add some objects, create properties and methods and everithing goes fine!
However all methods I implement return an HRESULT type. WHAT SHOULD I DO TO USE OTHER RETURN TYPES?.
For example I'd like to create a method that returns a BOOLEAN value. This means that when using in VB, when you write for example:
MyObject.BoolVal =
at this moment, VB detects that I'm handling a boolean value and displays a popup combo whith all possibilities (in this case True or False). How can I do this?
... And, how do I do the same wiht ennumerations?

Any help will be greatly appreciated... If you think your knowledge diserves more points just ask me!
LVL 2
trilloAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

trilloAuthor Commented:
Edited text of question.
0
arikkaCommented:
That's correct. Every method must retrun
HRESULT.
IF you want to use statement like in VB
do the next:
in ATL wizard for method parameters write : out parameters with retval keyword.

HRESULT MyMethod(
[out, retval] VARIANT_BOOL* ReturnVal
);
 
The retval attribute designates the parameter that receives the return value of the member.
The parameter must have the out attribute and must be a pointer type.

Now  you will be able to write in
VB :

   boolean a;
   a = MyObect.MyMethod()
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
trilloAuthor Commented:
Excellent!...

And do you know how do I do the same with enumerations, so that VB lists the possible values for a parameter?
0
trilloAuthor Commented:
Forget it! I already found out about enumerations...

Thanks a lot!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Development

From novice to tech pro — start learning today.