Solved

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

Posted on 2002-03-28
4
244 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 50 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

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

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

Suggested Solutions

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…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
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…

821 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