One final set of questions I seem to have regarding this ActiveX interface - more of a concept one.
1) I have a couple of callback interfaces coded. I eventually figured out that I could use them in the code by:
This is how I ended up getting it to work, but:
a) Is using "IMyCallBack" appropriate or is there some other way to make this work right?
b) I couldn't figure out how to "free" this and didn't see a method to do that on the code suggestion feature. Should I and how?
2) Then my major problem is that I need to have these call backs access variables and methods of the original calling class (the thing that calls "Callfunc" if you go by the above example). But as I have them coded right now, they know nothing of these variables and methods.
So I'm guessing I probably have to combine them? e.g.
and then have an alias pointing an invoke function to IMyCallBack.Invoke?
Or is there some other way to have these callback interfaces be able to "see" the original class items?
It is not possible for anyone to acknowledge truth when their salary depends on them not doing it.
1) I have a couple of callback interfaces coded. I eventually figured out that I could use them in the code by:
Code:
TMyCallBack = class(TInterfacedObject, IMyCallBack)
function Invoke bla bla bla
var
MyCallBack: IMyCallBack;
begin
MyCallBack := TMyCallBack.Create;
callfunc(mycallback);
end;
This is how I ended up getting it to work, but:
a) Is using "IMyCallBack" appropriate or is there some other way to make this work right?
b) I couldn't figure out how to "free" this and didn't see a method to do that on the code suggestion feature. Should I and how?
2) Then my major problem is that I need to have these call backs access variables and methods of the original calling class (the thing that calls "Callfunc" if you go by the above example). But as I have them coded right now, they know nothing of these variables and methods.
So I'm guessing I probably have to combine them? e.g.
Code:
MyBaseClass = class(TComponent, TMyCallBack)
and then have an alias pointing an invoke function to IMyCallBack.Invoke?
Or is there some other way to have these callback interfaces be able to "see" the original class items?
It is not possible for anyone to acknowledge truth when their salary depends on them not doing it.