Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Here is my Delphi solution. And it works even in D5 :)</p> <pre><code>function MyComponentConstructor(aOuter: nsISupports; const IID: TGUID; out _result): nsresult; cdecl; begin /* constructor */ end; type TCIDEntry = record cid: ^TGUID; service: Boolean; getFactoryProc: Pointer; constructorProc: Pointer; end; TContractIDEntry = record constractid: PChar; cid: ^TGUID; end; TCategoryEntry = record category: PChar; entry: PChar; value: PChar; end; TModule = packed record mVersion: DWord; mCIDs: array of TCIDEntry; mContractIDs: array of TContractIDEntry; mCategoryEntries: array of TCategoryEntry; getFactoryProc: Pointer; loadProc: Pointer; unloadProc: Pointer; end; PModule = ^TModule; PPModule = ^PModule; var mCIDs: array [0..1] of TCIDEntry = ( ( cid: @Sample_cid; service: False; getFactoryProc: nil; constructorProc: @MyComponentConstructor ), ( cid: nil; service: False; getFactoryProc: nil; constructorProc: nil ) ); mContractIDs: array [0..1] of TContractIDEntry = ( ( constractid: Sample_CONTRACTID; cid: @Sample_cid ), ( constractid: nil; cid: nil ) ); mCategoryEntries: array [0..2] of TCategoryEntry = ( ( category: 'JavaScript-global-property'; entry: 'MyComponent'; value: Sample_CONTRACTID ), ( category: 'JavaScript-global-constructor'; entry: 'MyComponent'; value: Sample_CONTRACTID ), ( category: nil; entry: nil; value: nil ) ); NSModuleElem: TModule = ( mVersion: 1; mCIDs: @mCIDs; mContractIDs: @mContractIDs; mCategoryEntries: @mCategoryEntries; getFactoryProc: nil; loadProc: nil; unloadProc: nil ); NSModule: PModule = Addr(NSModuleElem); exports NSModule name 'NSModule'; </code></pre> <p>Now if you can send me GenericClassInfo implementation in delphi that would be awesome :)</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload