473,378 Members | 1,139 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,378 software developers and data experts.

export dll function

Hello,

I'm trying to write a program (dll) to use with mIRC.
mIRC wants me to use these kind of functions:

int __stdcall procname(HWND mWnd, HWND aWnd, char *data, char *parms, BOOL
show, BOOL nopause)

translated into C# code, I think it's this:

int function(int mWnd,int aWnd, char [] data, char [] parms, bool show,bool
nopause)

now another problem is exporting this function so mIRC can see it. A
tutorial says something about creating a DEF file, but that's probably only
for C++? A search on MSDN gave me this: "This requires a DLL export, which
..NET Framework does not support" Does this mean I can't do this and all my
work was for nothing?

tia,
Nov 15 '05 #1
8 20350
You will not be able to export dll function in C#. Maybe
mIRC will take COM objects?

Tu-Thach
-----Original Message-----
Hello,

I'm trying to write a program (dll) to use with mIRC.
mIRC wants me to use these kind of functions:

int __stdcall procname(HWND mWnd, HWND aWnd, char *data, char *parms, BOOLshow, BOOL nopause)

translated into C# code, I think it's this:

int function(int mWnd,int aWnd, char [] data, char [] parms, bool show,boolnopause)

now another problem is exporting this function so mIRC can see it. Atutorial says something about creating a DEF file, but that's probably onlyfor C++? A search on MSDN gave me this: "This requires a DLL export, which..NET Framework does not support" Does this mean I can't do this and all mywork was for nothing?

tia,
.

Nov 15 '05 #2
yes mIRC can take COM objects...
"Tu-Thach" <tu*****@yahoo.com> schreef in bericht
news:8c****************************@phx.gbl...
You will not be able to export dll function in C#. Maybe
mIRC will take COM objects?

Tu-Thach
-----Original Message-----
Hello,

I'm trying to write a program (dll) to use with mIRC.
mIRC wants me to use these kind of functions:

int __stdcall procname(HWND mWnd, HWND aWnd, char *data,

char *parms, BOOL
show, BOOL nopause)

translated into C# code, I think it's this:

int function(int mWnd,int aWnd, char [] data, char []

parms, bool show,bool
nopause)

now another problem is exporting this function so mIRC

can see it. A
tutorial says something about creating a DEF file, but

that's probably only
for C++? A search on MSDN gave me this: "This requires a

DLL export, which
..NET Framework does not support" Does this mean I can't

do this and all my
work was for nothing?

tia,
.

Nov 15 '05 #3
C# DLLs cannot be exported due to the underlying nature of .NET. What you
might be able to do is translate your work over to C++ and do it that way,
but as for C#, it's out.
HTH,

Bill P.
On Tue, 5 Aug 2003 14:17:20 +0200, An Ony <no*****@somewhere.net> wrote:
Hello,

I'm trying to write a program (dll) to use with mIRC.
mIRC wants me to use these kind of functions:

int __stdcall procname(HWND mWnd, HWND aWnd, char *data, char *parms,
BOOL
show, BOOL nopause)

translated into C# code, I think it's this:

int function(int mWnd,int aWnd, char [] data, char [] parms, bool
show,bool
nopause)

now another problem is exporting this function so mIRC can see it. A
tutorial says something about creating a DEF file, but that's probably
only
for C++? A search on MSDN gave me this: "This requires a DLL export,
which
.NET Framework does not support" Does this mean I can't do this and all
my
work was for nothing?

tia,


--
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
Nov 15 '05 #4
Then you can write your COM object in C# and .NET and use
it with mIRC. You still need the .NET run-time
environment in order for it to work.

Tu-Thach
-----Original Message-----
yes mIRC can take COM objects...
"Tu-Thach" <tu*****@yahoo.com> schreef in bericht
news:8c****************************@phx.gbl...
You will not be able to export dll function in C#. Maybe mIRC will take COM objects?

