Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

VB.net "Object does not match target type"

Posted on 2006-07-02
3
Medium Priority
?
774 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 1000 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

Build and deliver software with DevOps

A digital transformation requires faster time to market, shorter software development lifecycles, and the ability to adapt rapidly to changing customer demands. DevOps provides the solution.

Question has a verified solution.

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

Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
A short article about problems I had with the new location API and permissions in Marshmallow
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
Introduction to Processes

721 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