2

How do you get an IDataContext for the result value in the OnFastEval event in a TDWSUnit function?

The "magic functions"-functionality presented through the OnFastEval event can't return complex data, like records, as OnFastEval returns a Variant. The internal magic functions do support using an IDataContext interface to return complex data.

FHannes
  • 783
  • 7
  • 22

1 Answers1

1

You have to return the IDataContext interface through the variant result (it's an IUnknown, so you can assign it directly).

You can allocate an IDataContext directly from TDataContext, from execution pool through (args.Exec.Stack.CreateDataContext), or you can pass along an existing one.

For sample code, see FuncFastPoint in UdwsUnitTests

Eric Grange
  • 5,931
  • 1
  • 39
  • 61