Tu-Thach
>-----Original Message-----
>Hello,
>
>I'm trying to write a program (dll) to use with mIRC.
>mIRC wants me to use these kind of functions:
>
>int __stdcall procname(HWND mWnd, HWND aWnd, char
*data, char *parms, BOOL
>show, BOOL nopause)
>
>translated into C# code, I think it's this:
>
>int function(int mWnd,int aWnd, char [] data, char []

parms, bool show,bool
>nopause)
>
>now another problem is exporting this function so mIRC

can see it. A
>tutorial says something about creating a DEF file, but

that's probably only
>for C++? A search on MSDN gave me this: "This requires
a DLL export, which
>..NET Framework does not support" Does this mean I
can't do this and all my
>work was for nothing?
>
>tia,
>
>
>.
>

.

Nov 15 '05 #5
Hmm, I come from Java and don't know C++, but will "C++ .NET" be able to
export DLL functions?

"Bill Priess" <no*****@nospam.com> schreef in bericht
news:oprtfu580vcimqky@localhost...
C# DLLs cannot be exported due to the underlying nature of .NET. What you
might be able to do is translate your work over to C++ and do it that way,
but as for C#, it's out.
HTH,

Bill P.
On Tue, 5 Aug 2003 14:17:20 +0200, An Ony <no*****@somewhere.net> wrote:
Hello,

I'm trying to write a program (dll) to use with mIRC.
mIRC wants me to use these kind of functions:

int __stdcall procname(HWND mWnd, HWND aWnd, char *data, char *parms,
BOOL
show, BOOL nopause)

translated into C# code, I think it's this:

int function(int mWnd,int aWnd, char [] data, char [] parms, bool
show,bool
nopause)

now another problem is exporting this function so mIRC can see it. A
tutorial says something about creating a DEF file, but that's probably
only
for C++? A search on MSDN gave me this: "This requires a DLL export,
which
.NET Framework does not support" Does this mean I can't do this and all
my
work was for nothing?

tia,


--
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/

Nov 15 '05 #6
Jonathan Schafer wrote:
You can use Visual Studio to create Win32 dll's that are not part of
.NET. Just make a C++ project (non-managed) and make it a dll. Then
it's just like programming C++ before .NET.


It doesn't have to be a non-managed DLL. Managed C++ DLLs can export
functions. What the OP should do is make a small Managed C++ DLLs which
exports the desired functions. These functions then just delegate their
functionality to C# classes from his original project.

(Or go the COM route)

--
Arild Fines

http://ankhsvn.tigris.org
A Visual Studio .NET Addin for the Subversion version control system.
Nov 15 '05 #7
No of course it doesn't, but it doesn't require .NET doing it the old
fashioned way. It really depends on what the environment is.

Jonathan Schafer

On Wed, 6 Aug 2003 00:33:58 +0200, "Arild Fines"
<ar*********@should.not.be.here.broadpark.no> wrote:
Jonathan Schafer wrote:
You can use Visual Studio to create Win32 dll's that are not part of
.NET. Just make a C++ project (non-managed) and make it a dll. Then
it's just like programming C++ before .NET.


It doesn't have to be a non-managed DLL. Managed C++ DLLs can export
functions. What the OP should do is make a small Managed C++ DLLs which
exports the desired functions. These functions then just delegate their
functionality to C# classes from his original project.

(Or go the COM route)


