--- In [email protected], "entropyreduction" <alancampbelllists+ya...@...> wrote: > > This one accepts SAFEARRAY arguments (translated from pp vectors), > as well as returning SAFEARRAYs, ref counting, etc. > > Reason for the provisional: I started assuming that any returned > VARIANT is property of my plugin, therefore my responsibility to > do VariantClear on it, i.e. to release associated data > structures. This should matter particularly for large SAFEARRAYs > retuerned by methods, e.g. GetRows in Sheri's AODB script > (included in zip). > > But moment I execute VariantClear on a returned VARIANT, crash. > Atl least if VARIANT is a SAFEARRAY or BSTR. So I don't (call > VariantClear). In pricniple that should make a humungous memory > leak, but ASAI can see, using verarious memory inspectors, no > leak. You get same result? If so, I'll just shrug and publish. >
No idea. A returned variant could be owned by its creator/returner and might live in a process space other than PowerPro's. I did try a little test of a com method with input arrays (i.e., vecs) and it did work. Slowed down alot when I reran it, possibly because both the xls and mdb files have the same name "demo". Reran after giving them unique names, and seemed better. Anyway this is what I did. In the ADODB demo, I added after "local MyView=OpenAccessData(strdb, qname, sqlstmt)": ;test adding a new record to recordset myview local testnames=vec.create(2) testnames[0]="Country" testnames[1]="Pop" local testrecord=vec.create(2) testrecord[0]="Sheri Test Country" testrecord[1]=1000 myview.addnew(testnames,testrecord) I could then see in the debug output, Sheri Test Country, at the end of each (xls, mdb, csv) test. Was a little surprised that the corresponding files were also rewritten/updated. Obviously, every time that gets run, it adds duplicates of "Sheri Test Country", so this is not a very good permanent change to the demo script, was just a quick way for me to try an input array. If you open, e.g., the Excel file, you see that it properly skipped the "Size" column. Did you add any other demos for input arrays? Didn't see any mentioned in What's New. Regards, Sheri
