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

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 5668
"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
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
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
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
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
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
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
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
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
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
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
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:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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,...
0
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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,...

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.