Solved

Output Parameter for ActiveX control

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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Expand to include initial dialog with two choices. 9 59
has22 challenge 11 71
matchUp  challenge 6 48
Window placement 17 64
Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

707 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now