473,480 Members | 1,669 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Calls from C code


Hi,

Is it possible to call a VB/C# class' method (or module) from within a C application? If so, is there any resource I could look at to see how to make this work?

Thanks
Mike
Nov 16 '05 #1
2 1509
Mike,

It is possible, but you will have to make the call through COM (set up
an apartment through a call to CoInitializeEx, then get a pointer to the
interface, etc, etc).

For more information on exposing your .NET components to COM, check out
the section of the .NET framework titled "Exposing .NET Framework Components
to COM", located at (watch for line wrap):

http://msdn.microsoft.com/library/de...nentsToCOM.asp

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com
"Mike" <no****@nospam.com> wrote in message
news:et**************@TK2MSFTNGP10.phx.gbl...

Hi,

Is it possible to call a VB/C# class' method (or module) from within a C
application? If so, is there any resource I could look at to see how to make
this work?

Thanks
Mike
Nov 16 '05 #2

Nicholas,

Thanks for the info. Do you have any link to information on how to program the call (set up an apartment through a call to CoInitializeEx, etc. etc.). This is something I am not particularly strong in.

Thanks
Mike

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in message news:u8*************@tk2msftngp13.phx.gbl...
Mike,

It is possible, but you will have to make the call through COM (set up
an apartment through a call to CoInitializeEx, then get a pointer to the
interface, etc, etc).

For more information on exposing your .NET components to COM, check out
the section of the .NET framework titled "Exposing .NET Framework Components
to COM", located at (watch for line wrap):

http://msdn.microsoft.com/library/de...nentsToCOM.asp

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com
"Mike" <no****@nospam.com> wrote in message
news:et**************@TK2MSFTNGP10.phx.gbl...

Hi,

Is it possible to call a VB/C# class' method (or module) from within a C
application? If so, is there any resource I could look at to see how to make
this work?

Thanks
Mike
Nov 16 '05 #3

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

Similar topics

10
2158
by: Nitin | last post by:
Ppl , Want to have ur opinions on having function calls like the one stated below: function funcA ( struct A *st_A , struct B *st_B ) { st_A->a = st_B->a
5
3787
by: RJ | last post by:
I tried using the Application object to store data in some variables, which would be globally accessible within the web service application code. On subsequent web method calls, the Application...
10
2608
by: Brian Parker | last post by:
I inherited a C++ DLL that I need to remotely call multiple times asynchronously. What I have developed is: CSharp web application that makes asynchronous calls to a CSharp Web Service. The...
4
3858
by: magennisw | last post by:
Our three tier web application is "pausing" under test loading (IIS 6.0 (win2003) -> Web services (win2003) -> SQL server) . The CPU usage on the W3WP.exe on both the web server and middle tier...
7
2837
by: Shak | last post by:
Hi all, I'm trying to write a thread-safe async method to send a message of the form (type)(contents). My model is as follows: private void SendMessage(int type, string message) { //lets...
8
1100
by: Peter Newman | last post by:
Im running vb.net 2003. Im still on a big learning curve with .net and like most people have great ideas on what id like a peice of software to do.... but lack the knowledge to do it I have...
6
2247
by: Dasn | last post by:
Hi, there. 'lines' is a large list of strings each of which is seperated by '\t' I wanna split each string into a list. For speed, using map() instead of 'for' loop. 'map(str.split, lines)'...
8
2718
by: Grizlyk | last post by:
Good morning. Look here: http://groups.google.com/group/fido7.ru.cpp.chainik/browse_frm/thread/7341aba5238c0f79 and here:...
21
2421
by: omkar pangarkar | last post by:
Hi all, I have two simple hello world programs one using printf() and other using write() --prog 1-- #include<stdio.h> #include<stdlib.h> int main() { printf("Hello"); /* up to here...
1
1958
by: =?Utf-8?B?TWFyaw==?= | last post by:
Hi... There are a few questions wrapped up in this, but the main one is that the WebService.MyMethodAsync() methods that are automatically generated in the client code by VS 2005 don't seem to...
0
7037
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
6904
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7034
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,...
1
4768
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
4472
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
2990
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
2976
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1294
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 ...
0
174
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.