473,378 Members | 1,454 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Exception has been thrown by the target of an invocation

Hi,

I get the error, "Exception has been thrown by the target of an
invocation", at the last line of code.

Any idea why this happens and how to get it fixed?

Type mySFunction = Type.GetTypeFromProgID("S-
PLUS.rsi.em");

object splusObject =
Activator.CreateInstance(mySFunction);

object[] oArgs = new object[] { 33, 11, 56, 80 };

// Get error, "Exception has been thrown by the target
of an invocation"
splusObject.GetType().InvokeMember("x",
System.Reflection.BindingFlags.SetProperty, null, splusObject, oArgs);
Oct 29 '08 #1
1 6905
There is no way for us to know what is wrong if we do not know what the
called function does. Can you link us to the API or control that you are
using, or at least describe the expected behavior?

In an essence, the error message means that the method you called raised an
exception. If in managed code, it could mean that the exception occurred in
the class contructor.

Hope this helps,
--
Stanimir Stoyanov
http://stoyanoff.info

"Curious" <fi********@yahoo.comwrote in message
news:93**********************************@m74g2000 hsh.googlegroups.com...
Hi,

I get the error, "Exception has been thrown by the target of an
invocation", at the last line of code.

Any idea why this happens and how to get it fixed?

Type mySFunction = Type.GetTypeFromProgID("S-
PLUS.rsi.em");

object splusObject =
Activator.CreateInstance(mySFunction);

object[] oArgs = new object[] { 33, 11, 56, 80 };

// Get error, "Exception has been thrown by the target
of an invocation"
splusObject.GetType().InvokeMember("x",
System.Reflection.BindingFlags.SetProperty, null, splusObject, oArgs);
Oct 30 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Lekyan | last post by:
I have problem setting the password for an ADAM user using C#. I used the SetPassword code given in the Microsoft page, changed several parameters, but ran into an exception. I wonder if other...
1
by: raj via DotNetMonster.com | last post by:
I am getting the exception when i invoke the Password, Exception is "Exception has been thrown by the target of an invocation." DirectoryEntry ent = new DirectoryEntry...
3
by: Minh | last post by:
I create a C# Project using Windows Application template, I add an imagelist to Form, and add icon to imagelist1. After that, I run Project, but an Exception has occured. I can fix it even...
4
by: Aren Cambre | last post by:
Why does SmtpMail.Send throw an exception if the MailMessage's BodyFormat = MailFormat.Html? I've searched all over the place and cannot find a solution anywhere. I am running this on Windows XP...
0
by: Val | last post by:
From: "Val Mazur" <group51a@hotmail.com> Subject: Exception has been thrown by the target of an invocation Date: Monday, June 06, 2005 2:01 PM Hi guys, For some reason when application tries...
2
by: darrel | last post by:
I've written a function that will upload a file. This sort of works. It works sometimes, and then other times...namely when it tries to write to an existing directory (but not always), I get this...
0
by: Kivak Wolf | last post by:
Yet another problem, I'm finding a few problems... This is yet another one. All i am trying to do is create 2 sql data source objects and connect them to the same data table with the same...
2
by: Eugene | last post by:
Hi, I have a problem when loading one of my dll. I have a main class that would load a winform in another dll using reflection. When I load it using Assembly.CreateInstance(DLLName.DLLFormName), an...
2
by: Monty | last post by:
I have a GridView in an update panel, and the GridView has an ObjectDataSource. Under certain conditions the Object that is the ObjectDataSource will throw an exception with a specific error...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.