Solved

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

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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

With most software applications trying to cater to multiple user needs nowadays, the focus is to make them as configurable as possible. For e.g., when creating Silverlight applications which will connect to WCF services, the service end point usuall…
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 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…

744 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

10 Experts available now in Live!

Get 1:1 Help Now