473,386 Members | 1,699 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Creating DLL with C# according to 3rd party specs

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('Edi tBox1')).Text,
First)
and TryStrToFloat(TEdit(ToolbarHost.FindComponent('Edi tBox2')).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.

Apr 25 '07 #1
1 1108
>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

--
Mattias Sjögren [C# MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
Apr 26 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Edvard Majakari | last post by:
Greetings, fellow Pythonistas! I'm about to create three modules. As an avid TDD fan I'd like to create typical 'use-cases' for each of these modules. One of them is rather large, and I wondered...
6
by: Lisa | last post by:
Is there any way to create a tif file from ASP? I would like to essentially create a tif of a formatted textual document. Any insight would be appreciated.
7
by: Justin | last post by:
I am extremely new at SQL Server2000 and t-sql and I'm looking to create a simple trigger. For explanation sake, let's say I have 3 columns in one table ... Col_1, Col_2 and Col_3. The data type...
6
by: owen | last post by:
Generally speaking, what does it mean when I see a "button" with red text showing this message instead of the control I've dragged onto the web form in Design View.? (But the page works fine at...
19
by: Steve | last post by:
Can anyone point me to a primer for creating OCX controls in VB .net? In particular, I want to access a web service in a VB6 application (not an easy thing to do). So, if I can write an ActiveX...
0
by: David Elliott | last post by:
I have a 3rd Party DLL that is a Win32 NOT .NET Assembly that is misbehaving. I am trying to isolate it in its own AppDomain. I got to load but can not create an instance. I receive the following...
11
by: Konrad Den Ende | last post by:
I have a function returning a string but the problem is that the color of it is blue which suits me well for some pages but not for others. Is it possible to "feel" what the color of the background...
3
by: Robin S. | last post by:
This is more of a structural question (me: newbie) as opposed to specific coding. Please be patient... I'm making a database for the small company I work for. It will be to add and edit products...
4
by: Zerofury | last post by:
Okay here's what i'm trying to do. I want to create an array and fill it with objects, so that when i create a method to alphabetize them, all of the pieces (the price, name, ect) don't get all out...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.