Solved

VB.net "Object does not match target type"

Posted on 2006-07-02
3
768 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
Make the most of your online learning experience.
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…
Introduction to Processes

617 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