Question

i have

Run time Error 216 at ADDRESS

when registering a 64 bit dll built with Delphi XE2 (I have Update 3).

from command prompt I do (note: system32 folder contains the 64bit exe!)

c:\windows\system32\regsvr32.exe My64bitdll.dll

and after a "dll succesfully installed message" i have the runtime error.

I would like to debug the registering process, somehow using Run/Parameters/host.

Could anyone post the correct procedure? In some other questions like this one a bug is mentioned, but it seems fixed now, i have a delphi build older than this one.

Update: Also any comment on the RunTime error is welcome.

Était-ce utile?

La solution

  1. Load the DLL project.
  2. Modify run parameters (Run | Parameters) to specify host app as regsvr32. Note that you may need to use C:\Windows\sysnative path to defeat the 32 bit file system redirector.
  3. Include path to DLL as command line arguments.
  4. Perhaps enable Debug DCUs, in case the error is raised in the Delphi COM self-registration code.

enter image description here

Then debug the DLL like any other DLL.

Runtime error 216 is an access violation.

Autres conseils

1) this runtime error may be just program exit. For example would you debug internals of DllMain, you can easily get past exit point and try to trace ended DLL, which would through RE. Process exit is not looking just like return from subroutine - but rather as a call to special system API function. But debugger does not understand it and continues to trace now dead project.

2) i see not point in using RegSvr32.exe or TRegSvr.exe for debuging. All RegSvr32 does is calling predefined function from DLL. Do you debug your DLL or RegSvr32 itself ?

2.1) If latter - i heard there are sources of RegSvr32, and probably there are debug symbols, but some Microsoft debugger to be used.

2.2) If former, then there should be now difference how to call those functions and you only have to debug those functions. Just take any code from File not found when registering DLL with TFileRun and regsvr32 and use it as host.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top