Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeOur CommunityOur CommunityGeneral Discuss...General Discuss...Problem while call a COM Callable Wrapper -- UrgentProblem while call a COM Callable Wrapper -- Urgent
Previous
 
Next
New Post
6/13/2007 11:56 AM
 

Problem in COM Callable Wrapper

i am creating a CCW and use it in VB 6.0 application. I have created two classes, ClassA and ClassB in .NET wrapper.
I am able to get the methods and properties of these classes in VB 6.0. My problem is that I am trying to create an array of object of classA in vb 6.0 and trying to pass this array in one of the method of ClassB. But I am getting runtime error.

Error Message displayed is:
----------------------------
Run-time Error '5':
Invalid procedure call or argument

----------------------------


Here is the VB code,

    Dim objB As New wrapperCls.ClassB
   
    Dim objA As New wrapperCls.ClassA
    Dim arrObjA(1) As New wrapperCls.ClassA
   
  
    objA.CurveName = "Curve1"
    objA.Date = "12122007"
    objA.DeliveryPeriod = "2"
    objA.DeltaPosition = 32.232
    objA.GammaPosition = 4.34
    objA.Peakness = "3"
    objA.RiskType = "Low"
    objA.TimePeriod = 2
    objA.uOM = "MMBTU"
    objA.uOM = "UMB"
   

    Set arrObjA(0) = objA
   
    objB.CorrectionNeeded = True
    objB.Counter = 2
    objB.DiscountNeeded = True
    objB.Method = "SampleMEthod"
    objB.NodeId = 3
    objB.UserId = "Bhupi"
    objB.VolNeeded = True

    objB.getPositionDataVO adPDataArr   ''' error occurs at this line


.NET CODE
===========
/** Interface declaration **/

 [Guid("CDD5E142-1CC1-4a76-A9E6-A415E2C41FD0")]
 [InterfaceType(ComInterfaceType.InterfaceIsIDispatch)]
 public interface _ClassB
 {
  [DispId(21)]
  bool CorrectionNeeded{get;set;}
  [DispId(22)]
  int Counter{get;set;}
  [DispId(23)]
  bool DiscountNeeded{get;set;}
  [DispId(24)]
  string Method{get;set;}
  [DispId(25)]
  int NodeId{get;set;}
  [DispId(27)]
  string UserId{get;set;}
  [DispId(28)]
  bool VolNeeded{get;set;}
  [DispId(29)]
  void getPositionDataVO(ref AdhocPositionDataVO_Wr[] arrPDV);
 }

/** Class B **/

 [Guid("1FA539FE-DE70-4e4e-B598-74BA2DA41447")]
 [ClassInterface(ClassInterfaceType.None)]
 [ProgId("AdHocVar.AdhocInputMessageVO")]
 public class AdhocInputMessageVO_Wr: _AdhocInputMessageVO_Wr
 {
  public AdhocInputMessageVO_Wr() {}

  private bool _CorrectionNeeded;
  private  int _Counter;
  private bool _DiscountNeeded;
  private string _Method;
  private int _NodeId;
  private AdhocPositionDataVO_Wr[] _PositionDataArray;
  private string _UserId;
  private bool _VolNeeded;
  private AdhocPositionDataVO_Wr _PosData;

  public bool CorrectionNeeded
  {
   get{return this._CorrectionNeeded;}
   set{this._CorrectionNeeded =value;}
  }
  public int Counter
  {
   get{return this._Counter;}
   set{this._Counter=value;}
  }

  public bool DiscountNeeded
  {
   get{return this._DiscountNeeded;}
   set{this._DiscountNeeded=value;}
  }
  public string Method
  {
   get{return this._Method;}
   set{this._Method=value;}
  }

  public int NodeId
  {
   get{return this._NodeId;}
   set{this._NodeId=value;}
  }

  public string UserId
  {
   get{return this._UserId;}
   set{this._UserId=value;}
  }
  public bool VolNeeded
  {
   get{return this._VolNeeded;}
   set{this._VolNeeded=value;}
  }

  public void getPositionDataVO(ref AdhocPositionDataVO_Wr[] arrPDV)
  {
   this._PositionDataArray = arrPDV;
  }

 }

any reply will be highly appreciated.....

Thanks,

 

 

 

 
Previous
 
Next
HomeHomeOur CommunityOur CommunityGeneral Discuss...General Discuss...Problem while call a COM Callable Wrapper -- UrgentProblem while call a COM Callable Wrapper -- Urgent


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out