Click here to Skip to main content
15,885,936 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
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 
GeneralRe: Using C# in C++ Pin
Chris_Green9-Jun-11 0:54
Chris_Green9-Jun-11 0:54 
GeneralRe: Using C# in C++ Pin
Rolf Kristensen9-Jun-11 8:43
Rolf Kristensen9-Jun-11 8:43 
GeneralRe: Using C# in C++ Pin
CPallini9-Jun-11 22:03
mveCPallini9-Jun-11 22:03 
AnswerRe: Using C# in C++ Pin
ThatsAlok13-Jun-11 21:14
ThatsAlok13-Jun-11 21:14 
AnswerRe: Using C# in C++ Pin
ThatsAlok13-Jun-11 21:16
ThatsAlok13-Jun-11 21:16 
QuestionFont Size Problem in Edit Control [SOLVED] Pin
vishalgpt8-Jun-11 19:37
vishalgpt8-Jun-11 19:37 
AnswerRe: Font Size Problem in Edit Control Pin
Richard MacCutchan8-Jun-11 21:42
mveRichard MacCutchan8-Jun-11 21:42 
GeneralRe: Font Size Problem in Edit Control Pin
vishalgpt8-Jun-11 22:16
vishalgpt8-Jun-11 22:16 
GeneralRe: Font Size Problem in Edit Control Pin
Richard MacCutchan9-Jun-11 4:07
mveRichard MacCutchan9-Jun-11 4:07 
GeneralRe: Font Size Problem in Edit Control Pin
vishalgpt9-Jun-11 7:04
vishalgpt9-Jun-11 7:04 
GeneralRe: Font Size Problem in Edit Control Pin
Richard MacCutchan9-Jun-11 7:23
mveRichard MacCutchan9-Jun-11 7:23 
GeneralRe: Font Size Problem in Edit Control Pin
vishalgpt9-Jun-11 7:32
vishalgpt9-Jun-11 7:32 
GeneralRe: Font Size Problem in Edit Control Pin
Iain Clarke, Warrior Programmer9-Jun-11 8:03
Iain Clarke, Warrior Programmer9-Jun-11 8:03 
GeneralRe: Font Size Problem in Edit Control Pin
vishalgpt10-Jun-11 17:28
vishalgpt10-Jun-11 17:28 
Questionhow to get the code of OnLButtonDown and OnMouseMove etc in OnDraw method ? Pin
iampradeepsharma8-Jun-11 17:13
iampradeepsharma8-Jun-11 17:13 
AnswerRe: how to get the code of OnLButtonDown and OnMouseMove etc in OnDraw method ? Pin
Cedric Moonen8-Jun-11 20:29
Cedric Moonen8-Jun-11 20:29 

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.