Click here to Skip to main content
15,921,905 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: [Win32] Threads communication Pin
Albert Holguin10-Jun-11 13:31
professionalAlbert Holguin10-Jun-11 13:31 
AnswerRe: [Win32] Threads communication Pin
lijiantao11-Jun-11 5:32
lijiantao11-Jun-11 5:32 
QuestionMFC Multiple document types in SDI application Pin
Mattias G10-Jun-11 0:55
Mattias G10-Jun-11 0:55 
QuestionDebugging application minidump using windbg Pin
Prasann Mayekar9-Jun-11 23:04
Prasann Mayekar9-Jun-11 23:04 
AnswerRe: Debugging application minidump using windbg Pin
Sarath C10-Jun-11 2:27
Sarath C10-Jun-11 2:27 
QuestionC++ expression evaluation. Pin
Sameerkumar Namdeo9-Jun-11 22:57
Sameerkumar Namdeo9-Jun-11 22:57 
AnswerRe: C++ expression evaluation. Pin
CPallini10-Jun-11 0:25
mveCPallini10-Jun-11 0:25 
AnswerRe: C++ expression evaluation. Pin
Luc Pattyn10-Jun-11 1:03
sitebuilderLuc Pattyn10-Jun-11 1:03 
AnswerRe: C++ expression evaluation. Pin
Sameerkumar Namdeo12-Jun-11 20:39
Sameerkumar Namdeo12-Jun-11 20:39 
AnswerRe: C++ expression evaluation. Pin
Niklas L12-Jun-11 21:26
Niklas L12-Jun-11 21:26 
Questioninternationalisation Pin
Kyudos9-Jun-11 12:52
Kyudos9-Jun-11 12:52 
AnswerRe: internationalisation Pin
Sameerkumar Namdeo9-Jun-11 23:08
Sameerkumar Namdeo9-Jun-11 23:08 
GeneralRe: internationalisation Pin
Mattias G9-Jun-11 23:26
Mattias G9-Jun-11 23:26 
GeneralRe: internationalisation Pin
Kyudos12-Jun-11 10:56
Kyudos12-Jun-11 10:56 
AnswerRe: internationalisation Pin
jschell10-Jun-11 12:47
jschell10-Jun-11 12:47 
AnswerRe: internationalisation Pin
Abhi Lahare13-Jun-11 6:49
Abhi Lahare13-Jun-11 6:49 
GeneralRe: internationalisation Pin
Kyudos14-Jun-11 10:50
Kyudos14-Jun-11 10:50 
GeneralRe: internationalisation Pin
Abhi Lahare14-Jun-11 11:29
Abhi Lahare14-Jun-11 11:29 
QuestionWant to find Rightmost top point from the CPoint List Pin
Abhijit_Satpute9-Jun-11 8:27
Abhijit_Satpute9-Jun-11 8:27 
AnswerRe: Want to find Rightmost top point from the CPoint List Pin
MicroVirus9-Jun-11 10:03
MicroVirus9-Jun-11 10:03 
AnswerRe: Want to find Rightmost top point from the CPoint List Pin
Richard MacCutchan9-Jun-11 10:32
mveRichard MacCutchan9-Jun-11 10:32 
AnswerRe: Want to find Rightmost top point from the CPoint List Pin
CPallini9-Jun-11 22:09
mveCPallini9-Jun-11 22:09 
AnswerRe: Want to find Rightmost top point from the CPoint List Pin
Stefan_Lang15-Jun-11 2:46
Stefan_Lang15-Jun-11 2:46 
QuestionUsing C# in C++ Pin
Chris_Green8-Jun-11 23:54
Chris_Green8-Jun-11 23:54 
Hi,

I have a sample project where I am using a C# library in a C++ test program. I'm doing this by COM, using the tlb and project reference.

C#
<br />
    [ComVisible(true)]<br />
    [ClassInterface(ClassInterfaceType.AutoDual)]<br />
    public class Math<br />
    {<br />
        public int Add(int x, int y)<br />
        {<br />
            return x + y;<br />
        }<br />
<br />
        public static int Subtract(int x, int y)<br />
        {<br />
            return x - y;<br />
        }<br />
    }<br />


C++
<br />
#include "stdafx.h"<br />
#include <iostream><br />
<br />
#import "..\\CSharpUsefulLibrary.tlb" raw_interfaces_only<br />
<br />
int _tmain(int argc, _TCHAR* argv[])<br />
{<br />
    CoInitialize(0);<br />
<br />
    CSharpUsefulLibrary::_MathPtr math(__uuidof(CSharpUsefulLibrary::Math));<br />
<br />
    long value;<br />
    math->Add(1, 2, &value);<br />
    std::wcout << "The value is " << value;<br />
<br />
    CoUninitialize();<br />
	return 0;<br />
}<br />


So this works fine, I'm able to call the add method in my C# library from C++. The question is, how do I call the static subtract method?
AnswerRe: Using C# in C++ Pin
CPallini9-Jun-11 0:24
mveCPallini9-Jun-11 0:24 

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.