VFP and .NET Interop
List object in COM dll error
Gravatar is a globally recognized avatar based on your email address. List object in COM dll error
  n/a
  All
  Oct 18, 2014 @ 04:05am
Hi.
I have developed .NET COM dll. Inside there is a class (BarKodPodaciCl) which have attribute (barKodPodaci ) which is list of another class (BarKodStruktCl) :

public class BarKodStruktCl
{
public int sifrap = 0;
public int artikl = 0;
public string vrsta = string.Empty;
public string kod = string.Empty;
public string sisKorisnik = string.Empty;
}

public class BarKodPodaciCl
{
public List<BarKodStruktCl> barKodPodaci = new List<BarKodStruktCl>();
}
I have procedure which returns object of BarKodPodaciCl
When I create COM object in VFP there is no error but when I try to do something with that object like wait window COMobject.barKodPodaci.sifrap i get an error :
ole error code 0x8007000e: Not enough storage is available to complete this operation
Is it possible for VFP to consume object with List attribute ?

Gravatar is a globally recognized avatar based on your email address. Re: List object in COM dll error
  Rick Strahl
  pgoranrs
  Oct 20, 2014 @ 12:49pm

VFP does not support access generics in .NET. Actually COM can't deal with generic types, because they are dynamic and COM requires strict typing.

You can access these using wwDotnetBridge:
http://west-wind.com/wwDotnetBridge.aspx

You can take a look at the white paper which explains why you might want to use wwDotnetBridge to call your .NET components in detail.

You can get wwDotnetBridge as part of the West Wind Client Tools or from our open source library on Github...

+++ Rick ---


+++ Rick ---



Hi.
I have developed .NET COM dll. Inside there is a class (BarKodPodaciCl) which have attribute (barKodPodaci ) which is list of another class (BarKodStruktCl) :

public class BarKodStruktCl
{
public int sifrap = 0;
public int artikl = 0;
public string vrsta = string.Empty;
public string kod = string.Empty;
public string sisKorisnik = string.Empty;
}

public class BarKodPodaciCl
{
public List<BarKodStruktCl> barKodPodaci = new List<BarKodStruktCl>();
}
I have procedure which returns object of BarKodPodaciCl
When I create COM object in VFP there is no error but when I try to do something with that object like wait window COMobject.barKodPodaci.sifrap i get an error :
ole error code 0x8007000e: Not enough storage is available to complete this operation
Is it possible for VFP to consume object with List attribute ?




Rick Strahl
West Wind Technologies

Making waves on the Web
from Maui

Gravatar is a globally recognized avatar based on your email address. Re: List object in COM dll error
  n/a
  Rick Strahl
  Oct 24, 2014 @ 10:20am
Thanks for the answer. It is so good that you exist. With your posts you opened my mind. I have found another way to accomplish that and that is I am making xml of that list object because the final goal is that I need it in cursor and it works fine for me. I started with COM because of comunication with WCF service and there I have a return object which have one tree attribute (another object which holds information about success,hasdata... and exception object on WCF service) and one attribute which is list of object (data from database) and when i do regular call to wcf servise I cant access that second object in first object. That nodelist when you say item(0) returns all tree structure like it is one tag.

VFP does not support access generics in .NET. Actually COM can't deal with generic types, because they are dynamic and COM requires strict typing.

You can access these using wwDotnetBridge:
http://west-wind.com/wwDotnetBridge.aspx

You can take a look at the white paper which explains why you might want to use wwDotnetBridge to call your .NET components in detail.

You can get wwDotnetBridge as part of the West Wind Client Tools or from our open source library on Github...

+++ Rick ---


+++ Rick ---



Hi.
I have developed .NET COM dll. Inside there is a class (BarKodPodaciCl) which have attribute (barKodPodaci ) which is list of another class (BarKodStruktCl) :

public class BarKodStruktCl
{
public int sifrap = 0;
public int artikl = 0;
public string vrsta = string.Empty;
public string kod = string.Empty;
public string sisKorisnik = string.Empty;
}

public class BarKodPodaciCl
{
public List<BarKodStruktCl> barKodPodaci = new List<BarKodStruktCl>();
}
I have procedure which returns object of BarKodPodaciCl
When I create COM object in VFP there is no error but when I try to do something with that object like wait window COMobject.barKodPodaci.sifrap i get an error :
ole error code 0x8007000e: Not enough storage is available to complete this operation
Is it possible for VFP to consume object with List attribute ?




Gravatar is a globally recognized avatar based on your email address. Re: List object in COM dll error
  Rick Strahl
  pgoranrs
  Oct 24, 2014 @ 03:29pm
Uhm yah that will work but that's a bit of a pain and only works if you control the server.

wwDotnetBridge lets you access just about all of .NET's features directly from FoxPro so you could have done what you wanted with only minor code changes.

+++ Rick ---



Thanks for the answer. It is so good that you exist. With your posts you opened my mind. I have found another way to accomplish that and that is I am making xml of that list object because the final goal is that I need it in cursor and it works fine for me. I started with COM because of comunication with WCF service and there I have a return object which have one tree attribute (another object which holds information about success,hasdata... and exception object on WCF service) and one attribute which is list of object (data from database) and when i do regular call to wcf servise I cant access that second object in first object. That nodelist when you say item(0) returns all tree structure like it is one tag.

VFP does not support access generics in .NET. Actually COM can't deal with generic types, because they are dynamic and COM requires strict typing.

You can access these using wwDotnetBridge:
http://west-wind.com/wwDotnetBridge.aspx

You can take a look at the white paper which explains why you might want to use wwDotnetBridge to call your .NET components in detail.

You can get wwDotnetBridge as part of the West Wind Client Tools or from our open source library on Github...

+++ Rick ---


+++ Rick ---



Hi.
I have developed .NET COM dll. Inside there is a class (BarKodPodaciCl) which have attribute (barKodPodaci ) which is list of another class (BarKodStruktCl) :

public class BarKodStruktCl
{
public int sifrap = 0;
public int artikl = 0;
public string vrsta = string.Empty;
public string kod = string.Empty;
public string sisKorisnik = string.Empty;
}

public class BarKodPodaciCl
{
public List<BarKodStruktCl> barKodPodaci = new List<BarKodStruktCl>();
}
I have procedure which returns object of BarKodPodaciCl
When I create COM object in VFP there is no error but when I try to do something with that object like wait window COMobject.barKodPodaci.sifrap i get an error :
ole error code 0x8007000e: Not enough storage is available to complete this operation
Is it possible for VFP to consume object with List attribute ?







Rick Strahl
West Wind Technologies

Making waves on the Web
from Maui

© 1996-2024