Solved

Output Parameter for ActiveX control

Posted on 1999-01-26
3
193 Views
Last Modified: 2013-11-20
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
Comment
Question by:XiangYangL
3 Comments
 
LVL 15

Accepted Solution

by:
Tommy Hui earned 100 total points
ID: 1328302
Sorry, but the pointer is the only way. You can use a VARIANT* for generic types, but ultimately it is a pointer.
0
 
LVL 1

Expert Comment

by:jim_pettinato
ID: 1328303
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
 

Author Comment

by:XiangYangL
ID: 1328304
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

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

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.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Separate files macro - Errors on larger data set 18 73
post4 challenge 28 104
fix34  challenge 9 141
Fibonacci challenge 11 133
Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question