WPCubed Product Support

APIs WPTools not working in DLL Forms (Acess Violation)

Hello,

I tried to use the Wptools APIs in a DLL Form project and the error: Acess Violation appears. At first, the wprichtext editor usually appears in a form inside the DLL, with the possibility of editing text. However, when using any text inclusion or formatting APIs the Wprichtext Editor has the error message "Acess Violation" and this message is repeated repeatedly when clicking on the editor. It is as if he can no longer focus on the sprichtext editor! If I don't use the APIs in WprichText the editor works correctly!

I used, for example, the APIs of a demo program. The CreateDemoText unit. Specifically the following procedure:

procedure CreateDemoText (RTFMemo: TWPCustomRtfEdit; Mode: TWPCreateDemoText);

The error points to an Assembler code for the Unit System method: class function TObject.InitInstance (Instance: Pointer): TObject;

...

$ ELSE! PUREPASCAL}

asm

PUSH EBX

PUSH ESI

PUSH EDI

MOV EBX, EAX

MOV EDI, EDX

STOSD <-------- the error happens here

MOV ECX, [EBX] .vmtInstanceSize

XOR EAX, EAX

...

Exception class $C0000005 with message 'access violation at 0x08e08593: write of address 0x00000000'. Process testeComposerDLLDelphiTokyo.exe (7378😎

How could I solve this problem, since the DLL Form project is very important for my system architecture?

#1 ✎ ♥ 0
3.7k Views 2 users read 2 min
wpsupport

WPTools works in a DLL - I use it in TextDynamic and RTF2PDF product for years.

But it is questionable if the kind of use is actually allowed.

You may use WPTools only in a DLL if all developers who reference this DLL also have a WPTools license.

You may send me your question by privat mail.

#2 ♥ 0
wpsupport

Thanks for the example project, please see my e-mail for solution.

#3 ♥ 0
This category is archived. No new posts are possible.