Click here to Skip to main content
15,915,019 members
Home / Discussions / COM
   

COM

 
GeneralShell programming with COM Pin
alex__b30-Jun-05 19:13
professionalalex__b30-Jun-05 19:13 
GeneralOutlook express add in Pin
Wessam Fathi30-Jun-05 13:00
Wessam Fathi30-Jun-05 13:00 
GeneralRe: Outlook express add in Pin
ThatsAlok3-Jul-05 20:21
ThatsAlok3-Jul-05 20:21 
GeneralMultiple processes in single window Pin
Bill Chan30-Jun-05 10:36
Bill Chan30-Jun-05 10:36 
GeneralRe: Multiple processes in single window Pin
Umair Ahmad khan6-Jul-05 12:04
Umair Ahmad khan6-Jul-05 12:04 
Generalcontext menu handler Pin
_kane_29-Jun-05 19:47
_kane_29-Jun-05 19:47 
GeneralRemotely accessing COM from ASP.NET APPLICATION Pin
29-Jun-05 17:13
suss29-Jun-05 17:13 
GeneralCode wont compile Pin
Anonymous29-Jun-05 12:55
Anonymous29-Jun-05 12:55 
I am lerning COM and this is as simple as I can get.


Here is my interface.h file

/////////////////////////////////////////////////////
extern "C" const IID IID_IMath;

// {2BD8F185-7D1C-4058-9B98-C29E343E858F}noblk

extern "C" const IID IID_IMath =
{ 0x2bd8f185, 0x7d1c, 0x4058, { 0x9b, 0x98, 0xc2, 0x9e, 0x34, 0x3e, 0x85, 0x8f } };


interface IMath
{
public:
virtual long Add(long n1, long n2) = 0;
virtual long Sub(long n1, long n2) = 0;
};

////////////////////////////////////////////////////

but if I add the math.cpp to my project is gives me the following
error message:

fatal error C1010: unexpected end of file while looking for precompiled header directive
Error executing cl.exe.

////////////////////////////////////////////////////////

here's my math.cpp
/////////////////////////////

#include "interface.h"
#include <iostream.h>


class CMath : public IMath
{
public:
CMath();
~CMath();

virtual long Add(long n1, long n2);
virtual long Sub(long n1, long n2);
};


CMath::CMath()
{
cout << "\nCMath Constructor called." << endl;
}

CMath::~CMath()
{
cout << "\n CMath Destructor called" << endl;
}

long CMath::Add(long n1, long n2)
{
return n1 + n2;
}

long CMath::Sub(long n1, long n2)
{
return n1 - n2;
}


I HAVENT BEEN ABLE TO FIND THE SOURCE OF THIS ERROR, Please Help!
Confused | :confused:

Thanks
GeneralRe: Code wont compile Pin
odiesback29-Jun-05 13:03
odiesback29-Jun-05 13:03 
GeneralActiveX client/server architecture Pin
VKatti29-Jun-05 5:31
VKatti29-Jun-05 5:31 
GeneralRe: ActiveX client/server architecture Pin
onlyfish30-Jun-05 22:45
onlyfish30-Jun-05 22:45 
GeneralRe: ActiveX client/server architecture Pin
rwestgraham1-Jul-05 16:35
rwestgraham1-Jul-05 16:35 
GeneralShell Extension: how to hook to directory Pin
chenfred29-Jun-05 5:31
chenfred29-Jun-05 5:31 
GeneralRe: got answer Pin
chenfred29-Jun-05 7:33
chenfred29-Jun-05 7:33 
GeneralRe: Shell Extension: how to hook to directory Pin
alex__b4-Jul-05 6:41
professionalalex__b4-Jul-05 6:41 
GeneralOutlook application object - Calendar Pin
Brigg Thorp29-Jun-05 3:04
Brigg Thorp29-Jun-05 3:04 
Generaladding visual studio 6 dll to c# app Pin
johniboy28-Jun-05 23:14
sussjohniboy28-Jun-05 23:14 
GeneralRe: adding visual studio 6 dll to c# app Pin
stonewall_20001-Jul-05 0:08
stonewall_20001-Jul-05 0:08 
General7000vDatabase COM Threads Pin
FJK28-Jun-05 19:25
FJK28-Jun-05 19:25 
GeneralRe: 7000vDatabase COM Threads Pin
rwestgraham1-Jul-05 17:01
rwestgraham1-Jul-05 17:01 
GeneralRe: 7000vDatabase COM Threads Pin
FJK3-Jul-05 18:45
FJK3-Jul-05 18:45 
GeneralXMLDOMDocument across processes Pin
Alex_Y28-Jun-05 6:28
Alex_Y28-Jun-05 6:28 
GeneralRe: XMLDOMDocument across processes Pin
Alex_Y28-Jun-05 9:23
Alex_Y28-Jun-05 9:23 
GeneralRe: XMLDOMDocument across processes Pin
Lim Bio Liong28-Jun-05 14:27
Lim Bio Liong28-Jun-05 14:27 
GeneralBrowser Helper Object - replace HTML page Pin
Tomek.Sergey28-Jun-05 3:04
Tomek.Sergey28-Jun-05 3:04 

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.