Solved

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

Posted on 2004-03-22
3
255 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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

If you haven’t already, I encourage you to read the first article (http://www.experts-exchange.com/articles/18680/An-Introduction-to-R-Programming-and-R-Studio.html) in my series to gain a basic foundation of R and R Studio.  You will also find the …
When we want to run, execute or repeat a statement multiple times, a loop is necessary. This article covers the two types of loops in Python: the while loop and the for loop.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

757 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

16 Experts available now in Live!

Get 1:1 Help Now