ATL DLL Queries
Posted Date Unknown 1 Comment

How do we add a UDT struct in an ATL DLL. The ATL DLL has a function defined in the class and one of the parameters to be passes is a struct pointer .The struct needs to be defined in the project...I had defined that in one of the .h files can I include this file in the idl file or where it has to be placed.....I am stuck because of the struct email id is

See All Responses Below...
Message Rating
Posted on: 31/07/2013
You cannot simply pass a struct to a COM method. But you can pass a pointer to te struct and that is more than enough. All you need to do is use the parameter data type as VARIANT and use the byref variable to point the struct pointer variable to byref so that you can recive it inside the method..

so define the idl with the methods name and one paramater with variant type

the implement the .h and .cpp files accordingly..

Hope this helps..

Please Login to Post Your Comments
Name (Max. 100 characters)
Please post your comments here
Select Language
Attach File(Max. Size: 2 MB)
A few simple rules when posting your Comments,
  1. Please post only answers relevant to the topic of discussion.
  2. Please dont misuse this site or do not be abusive, offensive, inappropriate,harass anyone on the boards or post ads or spam. Doing so will delete your inappropriate messages and will block or delete your account on this site. 

Academic Projects

Site optimized for IE7, 1280 X 768 and above. Copyright © 2010 - 2018 KTS InfoTech
Site Developed Using KTS WebCloud