Click here to Skip to main content
15,899,754 members
Home / Discussions / C#
   

C#

 
QuestionPlugin Interface Architecture and Invalid Cast Exceptions Pin
gerdhub4-Sep-07 10:03
gerdhub4-Sep-07 10:03 
AnswerRe: Plugin Interface Architecture and Invalid Cast Exceptions Pin
Judah Gabriel Himango4-Sep-07 11:25
sponsorJudah Gabriel Himango4-Sep-07 11:25 
QuestionRe: Plugin Interface Architecture and Invalid Cast Exceptions Pin
gerdhub4-Sep-07 12:30
gerdhub4-Sep-07 12:30 
AnswerRe: Plugin Interface Architecture and Invalid Cast Exceptions Pin
Judah Gabriel Himango4-Sep-07 13:13
sponsorJudah Gabriel Himango4-Sep-07 13:13 
GeneralRe: Plugin Interface Architecture and Invalid Cast Exceptions Pin
gerdhub4-Sep-07 13:24
gerdhub4-Sep-07 13:24 
AnswerRe: Plugin Interface Architecture and Invalid Cast Exceptions Pin
gerdhub4-Sep-07 22:36
gerdhub4-Sep-07 22:36 
AnswerRe: Plugin Interface Architecture and Invalid Cast Exceptions Pin
Skippums4-Sep-07 13:19
Skippums4-Sep-07 13:19 
AnswerRe: Plugin Interface Architecture and Invalid Cast Exceptions Pin
Skippums4-Sep-07 12:00
Skippums4-Sep-07 12:00 
It also looks like newPlugin is a singleton. Could it be that you are sending two types of plugins but then casting to a different type? For example, maybe you have the following...

interface A { }

struct B : A { }

struct C : A { }

newPlugin.Instance = new B();

newPlugin.Instance = new C();

C foo = (C)newPlugin.Instance; // Throws exception if you can only assign Instance property once

B foo = (B)newPlugin.Instance; // Throws exception if the second assignment overwrites the first

Also, it would be helpful to look at the output of ".GetType().FullName" from the immediate window while running, so you know what type you are dealing with.
GeneralRe: Plugin Interface Architecture and Invalid Cast Exceptions Pin
gerdhub4-Sep-07 12:32
gerdhub4-Sep-07 12:32 
QuestionLostfocus Pin
Assaf824-Sep-07 8:53
Assaf824-Sep-07 8:53 
AnswerRe: Lostfocus Pin
Christian Graus4-Sep-07 9:05
protectorChristian Graus4-Sep-07 9:05 
GeneralRe: Lostfocus Pin
Assaf824-Sep-07 9:16
Assaf824-Sep-07 9:16 
GeneralRe: Lostfocus Pin
Christian Graus4-Sep-07 9:23
protectorChristian Graus4-Sep-07 9:23 
GeneralRe: Lostfocus Pin
Assaf824-Sep-07 9:24
Assaf824-Sep-07 9:24 
GeneralRe: Lostfocus Pin
Urs Enzler4-Sep-07 21:31
Urs Enzler4-Sep-07 21:31 
Questionpassing a collection of objects Pin
jon-804-Sep-07 8:35
professionaljon-804-Sep-07 8:35 
AnswerRe: passing a collection of objects Pin
Christian Graus4-Sep-07 8:50
protectorChristian Graus4-Sep-07 8:50 
GeneralRe: passing a collection of objects Pin
jon-804-Sep-07 12:49
professionaljon-804-Sep-07 12:49 
Questiondraw on transparent form Pin
greekius4-Sep-07 8:06
greekius4-Sep-07 8:06 
AnswerRe: draw on transparent form Pin
Spacix One4-Sep-07 8:55
Spacix One4-Sep-07 8:55 
QuestionCapturing every minimize and restore Pin
Spacix One4-Sep-07 6:37
Spacix One4-Sep-07 6:37 
AnswerRe: Capturing every minimize and restore Pin
Giorgi Dalakishvili4-Sep-07 7:25
mentorGiorgi Dalakishvili4-Sep-07 7:25 
GeneralRe: Capturing every minimize and restore [modified] Pin
Spacix One4-Sep-07 7:48
Spacix One4-Sep-07 7:48 
GeneralRe: Capturing every minimize and restore Pin
Skippums4-Sep-07 12:05
Skippums4-Sep-07 12:05 
GeneralRe: Capturing every minimize and restore Pin
Spacix One4-Sep-07 14:19
Spacix One4-Sep-07 14:19 

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.