Nov 15 '05 #8
OK, I'm trying it the COM way, first time I tried to write a COM object.
I'm having this as code:
================================================>
....
namespace QuotesDLL
{
[Guid("53D4E200-38B0-4925-9708-A96484BAF822")]
public interface QuoteInterface
{
[DispId(1)]
bool addQuote(string quote);
[DispId(2)]
string getQuote(string [] args);
[DispId(3)]
string getQuote();
}

[Guid("F4A45909-85FE-496c-AC5D-39380B92DE23")]
public class QuoteSystem : QuoteInterface
{ ...
<=============================================== ==
that's all good, right? Those methods in the interface are made public in
the implementation. Does it hurt to make other methods private? addQuote()
uses saveQuotes() and that's declared private, that's not interfering with
the whole "COM object"-idea, is it?

now I try to compile it, in debug mode all goes well, but I get:
RegAsm warning: No types were registered
Assembly exported to '...\QuotesDLL\bin\Debug\QuotesDLL.tlb', and the type
library was registered successfully

trying to compile it in Release mode, I get a build error:
COM Interop registration failed. There are no registrable types in the built
assembly.

manual run on the debug dll:
RegAsm warning: No registry script will be produced since there are no types
to register

I've checked the registry and I can find the interfaceid, but not the class
that implements the interface.
I have no experience whatsoever with writing COM objects, so I don't know
what to do or what goes wrong.
And on final level, how do I call the COM object using mIRC? The command
works as follows:
/comopen name progid
name: some name for the connection
but what is progid in this case? QuotesDLL? QuoteSystem? QuoteInteface? The
upper hex number or the lower hex number?
thx so much!
"Tu-Thach" <tu*****@yahoo.com> schreef in bericht
news:0c****************************@phx.gbl...
Then you can write your COM object in C# and .NET and use
it with mIRC. You still need the .NET run-time
environment in order for it to work.

Tu-Thach
-----Original Message-----
yes mIRC can take COM objects...
"Tu-Thach" <tu*****@yahoo.com> schreef in bericht
news:8c****************************@phx.gbl...
You will not be able to export dll function in C#. Maybe mIRC will take COM objects?

Tu-Thach

>-----Original Message-----
>Hello,
>
>I'm trying to write a program (dll) to use with mIRC.
>mIRC wants me to use these kind of functions:
>
>int __stdcall procname(HWND mWnd, HWND aWnd, char *data, char *parms, BOOL
>show, BOOL nopause)
>
>translated into C# code, I think it's this:
>
>int function(int mWnd,int aWnd, char [] data, char []
parms, bool show,bool
>nopause)
>
>now another problem is exporting this function so mIRC
can see it. A
>tutorial says something about creating a DEF file, but
that's probably only
>for C++? A search on MSDN gave me this: "This requires a DLL export, which
>..NET Framework does not support" Does this mean I can't do this and all my
>work was for nothing?
>
>tia,
>
>
>.
>

.

Nov 15 '05 #9

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

Similar topics

0
by: Shawn Mehaffie | last post by:
I have the following class that I've wirtten to take a Dataset and automatically export it to either XML, ASCII or Tab delimited file. The reason I wrote it they way I did was that I don't want to...
205
by: Jeremy Siek | last post by:
CALL FOR PAPERS/PARTICIPATION C++, Boost, and the Future of C++ Libraries Workshop at OOPSLA October 24-28, 2004 Vancouver, British Columbia, Canada http://tinyurl.com/4n5pf Submissions
5
by: Tim Eliot | last post by:
Just wondering if anyone has hit the following issue and how you might have sorted it out. I am using the command: DoCmd.TransferText acExportMerge, , stDataSource, stFileName, True after...
16
by: David Lauberts | last post by:
Hi Wonder if someone has some words of wisdom. I have a access 2002 form that contains 2 graph objects that overlay each other and would like to export them as a JPEG to use in a presentation....
2
by: Regnab | last post by:
I've got my code working so that it'll count the number of columns in the table and move across (eg Range A-P and then range Q-W). Problem is when I get to the end of the single letters and get...
0
by: Shawn Mehaffie | last post by:
I have the following class that I've wirtten to take a Dataset and automatically export it to either XML, ASCII or Tab delimited file. The reason I wrote it they way I did was that I don't want to...
17
by: Fabry | last post by:
Hi All, I'm new of this group and I do not know if this is the correct group for my question. I have a DLL with its export library (.lib) wrote in Borland C++ 6. In borland everything is OK and...
5
by: JHNielson | last post by:
I have a somewhat simple question, but have been baffled by it for a while, and now I'm on a tight deadline - have to get it done within 24 hours. I am trying to export a set of files to my hard...
5
by: bhodgins | last post by:
Hi, I am new on here, and had a newbie question that I am stumped with. I am not new to access, but am new to VB. I am trying to export BLOBs from a field called photo to external jpeg files. I...
3
by: Wayne | last post by:
I'm trying to automate the export of a query to a text file using code. If I export the query manually I get the exact result that I want i.e. If I select the query then choose File/Export from...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: 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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

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.