Click here to Skip to main content
15,884,986 members
Home / Discussions / C#
   

C#

 
AnswerRe: Detecting low memory Pin
Luc Pattyn27-Aug-10 4:08
sitebuilderLuc Pattyn27-Aug-10 4:08 
GeneralRe: Detecting low memory Pin
Madmaximus27-Aug-10 4:25
Madmaximus27-Aug-10 4:25 
GeneralRe: Detecting low memory Pin
The Man from U.N.C.L.E.27-Aug-10 6:10
The Man from U.N.C.L.E.27-Aug-10 6:10 
AnswerRe: Detecting low memory Pin
#realJSOP27-Aug-10 4:14
mve#realJSOP27-Aug-10 4:14 
AnswerRe: Detecting low memory Pin
T M Gray27-Aug-10 4:23
T M Gray27-Aug-10 4:23 
AnswerRe: Detecting low memory [modified] Pin
Paul Michalik29-Aug-10 0:38
Paul Michalik29-Aug-10 0:38 
AnswerRe: Detecting low memory Pin
PIEBALDconsult29-Aug-10 4:12
mvePIEBALDconsult29-Aug-10 4:12 
QuestionReflection with Dynamic Objects (System.__ComObject) Pin
Tony Richards27-Aug-10 0:38
Tony Richards27-Aug-10 0:38 
I am trying to access a property on a System.__ComObject by name. I can do this for normal objects:

C#
var mapping = m.GoogleMapping as SimpleGoogleMapping;
var propInfo = googleContact.GetType().GetProperty(mapping.PropertyName);
googleValue = propInfo.GetValue(googleContact, null);


googleContact is a normal class so this doesn't cause a problem.

I tried this (outlookContact is a ContactItem retreived using Outlook Interop, but during debugging, shows as a System.__ComObject):

C#
var mapping = m.OutlookMapping as SimpleOutlookMapping;
var propInfo = outlookContact.GetType().GetProperty(mapping.PropertyName);
propInfo.SetValue(outlookContact, googleValue, null);


But propInfo ends up being null, even though the property name is correct. I've also tried:

C#
var propInfo = typeof(ContactItem).GetProperty(mapping.PropertyName);


without success.

Edit: Using outlookContact.GetType().GetProperties() or typeof(ContactItem).GetProperties() returns an empty list, as does GetMembers().

Does anyone know how to achieve this with a dynamic object?

I am using .Net 4
AnswerRe: Reflection with Dynamic Objects (System.__ComObject) [modified] Pin
Paul Michalik27-Aug-10 3:54
Paul Michalik27-Aug-10 3:54 
QuestionC# Squrid My Program Up Pin
C.CoderCreator26-Aug-10 22:43
C.CoderCreator26-Aug-10 22:43 
AnswerRe: C# Squrid My Program Up PinPopular
Pete O'Hanlon26-Aug-10 23:17
mvePete O'Hanlon26-Aug-10 23:17 
AnswerRe: C# Squrid My Program Up Pin
OriginalGriff26-Aug-10 23:54
mveOriginalGriff26-Aug-10 23:54 
AnswerRe: C# Squrid My Program Up Pin
J a a n s27-Aug-10 0:20
professionalJ a a n s27-Aug-10 0:20 
AnswerRe: C# Squrid My Program Up Pin
Luc Pattyn27-Aug-10 2:06
sitebuilderLuc Pattyn27-Aug-10 2:06 
AnswerRe: C# Squrid My Program Up Pin
T M Gray27-Aug-10 4:32
T M Gray27-Aug-10 4:32 
GeneralRe: C# Squrid My Program Up Pin
Chris Trelawny-Ross27-Aug-10 5:53
Chris Trelawny-Ross27-Aug-10 5:53 
AnswerRe: C# Squrid My Program Up Pin
The Man from U.N.C.L.E.27-Aug-10 6:17
The Man from U.N.C.L.E.27-Aug-10 6:17 
AnswerRe: C# Squrid My Program Up Pin
Paul Michalik27-Aug-10 23:01
Paul Michalik27-Aug-10 23:01 
QuestionHow to create Microsoft Excel 2007 add-in in C#2010 Pin
soe htet26-Aug-10 22:32
soe htet26-Aug-10 22:32 
AnswerRe: How to create Microsoft Excel 2007 add-in in C#2010 Pin
Łukasz Nowakowski27-Aug-10 0:32
Łukasz Nowakowski27-Aug-10 0:32 
Questionvideo chat Pin
sardar.nale26-Aug-10 22:09
sardar.nale26-Aug-10 22:09 
AnswerRe: video chat Pin
Pete O'Hanlon26-Aug-10 22:22
mvePete O'Hanlon26-Aug-10 22:22 
AnswerRe: video chat Pin
J4amieC26-Aug-10 22:27
J4amieC26-Aug-10 22:27 
AnswerRe: video chat Pin
Pete O'Hanlon26-Aug-10 22:31
mvePete O'Hanlon26-Aug-10 22:31 
AnswerRe: video chat Pin
OriginalGriff26-Aug-10 22:32
mveOriginalGriff26-Aug-10 22:32 

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.