?
Solved

Output Parameter for ActiveX control

Posted on 1999-01-26
3
Medium Priority
?
202 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 15

Accepted Solution

by:
Tommy Hui earned 200 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
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.
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses

801 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