I am using VFP 9.0 and am trying to return a collection from a DLL with no 
luck.  Is there some trick that I am missing?

For example I have created a DLL ( Named Junk2 ) that has one class (Junk) in 
one prg (test.prg) Code follows:

DEFINE CLASS Junk as Custom OLEPUBLIC
Stuff = null
Foobar = null
        
FUNCTION Init()
  this.Stuff = NEWOBJECT( [Collection])
  This.Stuff.Add( [This is a test this is only a test] )
                
  This.FooBar = [This is foobar]
                
ENDFUNC && Init
        
ENDDEFINE

As can be seen it has two class properties: 
  -Stuff ( which in the init is made into a collection )
  -FooBar ( Which in the init is made into a string )

I then wrote the following testing code:

SET STEP ON 
X = CREATEOBJECT( [Junk2.JUNK] )  &&-- OPtion one does not work
*X = NEWOBJECT( [Junk], [Test.prg] ) &&-- Option 2 works
Z = X.FooBar
Z = X.Stuff
z = 1

When I do the "X = NEWOBJECT( [Junk], [Test.prg] )" option
I can see in the debugger that X.Stuff is a collection

When I run the code "X = CREATEOBJECT( [Junk2.JUNK] )" option
X.Stuff is an object but not a collection.

In both options x.foobar is a string as I expect.

What am I missing?


Anthony L. Testi


_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/[EMAIL PROTECTED]
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to