Zitat
Can you translate this example to FoxPro?
I can, but it wouldn't work - the equivalent of the "Dim ... as" serves only for Intellisense to read the TLB so its properties show up in the editor. However
Zitat
would only create a new reference to the object, tried that already.
There's another approach I'm considering, the eventhandler interface - and I almost got it to work, except that for some reason form's .init (equivalent of onLoad, fires after all the form's objects are instantiated) didn't quite fire (which is a first) and eventhandler() call was the last line there. I'll try to move the code elsewhere and see what happens. I assume that I either have to move the call to before this.oWpt.SetLayout(), or to move it into .owpt.init() or something like that - into some place that I know that code executes. It could be that the control itself initalizes somehow in a manner that steals the focus from VFP's code, or whatever. That's something to do today.
Zitat
About the copyright protection: I plan to introudce a set of properties to protect the text, including disabling of the internal save and print dialogs and also by encrypting the clipboard contents with a password which is randomly created for the editor instance. Clearing the clipboard when focus changes can frustrate the people I think - if they just switch to a different program, look something up or so and than come back and cannot paste.
No, I plan to do this other way around - they will be able to paste into, they just won't be able to copy out of the app. That's customer's requirement and the users will be notified. I'd also like to see a drag'n'drop into the control (text, not just images), but that'd be the icing on the cake.
As for the saving and printing - like I said, printing is fine as long as it's not to a PDF printer, and for saving and loading I'd use one of the encryption schemes that are already in use in other areas of the app.
Say, if I manage to intercept printing, does the wpa="print" call the print dialog by itself, or does it go to the currently selected printer? I figure I'd find that by myself, but since you're already here... :)