Creating DLL with C# according to 3rd party specs


V

vikrampant

I was hoping someone could point me in the right direction as to
setting up a class file in my DLL. (I am using a third party toolbar
builder and I have a limited set of instructions on the DLL I can
create to extend some of the button actions.)

The 3rd party app's documentation for DLL is as follows,
"...it meets few requirements:
- It must export procedure called Main() with two parameters
- First parameter is a pointer to TPanel structure which represents
our toolbar
- Second parameter is a pointer to IWebBrowser2 representing Internet
Explorer's Web Browser
When CallDll() is executed it calls Main() procedure from DLL and
passes pointers to toolbar's TPanel structure and to Web Browser. "

I cannot seem to figure out how to get this started in C# using the
Main() with two parameters as mentioned above and was hoping I could
get some advice on starting my project.

The app provides a Delphi sample code as follows,
procedure Main(ToolbarHost: TPanel; IE: IWebBrowser2);
var First, Second: Extended;
begin
if TryStrToFloat(TEdit(ToolbarHost.FindComponent('EditBox1')).Text,
First)
and TryStrToFloat(TEdit(ToolbarHost.FindComponent('EditBox2')).Text,
Second) then
SetUrlToIE(IE.HWND, 'Result is: ' + FormatFloat('0.00', First *
Second))
else
MessageDlg('Wrong number format!', mtError, [mbOk], 0);
end;

I've tried static void Main(TPanel, IWebBrowser2){...} with no luck.

Thanks for any help anyone can provide.
 
Ad

Advertisements

M

Mattias Sjögren

I was hoping someone could point me in the right direction as to
setting up a class file in my DLL. (I am using a third party toolbar
builder and I have a limited set of instructions on the DLL I can
create to extend some of the button actions.)

Does the application even support managed assemblies? In C# you can't
export static entrypoints the same way you can in C/C++ and Delphi.

Also, passing language/framework specific types such as TPanel across
module boundaries is not very cross language friendly.


Mattias
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top