Click here to Skip to main content
15,891,033 members
Home / Discussions / C#
   

C#

 
GeneralRe: Integrating C++ and C# code Pin
Heath Stewart24-Aug-04 7:57
protectorHeath Stewart24-Aug-04 7:57 
GeneralRe: Integrating C++ and C# code Pin
Nick Parker24-Aug-04 7:34
protectorNick Parker24-Aug-04 7:34 
GeneralRe: Integrating C++ and C# code Pin
crushinghellhammer24-Aug-04 8:13
crushinghellhammer24-Aug-04 8:13 
GeneralRe: Integrating C++ and C# code Pin
Heath Stewart24-Aug-04 9:05
protectorHeath Stewart24-Aug-04 9:05 
GeneralRe: Integrating C++ and C# code Pin
crushinghellhammer24-Aug-04 9:21
crushinghellhammer24-Aug-04 9:21 
GeneralRe: Integrating C++ and C# code Pin
Heath Stewart24-Aug-04 10:27
protectorHeath Stewart24-Aug-04 10:27 
GeneralRe: Integrating C++ and C# code Pin
crushinghellhammer24-Aug-04 11:59
crushinghellhammer24-Aug-04 11:59 
GeneralRe: Integrating C++ and C# code Pin
Heath Stewart24-Aug-04 16:12
protectorHeath Stewart24-Aug-04 16:12 
Depends - is the DSP a COM object or exported functions (perhaps even a class - but that gets more complicated; see the CallingConvention.ThisCall for details - and you'll need to implement an exported class factory function).

If it's COM, declare your RCW (don't forget all the attributes: ComImportAttribute, GuidAttribute, etc.), or use tlbimp.exe or VS.NET's Add Reference if you're COM server has a typelib (or you have a detached typelib).

If you're using exported functions, you'll need to use P/Invoke (see DllImportAttribute) to call the functions. With CallingConvention.ThisCall, you declare your functions with an extra parameter (the first parameter!) that is an IntPtr, which is a handle to your object. You should also define and export a class factory function, as well as a destruction function to tear-down the object.

See a previous reply I wrote for more details about ThisCall: http://www.codeproject.com/script/comments/forums.asp?msg=771919&forumid=1649#xx771919xx[^].

 

Software Design Engineer
Developer Division Sustained Engineering, Microsoft
My Articles
GeneralRe: Integrating C++ and C# code Pin
Tom Larsen24-Aug-04 11:19
Tom Larsen24-Aug-04 11:19 
GeneralSimple Reflenction Pin
afronaut24-Aug-04 6:24
afronaut24-Aug-04 6:24 
GeneralRe: Simple Reflenction Pin
Charlie Williams24-Aug-04 7:25
Charlie Williams24-Aug-04 7:25 
GeneralRe: Simple Reflenction Pin
afronaut24-Aug-04 8:33
afronaut24-Aug-04 8:33 
GeneralGetWindowText/GetForegroundWindow Pin
pat27088124-Aug-04 5:46
pat27088124-Aug-04 5:46 
GeneralRe: GetWindowText/GetForegroundWindow Pin
Charlie Williams24-Aug-04 6:18
Charlie Williams24-Aug-04 6:18 
GeneralRe: GetWindowText/GetForegroundWindow Pin
pat27088124-Aug-04 7:02
pat27088124-Aug-04 7:02 
GeneralRe: GetWindowText/GetForegroundWindow Pin
pat27088124-Aug-04 11:44
pat27088124-Aug-04 11:44 
GeneralCopying txt input from 1 form to the other Pin
steve_rm24-Aug-04 5:14
steve_rm24-Aug-04 5:14 
GeneralRe: Copying txt input from 1 form to the other Pin
Steve Maier24-Aug-04 5:26
professionalSteve Maier24-Aug-04 5:26 
GeneralRe: Copying txt input from 1 form to the other Pin
Heath Stewart24-Aug-04 8:57
protectorHeath Stewart24-Aug-04 8:57 
GeneralRe: Copying txt input from 1 form to the other Pin
steve_rm25-Aug-04 3:02
steve_rm25-Aug-04 3:02 
GeneralRe: Copying txt input from 1 form to the other Pin
LongRange.Shooter25-Aug-04 4:44
LongRange.Shooter25-Aug-04 4:44 
Generalproject options (advice) Pin
HudsonKane24-Aug-04 3:13
HudsonKane24-Aug-04 3:13 
GeneralRe: project options (advice) Pin
Steve Maier24-Aug-04 4:45
professionalSteve Maier24-Aug-04 4:45 
GeneralRe: project options (advice) Pin
HudsonKane24-Aug-04 5:33
HudsonKane24-Aug-04 5:33 
GeneralRe: project options (advice) Pin
HudsonKane24-Aug-04 5:36
HudsonKane24-Aug-04 5:36 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.