Board index » delphi » Interesting behaviour....

Interesting behaviour....

Hi all,

I have an MTS Object which has a method that returns me a Variant Array.
the problem i'm facing is quite interesting.

when i instantiate the object using a Olevariant as follows, everything
seems to work fine...
   BOCustomer,
   Data : OleVariant;

     BOCustomer :=
CreateOleObject('EBusinessObjects.CustomerBusinessObject');
     Data := BOCustomer.FetchSingle( VKey );

the above code executes properly as expected and returns the data properly!

but when i use a delphi wrapper and pure interfaces, i land up in
troubles..!

   oCustomer  : TCustomerBusinessObject;
   iCustomer  : CustomerBusinessObject;
   Data : OleVariant;

   OCustomer  := TCustomerBusinessObject.Create(self);
   iCustomer := oCustomer.DefaultInterface;
   Data := iCustomer.FetchSingle( vKey );

   Delphi gives an EOleException saying ' Not Enough Storage is available to
complete this operation '.

can anybody explain this behaviour...?
am i doing something wrong...?

Any help from the TeamB Gurus...?

tia,
-sundar

 

Re:Interesting behaviour....


Hi,

Are you using NT 4.0 that contained a Service Pack and then you
installed some networking components off the original NT 4.0
installation CD...You will get this message in this case...The fix is
to reinstall the service pack...The reason this is is because certain
network files have been fixed since the initial release of NT 4.0 and
if you install any networking components off the CD you will have to
repatch the networking files...I hope this helps...

EastNDaHse

In article <81if8d$pa...@forums.borland.com>,
  "sundar" <si...@icode.com> wrote:

Quote
> Hi all,

> I have an MTS Object which has a method that returns me a Variant
Array.
> the problem i'm facing is quite interesting.

> when i instantiate the object using a Olevariant as follows,
everything
> seems to work fine...
>    BOCustomer,
>    Data : OleVariant;

>      BOCustomer :=
> CreateOleObject('EBusinessObjects.CustomerBusinessObject');
>      Data := BOCustomer.FetchSingle( VKey );

> the above code executes properly as expected and returns the data
properly!

> but when i use a delphi wrapper and pure interfaces, i land up in
> troubles..!

>    oCustomer  : TCustomerBusinessObject;
>    iCustomer  : CustomerBusinessObject;
>    Data : OleVariant;

>    OCustomer  := TCustomerBusinessObject.Create(self);
>    iCustomer := oCustomer.DefaultInterface;
>    Data := iCustomer.FetchSingle( vKey );

>    Delphi gives an EOleException saying ' Not Enough Storage is
available to
> complete this operation '.

> can anybody explain this behaviour...?
> am i doing something wrong...?

> Any help from the TeamB Gurus...?

> tia,
> -sundar

Sent via Deja.com http://www.deja.com/
Before you buy.

Re:Interesting behaviour....


Sundar,

In the first example you go via the COM runtime to instantiate your object,
but the other method involes creating the object locally to your
application, and thus COM/MTS aren't even aware of the object creation.  I
maybe wrong, but maybe you should still try to use COM to create the COM
object:

iCustomer := CreateCOMObject('<CustomerBusinessObject GUID>') as ICustomer;

Quote
"sundar" <si...@icode.com> wrote in message

news:81if8d$paa15@forums.borland.com...
Quote
> Hi all,

> I have an MTS Object which has a method that returns me a Variant Array.
> the problem i'm facing is quite interesting.

> when i instantiate the object using a Olevariant as follows, everything
> seems to work fine...
>    BOCustomer,
>    Data : OleVariant;

>      BOCustomer :=
> CreateOleObject('EBusinessObjects.CustomerBusinessObject');
>      Data := BOCustomer.FetchSingle( VKey );

> the above code executes properly as expected and returns the data
properly!

> but when i use a delphi wrapper and pure interfaces, i land up in
> troubles..!

>    oCustomer  : TCustomerBusinessObject;
>    iCustomer  : CustomerBusinessObject;
>    Data : OleVariant;

>    OCustomer  := TCustomerBusinessObject.Create(self);
>    iCustomer := oCustomer.DefaultInterface;
>    Data := iCustomer.FetchSingle( vKey );

>    Delphi gives an EOleException saying ' Not Enough Storage is available
to
> complete this operation '.

> can anybody explain this behaviour...?
> am i doing something wrong...?

> Any help from the TeamB Gurus...?

> tia,
> -sundar

Re:Interesting behaviour....


<<sundar:
    OCustomer  := TCustomerBusinessObject.Create(self);
    iCustomer := oCustomer.DefaultInterface;
    Data := iCustomer.FetchSingle( vKey );

 Delphi gives an EOleException saying ' Not Enough
Storage is available to complete this operation '.

 can anybody explain this behaviour...?

Quote

