Solved

VB.net "Object does not match target type"

Posted on 2006-07-02
3
750 Views
Last Modified: 2008-01-09
Hi,
 I'm trying to build a VB.net 2005 app....
 I'm using a third-party control in this app, which is completely written in C#.net and compiled in VS2005
 When i add a reference to the control and add some of these controls to the form, certain fields end up being non-editable and contain the words "Object does not match target type". I'm not able to use these properties.
 But when i create a C#.net windows app project and do the same, the control properties are editable and can be changed.
 Am i doing something wrong here? Please help.

Thanks in advance.
Sahil
0
Comment
Question by:sahil_ramani
3 Comments
 
LVL 8

Accepted Solution

by:
Shakti109 earned 250 total points
ID: 17032625

There are a couple of possibilities.... Both have to do with the coding of the component itself.
 
First, some of the properties have been cast using a "GetType" function, and when they are translated through to vb.net they are derived as something other than what is expected.

Or, they are using a callback/delegate relation to derive the properties of one ore more fields in the component and are doing something like a get eventinfo from an instance of an object instead of a get eventinfo from an instance of the TYPE of an object.

If you are using options explicit/strict on in your vb.net application, try turning them off in a new project, then adding the same components and seeing if you get the same effect.  I would'nt reccomend doing that as you are then left to write slow/bad/inefficient code without the compiler at least warning you, but it will give you a pseudo-validation that the third-party component is trying to make use of less than optimal methods and have something to send to them as a problem request/ec...

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I know it’s not a new topic to discuss and it has lots of online contents already available over the net. But Then I thought it would be useful to this site’s visitors and can have online repository on vim most commonly used commands. This post h…
Computer science students often experience many of the same frustrations when going through their engineering courses. This article presents seven tips I found useful when completing a bachelors and masters degree in computing which I believe may he…
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now