Hi,


This is Function definition in VB6 Application (DLL)

Public Function Main(ByVal Num As String, ByVal AcctNO As String, ByVal ChannelIn As String,ByVal CFlag As String, Optional ByVal PIn As String, Optional ByVal AccountArray As Variant,Optional ByRef MaxAvail As Double, Optional ByRef MinAvail As Double,Optional ByRef EscAmt As Double, Optional ByRef BipArray As Variant,Optional ByRef ErrCode As String, Optional ByRef InterestRate As Double,Optional ByRef SurchargeRate As Double, Optional ByRef SurChargeAmt As Double) As String


I created a VB.net project (Visual Studio 2005) and add reference to VB6 DLL. In Button Click , i wrote.

Code:
xyz = abc.Main(ID, "", "Some", StrChan,StrFlag, "", , "", , , arr, str, varAccount, varAccount)
------------------------------------------
                                         |
                                         Here i am getting error as 
Type mismatch. (Exception from HRESULT: 0x80020005 (DISP_E_TYPEMISMATCH))

If i pass "Y" in place of variable StrFlag like this

Code:
 
xyz = abc.Main(ID, "", "Some", StrChan,"Y", "", , "", , , arr, str, varAccount, varAccount)
-----------------------------------
                                   |
                                   Now here i am getting error as 
Type mismatch. (Exception from HRESULT: 0x80020005 (DISP_E_TYPEMISMATCH))

What is the problem? Can anybody suggest me the soultion..

Thanks