I am currently trying to use the TPrintPreview unit to manage custom printer forms (Delphi 2009 on Vista Home Premium). While I was able to delete forms, I am not able to use AddNewForm as I was trying with:
- Code: Select all
...
var
previewtest : TPrintPreview;
begin
previewtest.AddNewForm('my_test', 10, 10);
...
It compiles, but throws an "EAccessViolation" exeption at
- Code: Select all
Size.cx := X * 10;
in
- Code: Select all
function TPrintPreview.AddNewForm(const AFormName: String;
FormWidth, FormHeight: DWORD): Boolean;
I guess, that I might have to call any other methods before adding a custom form, but I didn't find any hint so far. Btw. is it possible to give me a small example on how to use "FetchFormNames"?
Thanks!
/sven