Solved

VB.net "Object does not match target type"

Posted on 2006-07-02
3
746 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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
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…

707 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

20 Experts available now in Live!

Get 1:1 Help Now