Solved

Output Parameter for ActiveX control

Posted on 1999-01-26
3
200 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 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
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.
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

688 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