Click here to Skip to main content
15,893,486 members
Home / Discussions / C#
   

C#

 
GeneralResource Globalization Pin
codes/w15-Oct-04 19:07
codes/w15-Oct-04 19:07 
GeneralRe: Resource Globalization Pin
Alex Korchemniy16-Oct-04 10:00
Alex Korchemniy16-Oct-04 10:00 
QuestionHow to use the play list function of the Pin
skywen15-Oct-04 17:47
skywen15-Oct-04 17:47 
GeneralDatabase access error Pin
StephenMcAllister15-Oct-04 16:11
StephenMcAllister15-Oct-04 16:11 
GeneralRe: Database access error Pin
Carl Mercier15-Oct-04 17:14
Carl Mercier15-Oct-04 17:14 
GeneralRe: Database access error Pin
Alex Korchemniy16-Oct-04 10:13
Alex Korchemniy16-Oct-04 10:13 
QuestionC# interop with type System.__ComObject? Pin
vista2715-Oct-04 15:01
vista2715-Oct-04 15:01 
AnswerRe: C# interop with type System.__ComObject? Pin
Heath Stewart15-Oct-04 15:50
protectorHeath Stewart15-Oct-04 15:50 
It greatly depends on what you're doing. All types (doesn't matter which language, BTW) are IDispatch implementations unless you expose an interface differently using different enums for either the InterfaceTypeAttribute<?code> (for interfaces) or <code>ClassInterfaceAttribute (auto-generated class interface; never use auto-generated class interfaces, though).

When you cast an object to a COM-defined interface (attributed with ComImportAttribute) a QueryInterface is actually performed using the interface to which you're trying to cast. This means you have to have some idea of what you're trying to cast, otherwise you can either cast it as IDispatch (if it's a dispatch object) or - at the very least - IUnknown, which honestly gives you anything useful.

As I've told many people, understanding COM interop with .NET well requires that you understand COM well. I would recommend picking up a book on COM programming, as well as a book on COM interop if you need further explanation.

There's also several good articles here on this site that explain bits and pieces, but the bigger pictures requires a deeper understanding of just how COM works and how .NET interop works with (and for) COM.

This posting is provided "AS IS" with no warranties, and confers no rights.

Software Design Engineer
Developer Division Sustained Engineering
Microsoft

[My Articles] [My Blog]
GeneralPosting a File on a Form Pin
Member 138504915-Oct-04 11:27
Member 138504915-Oct-04 11:27 
GeneralRe: Posting a File on a Form Pin
Alvaro Mendez15-Oct-04 11:41
Alvaro Mendez15-Oct-04 11:41 
GeneralRe: Posting a File on a Form Pin
Member 138504915-Oct-04 15:33
Member 138504915-Oct-04 15:33 
GeneralRe: Posting a File on a Form Pin
Alvaro Mendez15-Oct-04 21:27
Alvaro Mendez15-Oct-04 21:27 
General.NET Remoting Reference Pin
Wender Oliveira15-Oct-04 9:45
Wender Oliveira15-Oct-04 9:45 
GeneralRe: .NET Remoting Reference Pin
Alex Korchemniy15-Oct-04 10:10
Alex Korchemniy15-Oct-04 10:10 
GeneralRe: .NET Remoting Reference Pin
Wender Oliveira15-Oct-04 10:15
Wender Oliveira15-Oct-04 10:15 
GeneralRe: .NET Remoting Reference Pin
Alex Korchemniy15-Oct-04 10:20
Alex Korchemniy15-Oct-04 10:20 
GeneralRe: .NET Remoting Reference Pin
Wender Oliveira15-Oct-04 10:24
Wender Oliveira15-Oct-04 10:24 
GeneralRe: .NET Remoting Reference Pin
Alex Korchemniy15-Oct-04 10:29
Alex Korchemniy15-Oct-04 10:29 
GeneralChange the caret color in a textbox Pin
ee9903515-Oct-04 7:30
ee9903515-Oct-04 7:30 
GeneralRe: Change the caret color in a textbox Pin
Alex Korchemniy15-Oct-04 9:47
Alex Korchemniy15-Oct-04 9:47 
GeneralRe: Change the caret color in a textbox Pin
Carl Mercier15-Oct-04 17:13
Carl Mercier15-Oct-04 17:13 
Generalslow listview refresh Pin
DF_Bandit15-Oct-04 6:49
DF_Bandit15-Oct-04 6:49 
GeneralRe: slow listview refresh Pin
Heath Stewart15-Oct-04 7:00
protectorHeath Stewart15-Oct-04 7:00 
GeneralRe: slow listview refresh Pin
DF_Bandit15-Oct-04 7:10
DF_Bandit15-Oct-04 7:10 
GeneralRe: slow listview refresh Pin
Heath Stewart15-Oct-04 8:44
protectorHeath Stewart15-Oct-04 8:44 

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.