473,788 Members | 2,882 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to invoke function from its string representation

What are my options to invoke function (method) in this case:
myclass{

private DataSet _userData;

//Property in the class:
public DataSet UserData (string dsource){
get {return _userData;}
set {
_userData=??
}
}
}
Where dsource="MyAsse mbly.MyClass.Ge tUserData(uID)" and
MyAssembly.MyCl ass.GetUserData is static method of DataSet type.

Any references to good articles are greatly appreciated.
Thank you,
IK

Nov 16 '05 #1
2 1492
Take a look at Reflection. It allows to to invoke anything at runtime.

"IKdev" <IK***@discussi ons.microsoft.c om> wrote in message
news:9A******** *************** ***********@mic rosoft.com...
What are my options to invoke function (method) in this case:
myclass{

private DataSet _userData;

//Property in the class:
public DataSet UserData (string dsource){
get {return _userData;}
set {
_userData=??
}
}
}
Where dsource="MyAsse mbly.MyClass.Ge tUserData(uID)" and
MyAssembly.MyCl ass.GetUserData is static method of DataSet type.

Any references to good articles are greatly appreciated.
Thank you,
IK

Nov 16 '05 #2
Yes, I've thought about it, but I was trying to find simpler solution,
something similar to VB .NET eval() function.

Thank you,
IK
"Peter Rilling" wrote:
Take a look at Reflection. It allows to to invoke anything at runtime.

"IKdev" <IK***@discussi ons.microsoft.c om> wrote in message
news:9A******** *************** ***********@mic rosoft.com...
What are my options to invoke function (method) in this case:
myclass{

private DataSet _userData;

//Property in the class:
public DataSet UserData (string dsource){
get {return _userData;}
set {
_userData=??
}
}
}
Where dsource="MyAsse mbly.MyClass.Ge tUserData(uID)" and
MyAssembly.MyCl ass.GetUserData is static method of DataSet type.

Any references to good articles are greatly appreciated.
Thank you,
IK


Nov 16 '05 #3

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

Similar topics

3
2749
by: Eric Lilja | last post by:
Hi, I need a function that expects a const std::string& containing the visual representation of a number in binary format. It should then output this number in groups of four bits separated by a space. If the length of the string is not divisable by four (normally, it should receive 8-bit numbers (that is, strings of length 8), it should output the number as-is, no grouping). I came up with: void output_binary_string(ostream& os, const...
16
2507
by: Duncan Mole | last post by:
Hi, This is probably an easy one but it iy first bit of p/invoke. I am trying to use the following C struct in a call: typedef struct { BYTE SRB_Cmd; BYTE SRB_Status, BYTE SRB_HaId;
0
2961
by: Pawan Narula via DotNetMonster.com | last post by:
hi all, i'm using VB.NET and trying to code for contact management in a tree. all my contacts r saved in a text file and my C dll reads them one by one and sends to VB callback in a sync mode thread. so far so good. all contacts r added properly. now when another login adds me in his contact, i recv a subscription, so i popup a form and ask for accept/reject. this all happens in a separate thread. popup form gets opened and choice is...
9
1970
by: Terry Olsen | last post by:
I'm running an asynchronous Socket. In the ReceiveCallback method, I need to append what is received to a textbox on the main form. I have this code: Private Sub ToChatWindow(ByVal msg As String) txtChat.AppendText(msg) End Sub I've never used a delegate or invoke before and I'm rather confused on the topic. Hope someone can help.
1
4219
by: Steve | last post by:
I need to update my UI from a Process or worker thread. I did some readinf and basically ended up adapting an MS example to fot my needs. It all made sense until I tried it :) My process makes calls to a Singleton logger class which in turn makes calls to a delegate to add items to a listbox in my WinForm. Here is the code that I have in my Form class to log output <code> delegate void AddOutputItem(string msg);
16
2120
by: recover | last post by:
#include <string> #include <iostream> using namespace std; class TConst { private: string con; string uncon; public:
4
1749
by: default | last post by:
Hello All. I was looking around for a function like strtok() which would tokenize on the complete list of delimiters, rather than tokenize on *any* of the delimiters in the group. I ended up just rolling a function. Thought I would post it here for discussion. Thanks.
28
4336
by: Larax | last post by:
Best explanation of my question will be an example, look below at this simple function: function SetEventHandler(element) { // some operations on element element.onclick = function(event) {
18
2646
by: mdh | last post by:
May I ask the following. By K&R's own admission, the example used to describe function pointers is complex ( on P119). In addition, the use of casts has been stated by some on this group as being, again, a poor/bad example of it's use. For the moment, accepting these criticisms, I would still like to get some insight into why/how some things work as even poor code is enlightening, to me at least. The example uses K&R's version of...
0
9656
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9498
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9969
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8993
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7518
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6750
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5399
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4070
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2894
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.