Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

VB.net "Object does not match target type"

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

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

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

If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
Starting up a Project

885 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