• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 213
  • Last Modified:

Output Parameter for ActiveX control

I am using MFC to build ActiveX controls. How do I specify output parameters for a method (is it possible to do so in MFC)? I don't want to use a pointer.
0
XiangYangL
Asked:
XiangYangL
1 Solution
 
Tommy HuiEngineerCommented:
Sorry, but the pointer is the only way. You can use a VARIANT* for generic types, but ultimately it is a pointer.
0
 
jim_pettinatoCommented:
If I am correct in assuming the return value is not sufficient (that would be the best way to return a value from a method) then a pointer (or reference) is the only way to do it. Another approach would be to make the method set properties within the control and expose the property via Get/Set. This would require users of your control to call the method, then retrieve the updated properties. Perhaps you could break the intended method up into logical sub-methods or properties?
0
 
XiangYangLAuthor Commented:
Quesion for thui and others:

  My problem with using pointers is that a method with pointers as parameters cannot be called within a VB program (right?).  By the way, if I use ATL instead of MFC to build the control, then, is it possible to have output parameters?  I understand that using the get/set methods or simply a return value will solve my problem easily, but one of my users insists on having output parameters.

0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now