Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Can a method return some value in ATL Active-X Dll

Posted on 2002-03-28
4
Medium Priority
?
255 Views
Last Modified: 2013-11-25
Hi ,

My Question is that I have made an ATL COM Dll.I have only one method in that Dll.Can my method return Boolean Value.

If Yes ,then HOW????????????????
0
Comment
Question by:goodami
  • 2
  • 2
4 Comments
 
LVL 1

Expert Comment

by:pkreddy
ID: 6902107
Hi,
 Try the following things.

  1. Declare a [in,out] value with a BOOL* var. Make necessary changes to your IDL file and your header, implementation files.
  2. Now in your source code in function, you assign the required boolean value to the var declaredabove.
   
  COM automatically returns you back the BOOL value you assigned in the DLL to the cleint when the function call is made.
regards,
Pavan
0
 
LVL 6

Expert Comment

by:snoegler
ID: 6902165
[out, retval]
0
 
LVL 6

Accepted Solution

by:
snoegler earned 200 total points
ID: 6902170
Sample:

[helpstring("blabla")] HRESULT DoSomething([in] long lInput, [out, retval] long *pResult);

VB-Call of sample method:

Dim res as long
res = obj.DoSomething(123);
0
 
LVL 1

Expert Comment

by:pkreddy
ID: 6902179
Snoegler is right, i made a mistake there. The parameter must be marked as [out,retval] in your IDL file
0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
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 is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

927 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