Click here to Skip to main content
15,910,118 members
Home / Discussions / COM
   

COM

 
GeneralRe: Accessing COM component from JScript Pin
User 21559723-Jul-07 19:57
User 21559723-Jul-07 19:57 
GeneralRe: Accessing COM component from JScript Pin
PriyaJ.220623-Jul-07 19:58
PriyaJ.220623-Jul-07 19:58 
GeneralRe: Accessing COM component from JScript Pin
User 21559723-Jul-07 21:01
User 21559723-Jul-07 21:01 
GeneralRe: Accessing COM component from JScript Pin
PriyaJ.220623-Jul-07 21:08
PriyaJ.220623-Jul-07 21:08 
GeneralRe: Accessing COM component from JScript Pin
User 21559723-Jul-07 21:16
User 21559723-Jul-07 21:16 
QuestionPass user defined type array Pin
scheewie20-Jul-07 3:23
scheewie20-Jul-07 3:23 
AnswerRe: Pass user defined type array Pin
sthotakura23-Jul-07 8:02
sthotakura23-Jul-07 8:02 
QuestionHow to include header file "Gdiplus.h" in IDL file Pin
Bidesh Mukherjee18-Jul-07 21:26
professionalBidesh Mukherjee18-Jul-07 21:26 
Hi all,

I have static lib which i want to convert into COM DLL. so have write an IDL file.
In this IDL file i have to define a structure which contains another structure COLOR which is defined in "Gdiplus.h".

My question is whether i can add this header file "Gdiplus.h" in the IDL file?
If yes then how. note that after including the "Gdiplus.h" i have mention its namespace also which is Gdiplus.

I have done it by including #import "Gdiplus.h" but error such as this is generated

C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Include\Gdiplus.h(25) : error MIDL2025 : syntax error : expecting an interface name or DispatchInterfaceName or CoclassName or ModuleName or LibraryName or a type specification near "namespace"

The IDL file for your reference...

//----------------------------------------------------------------------------
// File: Control.idl
//
// Desc: Interface definition for the IControl
//
//----------------------------------------------------------------------------

import "oaidl.idl";
import "ocidl.idl";
import "Gdiplus.h";
using namespace Gdiplus;

cpp_quote("// Structure containing the various color details of the meter display")
typedef struct _ColorInfo
{
Color NeedlePointerColor;
Color NeedleJointColor;
//Color TextColor;
COLORREF TextColor;
Color LargeGridColor;
Color SmallGridColor;
Color BackGroundColor;

// Constructor
_ColorInfo()
{
NeedlePointerColor = Color(255,163, 163, 163);
NeedleJointColor = Color(255,255, 255, 0);
//TextColor = Color(255,255, 255, 255);
TextColor = RGB(255, 255, 255);
LargeGridColor = Color(255,255, 255, 255);
SmallGridColor = Color(255,255, 255, 255);
BackGroundColor = Color(255, 0, 0, 0);
}

// Copy Constructor
_ColorInfo(const _ColorInfo &ColorInfo)
{
NeedlePointerColor = ColorInfo.NeedlePointerColor;
NeedleJointColor = ColorInfo.NeedleJointColor;
TextColor = ColorInfo.TextColor;
LargeGridColor = ColorInfo.LargeGridColor;
SmallGridColor = ColorInfo.SmallGridColor;
BackGroundColor = ColorInfo.BackGroundColor;
}

// Assignment operator overloading
_ColorInfo & operator = (const _ColorInfo &ColorInfo)
{
NeedlePointerColor = ColorInfo.NeedlePointerColor;
NeedleJointColor = ColorInfo.NeedleJointColor;
TextColor = ColorInfo.TextColor;
LargeGridColor = ColorInfo.LargeGridColor;
SmallGridColor = ColorInfo.SmallGridColor;
BackGroundColor = ColorInfo.BackGroundColor;
return *this;
}
} COLORINFO;

//-------------------------------------------------------------------------
// IControl InterfaceConfused | :confused:
// Desc: Exposes initialization method for the Control dll
//-------------------------------------------------------------------------
[
object,
uuid(5BC8F091-28C0-42aa-AD10-AA78E612D6AA),
version(1.0),
helpstring("IControl Interface"),
pointer_default(unique)
]

interface IControl : IUnknown
{
cpp_quote("// Displays the control")
[id(2), helpstring("method ShowControl")]
HRESULT ShowControl( );
}

//{5E3CE754-FCC9-454e-B4BE-D1DD470BAF1E}
//{ 0x5e3ce754, 0xfcc9, 0x454e, { 0xb4, 0xbe, 0xd1, 0xdd, 0x47, 0xb, 0xaf, 0x1e } };
[
uuid(5E3CE754-FCC9-454e-B4BE-D1DD470BAF1E),
helpstring("Meter Class")
]
coclass Meter
{
[default] interface IControl;
};

Can anyone help me.

Thanks,
Bidesh
AnswerRe: How to include header file "Gdiplus.h" in IDL file Pin
User 21559719-Jul-07 20:44
User 21559719-Jul-07 20:44 
Questionwhich coclass in C# COM server is initialized? Pin
George_George17-Jul-07 21:26
George_George17-Jul-07 21:26 
Questionreturning array of BSTRs from the COM component Pin
Raj Prathap17-Jul-07 2:25
Raj Prathap17-Jul-07 2:25 
AnswerRe: returning array of BSTRs from the COM component Pin
Mike Dimmick17-Jul-07 2:52
Mike Dimmick17-Jul-07 2:52 
GeneralRe: returning array of BSTRs from the COM component Pin
Raj Prathap18-Jul-07 20:20
Raj Prathap18-Jul-07 20:20 
QuestionUnable to Start Exchange service Pin
Ashish Vasudev16-Jul-07 23:09
Ashish Vasudev16-Jul-07 23:09 
QuestionApartment (STA) mode before OLE calls Pin
MadmanWoo16-Jul-07 21:03
MadmanWoo16-Jul-07 21:03 
AnswerRe: Apartment (STA) mode before OLE calls Pin
User 21559716-Jul-07 22:58
User 21559716-Jul-07 22:58 
GeneralRe: Apartment (STA) mode before OLE calls Pin
MadmanWoo18-Jul-07 12:41
MadmanWoo18-Jul-07 12:41 
GeneralRe: Apartment (STA) mode before OLE calls Pin
User 21559719-Jul-07 19:44
User 21559719-Jul-07 19:44 
QuestionRegarding COM's Server type(DLL or EXE) Pin
Karismatic13-Jul-07 21:39
Karismatic13-Jul-07 21:39 
AnswerRe: Regarding COM's Server type(DLL or EXE) Pin
Mike Dimmick14-Jul-07 6:40
Mike Dimmick14-Jul-07 6:40 
QuestionI am getting 'ICaptureGraphBuilder2' : missing storage-class or type specifiers Pin
yaminisridaran12-Jul-07 19:43
yaminisridaran12-Jul-07 19:43 
QuestionHow to Generate OLE dispatch map functions Pin
KASR111-Jul-07 23:01
KASR111-Jul-07 23:01 
Questionsugest me the basic COM book with C#.Net Pin
help as an alias11-Jul-07 19:00
help as an alias11-Jul-07 19:00 
AnswerRe: sugest me the basic COM book with C#.Net Pin
User 21559711-Jul-07 23:04
User 21559711-Jul-07 23:04 
QuestionThis problem is COM related Pin
beloveyyj9-Jul-07 23:03
beloveyyj9-Jul-07 23:03 

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.