Not really, without knowing about the
CustomerBusinessObject interface. The only time
I've seen an error like this was when an interface that
need an index qualifier was called without one, and
so the whole (enormous) collection ended up being
used - could anything like that be happening here?

Deborah Pate

Re:Interesting behaviour....


Thanx  Objectivist...

Quote
> application, and thus COM/MTS aren't even aware of the object creation.

  COM / MTS are aware of the object creation and the delphi wrapper
internally calls createcomobject!
  yes, i agree that the right approach is use the interface pointers rather
than olevariants...
  i noticed the code overhead...

Quote
Objectivist <Objectiv...@intelligencia.com> wrote in message

news:81m7fg$qn111@forums.borland.com...
Quote
> Sundar,

> In the first example you go via the COM runtime to instantiate your
object,
> but the other method involes creating the object locally to your
> application, and thus COM/MTS aren't even aware of the object creation.  I
> maybe wrong, but maybe you should still try to use COM to create the COM
> object:

> iCustomer := CreateCOMObject('<CustomerBusinessObject GUID>') as
ICustomer;

> "sundar" <si...@icode.com> wrote in message
> news:81if8d$paa15@forums.borland.com...
> > Hi all,

> > I have an MTS Object which has a method that returns me a Variant Array.
> > the problem i'm facing is quite interesting.

> > when i instantiate the object using a Olevariant as follows, everything
> > seems to work fine...
> >    BOCustomer,
> >    Data : OleVariant;

> >      BOCustomer :=
> > CreateOleObject('EBusinessObjects.CustomerBusinessObject');
> >      Data := BOCustomer.FetchSingle( VKey );

> > the above code executes properly as expected and returns the data
> properly!

> > but when i use a delphi wrapper and pure interfaces, i land up in
> > troubles..!

> >    oCustomer  : TCustomerBusinessObject;
> >    iCustomer  : CustomerBusinessObject;
> >    Data : OleVariant;

> >    OCustomer  := TCustomerBusinessObject.Create(self);
> >    iCustomer := oCustomer.DefaultInterface;
> >    Data := iCustomer.FetchSingle( vKey );

> >    Delphi gives an EOleException saying ' Not Enough Storage is
available
> to
> > complete this operation '.

> > can anybody explain this behaviour...?
> > am i doing something wrong...?

> > Any help from the TeamB Gurus...?

> > tia,
> > -sundar

Re:Interesting behaviour....


hi pate,

No, the CustomerBusinessObject interface is a simple interface with
6 functions. No Collections.

I later found that EOleException saying ' Not Enough Storage is available to
complete this operation ' is an
OUT OF MEMORY error from windows.

the thing is that, when i tested the same piece of code in a different
machine ... everything works fine.
(ie) Both the methods work fine...without any problems.

but that just raises more questions...!

Quote
Deborah Pate <D...@djpate.freeserve.co.uk> wrote in message

news:81ttoc$3m613@forums.borland.com...
Quote
> <<sundar:
>     OCustomer  := TCustomerBusinessObject.Create(self);
>     iCustomer := oCustomer.DefaultInterface;
>     Data := iCustomer.FetchSingle( vKey );

>  Delphi gives an EOleException saying ' Not Enough
> Storage is available to complete this operation '.

>  can anybody explain this behaviour...?

> Not really, without knowing about the
> CustomerBusinessObject interface. The only time
> I've seen an error like this was when an interface that
> need an index qualifier was called without one, and
> so the whole (enormous) collection ended up being
> used - could anything like that be happening here?

> Deborah Pate

Re:Interesting behaviour....


Sometimes I wonder....

In article <822b9u$8...@forums.borland.com>,
  "sundar" <si...@icode.com> wrote:

Quote
> hi pate,

> No, the CustomerBusinessObject interface is a simple interface with
> 6 functions. No Collections.

> I later found that EOleException saying ' Not Enough Storage is
available to
> complete this operation ' is an
> OUT OF MEMORY error from windows.

> the thing is that, when i tested the same piece of code in a different
> machine ... everything works fine.
> (ie) Both the methods work fine...without any problems.

> but that just raises more questions...!

> Deborah Pate <D...@djpate.freeserve.co.uk> wrote in message
> news:81ttoc$3m613@forums.borland.com...
> > <<sundar:
> >     OCustomer  := TCustomerBusinessObject.Create(self);
> >     iCustomer := oCustomer.DefaultInterface;
> >     Data := iCustomer.FetchSingle( vKey );

> >  Delphi gives an EOleException saying ' Not Enough
> > Storage is available to complete this operation '.

> >  can anybody explain this behaviour...?

> > Not really, without knowing about the
> > CustomerBusinessObject interface. The only time
> > I've seen an error like this was when an interface that
> > need an index qualifier was called without one, and
> > so the whole (enormous) collection ended up being
> > used - could anything like that be happening here?

> > Deborah Pate

Sent via Deja.com http://www.deja.com/
Before you buy.

Other Threads