Hi I have a vb.net app and am trying to call a C program from it, perhaps a dll or executable. This is unmanaged code, just wondering if someone could provide a brief example? Thanks Paul.
Hi I have a vb.net app and am trying to call a C program from it, perhaps a dll or executable. This is unmanaged code, just wondering if someone could provide a brief example? Thanks Paul.
An executable can be run from VB's shell statement or you can use the
System.Diagnostics.Process class if you need more control. If your
trying to call exported functions, then you'll want to look into using
P/Invoke... If you have the C definitions for the functions, we would
be happy to help you translate some of them and give you pointers...
Hi I have a vb.net app and am trying to call a C program from it,
perhaps a dll or executable. This is unmanaged code, just wondering if
someone could provide a brief example? Thanks Paul.
thanks for the information. How would I call this simple c function from vb.net passing params to it and also receiving the return param.
vb.net want to pass in 3,4 and get the integer results
results = sum_a_and_b(3,4)
c function
int sum_a_and_b (int a, int b)
{
int c;
c = a + b;
return (c);
}
thanks for the information. How would I call this simple c function from vb.net passing params to it and also receiving the return param.
vb.net want to pass in 3,4 and get the integer result
results = sum_a_and_b(3,4
thanks for the information. How would I call this simple c function from vb.net passing params to it and also receiving the return param.
vb.net want to pass in 3,4 and get the integer results
results = sum_a_and_b(3,4)
c function
int sum_a_and_b (int a, int b)
{
int c;
c = a + b;
return (c);
}
You will have to export the function as 'stdcall': '_declspec(dllexport)
<datatype> _stdcall'. You will get more info on this topic in the C++
group.
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.