473,498 Members | 1,972 Online
Bytes | Software Development & Data Engineering Community
+ 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 1510
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
2610
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
2839
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
1101
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
2249
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
2719
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
2423
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
1960
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
7125
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
7004
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
7167
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
7208
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...
0
7379
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
5464
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
4915
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
3095
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
3085
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.