Click here to Skip to main content
15,890,123 members
Home / Discussions / COM
   

COM

 
QuestionActiveX for MS Access Pin
Nitheesh George13-Nov-07 16:52
Nitheesh George13-Nov-07 16:52 
QuestionActiveX newbie Pin
earlp11-Nov-07 10:29
earlp11-Nov-07 10:29 
AnswerRe: ActiveX newbie Pin
Nathan Holt at EMOM16-Nov-07 7:27
Nathan Holt at EMOM16-Nov-07 7:27 
GeneralRe: ActiveX newbie Pin
earlp16-Nov-07 9:34
earlp16-Nov-07 9:34 
GeneralRe: ActiveX newbie Pin
Nathan Holt at EMOM19-Nov-07 9:37
Nathan Holt at EMOM19-Nov-07 9:37 
AnswerRe: ActiveX newbie Pin
charlieg28-Nov-07 10:10
charlieg28-Nov-07 10:10 
GeneralRe: ActiveX newbie Pin
earlp30-Nov-07 6:56
earlp30-Nov-07 6:56 
QuestionFire event from thread on ATL COM server (VC2003)... [modified] Pin
achainard7-Nov-07 23:40
achainard7-Nov-07 23:40 
Hi,

I'm writing a ATL COM Service (with the wizard on VC2003).

it look like that :

// IDeviceManager
[
object,
uuid("D9D097B1-FBE8-43D8-AEC6-6C740D01E911"),
dual,
helpstring("IDeviceManager Interface"),
pointer_default(unique)
]
__interface IDeviceManager : IDispatch
{
// Device manager.
[id(1), helpstring("method EnumDeviceDriver")] HRESULT EnumDeviceDriver([out,retval] LONG * pDeviceDriverCount);
....
}

// _IDeviceManagerEvents
[
dispinterface,
uuid("55370094-D0DE-438C-8D0A-E907A884F50B"),
helpstring("_IDeviceManagerEvents Interface")
]
__interface _IDeviceManagerEvents
{
[id(1), helpstring("method OnFireDeviceEvent")] HRESULT OnFireDeviceEvent ( [in] ULONG iDevice, [in] BSTR Param1, [in] BSTR Param2, [in] BSTR Param3, [in] BSTR Param4, [in] BSTR Param5, [in] BSTR Param6, [in] BSTR Param7, [in] BSTR Param8, [in] BSTR Param9 ) ;
};

// CDeviceManager
[
coclass,
threading("apartment"),
event_source("com"),
vi_progid("Manager.DeviceManager"),
progid("Manager.DeviceManager.1"),
version(1.0),
uuid("5CCB5A39-BF78-40A4-89E4-D0DBE82D8B7D"),
default(IDeviceManager),
helpstring("DeviceManager Class")
]
class ATL_NO_VTABLE CDeviceManager :
public IObjectWithSiteImpl<cdevicemanager>,
public IDeviceManager
{
public:
CDeviceManager ();

__event __interface _IDeviceManagerEvents;

DECLARE_PROTECT_FINAL_CONSTRUCT()

...
}

When i fire an event in EnumDeviceDriver it work.

The CDeviceManager container a thread that try to fire event but it failed with RPC_E_WRONG_THREAD(0x8001010EL).

I see a lot of article that say i need to modify advice and unadvice but with the Wizard i don't found how do it...

A link to expert exchange that explain a solution but not with the vc2003 wizard generated code: http://209.85.129.104/search?q=cache:HcncZHwaAUoJ:www.experts-exchange.com/Programming/Languages/CPP/Q_20528104.html+queryinterface+IDispatch+0x8001010E&hl=fr&ct=clnk&cd=1&gl=fr

If someone can explain me how do it with my code ?

Thanks




-- modified at 5:52 Thursday 8th November, 2007

...

AnswerRe: Fire event from thread on ATL COM server (VC2003)... Pin
Roger Stoltz8-Nov-07 2:51
Roger Stoltz8-Nov-07 2:51 
GeneralRe: Fire event from thread on ATL COM server (VC2003)... Pin
achainard8-Nov-07 4:40
achainard8-Nov-07 4:40 
GeneralRe: Fire event from thread on ATL COM server (VC2003)... Pin
Roger Stoltz8-Nov-07 5:13
Roger Stoltz8-Nov-07 5:13 
GeneralRe: Fire event from thread on ATL COM server (VC2003)... [modified] Pin
achainard8-Nov-07 6:49
achainard8-Nov-07 6:49 
Question.NET c# HowTo overload a COM class/interface ? Pin
FriendOfAsherah6-Nov-07 4:55
FriendOfAsherah6-Nov-07 4:55 
AnswerRe: .NET c# HowTo overload a COM class/interface ? Pin
Nathan Holt at EMOM9-Nov-07 5:44
Nathan Holt at EMOM9-Nov-07 5:44 
GeneralRe: .NET c# HowTo overload a COM class/interface ? Pin
FriendOfAsherah9-Nov-07 9:05
FriendOfAsherah9-Nov-07 9:05 
GeneralRe: .NET c# HowTo overload a COM class/interface ? Pin
Nathan Holt at EMOM9-Nov-07 11:27
Nathan Holt at EMOM9-Nov-07 11:27 
GeneralRe: .NET c# HowTo overload a COM class/interface ? Pin
FriendOfAsherah9-Nov-07 18:57
FriendOfAsherah9-Nov-07 18:57 
QuestionCOM event firing to multiple targets Pin
eero_p5-Nov-07 23:34
eero_p5-Nov-07 23:34 
AnswerRe: COM event firing to multiple targets Pin
Hubert Mayer9-Nov-07 3:00
Hubert Mayer9-Nov-07 3:00 
GeneralRe: COM event firing to multiple targets Pin
Rajasekharan Vengalil10-Nov-07 13:01
Rajasekharan Vengalil10-Nov-07 13:01 
GeneralRe: COM event firing to multiple targets Pin
eero_p12-Nov-07 20:59
eero_p12-Nov-07 20:59 
Questionwmi ---WBEM_E_INVALID_METHOD_PARAMETERS Pin
Hanks_Compal5-Nov-07 5:31
Hanks_Compal5-Nov-07 5:31 
QuestionREGTLB Pin
hiajay4-Nov-07 22:38
hiajay4-Nov-07 22:38 
AnswerRe: REGTLB Pin
User 2155975-Nov-07 0:18
User 2155975-Nov-07 0:18 
GeneralRe: REGTLB Pin
hiajay5-Nov-07 0:31
hiajay5-Nov-07 0:31 

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.