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

How can I call a C function from php (with argmts) ?

How can I call a C function from php (with argmts)?

In fact, I just need to call a C function which is in a library. I tried this :
system('rundll32.exe library.dll,function 20 ');

I can call my function but I can't pass 20 as an argument to my C function.

I also checked php extensions but clearly that is not what I need

Many thanks in advance for your answers
Sep 9 '10 #1
3 1660
ashitpro
542 Expert 512MB
You said you can call your function, Does that mean like this

"rundll32.exe library.dll,function" ?

What error does it gives if you run it with 20 as an argument?

Does that function really accepts an argument?

You can check it using "dll export viewer"
Sep 9 '10 #2
The function is executed and it should display the argument I gave but instead I have a random number.
Could you explain more about the dll export viewer please ?
Sep 9 '10 #3
Dheeraj Joshi
1,123 Expert 1GB
You can use swig for this purpose. This may help you.

Regards
Dheeraj Joshi
Sep 9 '10 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

25
by: Sabyasachi Basu | last post by:
While trying to port some stuff from Unix to Windows, I encountered a strange behaviour of function macros with empty arguments. Here is a small snippet which illustrates the problem: #include...
2
by: PawelR | last post by:
Hello Group, In my application I have few class, and I want call function with "master class". This is as master form (startClass) and option window (ClassA). My question is how call function...
4
by: Dave | last post by:
I have a program that I've written a class for. I need to call the function in the program from the class. When I try to call the function I receive the error, the name xxx does not exist in the...
2
by: moondaddy | last post by:
I'm using vb.net and have an aspx page where I want to call a function in the code behind to do something on the backend and I want to call this function from a jscript function in the aspx page. ...
7
by: Tiraman | last post by:
Hi , I have 3 files , middle.aspx file include the header.aspx and footer.aspx files . in each of the include files there is a function and from some reason the call to the Footer() function...
12
by: leaf | last post by:
Hi, How to call function at runtime, based on a struct that contains the information for the function call: struct func_to_call { int function_id; // function id to call unsigned int nparams;...
2
by: Amit | last post by:
how can i call one project function in other project within a single solution. plz tell me the solution
0
by: lvpaul | last post by:
Hello ! I am calling a .NET Webservice and getting back a ADO.NET Datatset. How can I convert this to an PHP-Array ? $ergebnis = $m_service->call( $function, $data ); print_r($ergebnis)...
1
by: Alkimake | last post by:
here is the code that i am using for recursion to view the tree of my database records. recurs(48); $i =0; function recurs($ownerid) { global $i; $sqlOne="SELECT * FROM sub_cat WHERE...
1
by: Khai Doan | last post by:
I have function A, which need to call function B with the exact same argument list. What is the correct way to do this? I had function A: function A { B(arguments); } but it does not...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
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...

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.