Solved

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

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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.
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.

707 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