Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2002-03-28
4
Medium Priority
?
252 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
[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
  • 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

Moving data to the cloud? Find out if you’re ready

Before moving to the cloud, it is important to carefully define your db needs, plan for the migration & understand prod. environment. This wp explains how to define what you need from a cloud provider, plan for the migration & what putting a cloud solution into practice entails.

Question has a verified solution.

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

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…

730 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