Solved

Atl Problem: Passing variants array to .NET assembly expecting object from ATL dll

Posted on 2004-03-22
3
258 Views
Last Modified: 2013-11-25
Hi experts
I have an atl component which is a leaf invoker component ,ie, it takes progids, input parameters, output parameters and one error string parameter it instanciates the component, and it uses dispatchdriver to invoke the function in question in a given component, the interface is given below.

interface ICgateway : IDispatch
{
      [id(1), helpstring("method Invoke")] HRESULT Invoke([in] VARIANT * param1,[in]  VARIANT* param2 ,[in,out]VARIANT* param3,[in,out] VARIANT* param4);
};
progid of a vb or vc com dll in param one, the input parameters to be passed to the component in question goes in param 2 as variant array, param 3 is for out values it is also variant array, and any error message is returned via param 4 this is BSTR type.

This component works fine as long as i give in progids of vb components which accept variants array as param2 and param3 parameters.

I have some .NET classes to be called  but they accept object as parameter i have no idea how do i convert my variants array to objects so that i can  pass them to .net component.

All components have same funcion signature and same type of parameter; that is,

   somefunct( byval variant inparam, variant outparam, variant errstring) as long

only .NET components have object array as input and output parameter.

Ccan anyone help me out with this one? ...
regards
0
Comment
Question by:SubodhKatiyar
3 Comments
 
LVL 1

Author Comment

by:SubodhKatiyar
ID: 10674784
as no one has answered this i am taking the question off.
i solved it by passing all byref and taking care while doing the marshaling that nothing gets back from in params
0
 

Accepted Solution

by:
ee_ai_construct earned 0 total points
ID: 10862031
PAQed, with points refunded (500)

ee_ai_construct
Community Support Moderator
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How to split this in C++ 4 93
strCount chalenge 3 69
MacOS and programming in React 7 27
How to insert gas or chemical names in SQL server. For e.g. CO2 to CO₂. 5 67
The purpose of this article is to demonstrate how we can use conditional statements using Python.
Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

943 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

7 Experts available now in Live!

Get 1:1 Help Now