473,406 Members | 2,439 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,406 software developers and data experts.

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 1507
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
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
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
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
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
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
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
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
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
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
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
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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
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
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...

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.