473,513 Members | 2,263 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

call c# written dll function from command line

Hello together,

i'm trying to call some functions wirtten in c# and compiled as a type
library (dll) trough the windows cmd shell. Is this generally possible?

My first idea was it to use rundll32.exe to call my user defined function,
but if i try to make a call like this: rundll32.exe mylib.dll,myFunc
Param1,Param2

The srouce code looks like this example
namespace test {
class TestClass {
public static myFunc(int param1, string param2){
/*SourceCode*/
return (ReturnData)
}
}
}

Is there Something special i have to consider?

regards
Roland
Nov 22 '05 #1
2 5677
"Roli79" <Ro****@discussions.microsoft.com> wrote in message
news:F8**********************************@microsof t.com...
Hello together,

i'm trying to call some functions wirtten in c# and compiled as a type
library (dll) trough the windows cmd shell. Is this generally possible?


AFAIK this isn't possible. I've certainly never found myself in a position
where I've needed to look too closely at it. Why not just create a console
project that forwards command line arguments to your library?

--
Regards,

Tim Haughton

Agitek
http://agitek.co.uk
http://blogitek.com/timhaughton
Nov 22 '05 #2
Dont know of any that exist out of the box, but you could write your own
console app that uses reflection to acquire the methodinfo on the
dll, and dynamically invoke it that way.
Roli79 wrote:
Hello together,

i'm trying to call some functions wirtten in c# and compiled as a type
library (dll) trough the windows cmd shell. Is this generally possible?

My first idea was it to use rundll32.exe to call my user defined function,
but if i try to make a call like this: rundll32.exe mylib.dll,myFunc
Param1,Param2

The srouce code looks like this example
namespace test {
class TestClass {
public static myFunc(int param1, string param2){
/*SourceCode*/
return (ReturnData)
}
}
}

Is there Something special i have to consider?

regards
Roland

Nov 22 '05 #3

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

Similar topics

1
19327
by: sam | last post by:
I have a function writen in Perl that takes a name-value list (array) as argument and returns a name-value list (array). My question is: How to call this function from PHP and get the returned...
39
6482
by: Randell D. | last post by:
Folks, I'm sure this can be done legally, and not thru tricks of the trade - I hope someone can help. I'm writing a 'tool' (a function) which can be used generically in any of my projects. ...
2
936
by: Roli79 | last post by:
Hello together, i'm trying to call some functions wirtten in c# and compiled as a type library (dll) trough the windows cmd shell. Is this generally possible? My first idea was it to use...
8
35030
by: zhiwei wang | last post by:
I remember that there is a function that could invoke shell command such as "rm" "cp", directly in .c file. But I could not recall its name, and I googled with nothing meaningful. I vaguely...
1
18041
by: drewmania001 | last post by:
i've read various info on the web including the following http://php.mirrors.ilisys.com.au/manual/en/ref.mysqli.php mySQL Version 4.1.16 PHP Version 5.1.2 with Zend Engine v2.1.0 OS Windows...
2
37475
by: tonytony24 | last post by:
Hi All: I was wondering if there's a simple way to call a MS Access Module through either Command Prompt MS Script any other way... Thanks for the response.
3
10662
by: balakrishnan.dinesh | last post by:
hi frndz, I need to call a C program function from php code, Is that possible, If it is ,then tell me how ? i.e,main() { int callfunction(); int i=2; callfunction(i); } callfucntion(int i)
15
11307
by: AmmarN | last post by:
Hi all, I have a c++ programme that intakes a binary file and performs various operations on it. I am not gonna get in to the details of the operations, currently i specify the order in which the...
9
4448
by: C++ Newbie | last post by:
Hi, Why doesn't the following C++ program echo the value of 97? If you manually "head -3 temp.txt | tail -1" the temp.txt file, you will get 97. Use it in a system call, and it doesn't work. ...
35
4549
by: jleslie48 | last post by:
I've written a cgi program in C using the borland 5.5 free compiler, and it runs just fine on an Apache server. My only issue is if I issue some system calls the cgi suspends until the call...
0
7388
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,...
0
7547
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7114
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5693
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5098
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
4751
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3240
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3230
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1607
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.