For my xll (Excel addin) i would like to invent a new way to claim memory and destroy it right after the call.
When Excel calls my function, i can not destroy the returned string.
Using a STATIC is an option but not threadsafe.
Using arrays holding memory pointers is an option, i am looking for something different so i tried this (not working):
Unf. the msgbox END is executed before getting the "1234"
Maybe you have an idea similar to this and handy to use?
When Excel calls my function, i can not destroy the returned string.
Using a STATIC is an option but not threadsafe.
Using arrays holding memory pointers is an option, i am looking for something different so i tried this (not working):
Code:
[color=#0000FF]Class[/color] Class1 [color=#0000FF]Class[/color] [color=#0000FF]Method[/color] [color=#0000FF]Destroy[/color] [color=#0000FF]MsgBox[/color] "END" [color=#0000FF]End[/color] [color=#0000FF]Method[/color] [color=#0000FF]Interface[/color] Interface1: [color=#0000FF]Inherit[/color] [color=#0000FF]IUnknown[/color] [color=#0000FF]Property[/color] [color=#0000FF]Get[/color] Value() [color=#0000FF]As[/color] [color=#0000FF]String[/color] [color=#0000FF]Property[/color] = "1234" [color=#0000FF]End[/color] [color=#0000FF]Property[/color] [color=#0000FF]End[/color] [color=#0000FF]Interface[/color] [color=#0000FF]End[/color] [color=#0000FF]Class[/color] [color=#0000FF]Function[/color] Test() [color=#0000FF]As[/color] [color=#0000FF]String[/color] [color=#0000FF]Local[/color] oInterface1 [color=#0000FF]As[/color] Interface1 oInterface1 = [color=#0000FF]Class[/color] "Class1" [color=#0000FF]Function[/color] = oInterface1.Value() [color=#0000FF]End[/color] [color=#0000FF]Function[/color] [color=#007F00]' Execute[/color] [color=#0000FF]MsgBox[/color] Test()
Maybe you have an idea similar to this and handy to use?

Comment