|
Judging from a previous question, I think he wants when any event happens. But I could be wrong, too. I guess we both need a little more clarification, huh? It definitely helps when we get a problem description that consists of more than "I need X" or "It doesn't work".
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles]
|
|
|
|
|
Yes, Mr. Stewart understood me in the right way. I do not need it for a custom application. If an event on the PocketPc arises, doesn't matter if a button is pressed, a program is started or something else, i should get be noticed so i can make a screen shot.
regards
pat
|
|
|
|
|
Anyone know about any .NET profilers (even in alpha or beta) that can profile .NET 2.0 apps?
Judah Himango
|
|
|
|
|
Hello,
I need to generate some reports in C#, l have a text book but it does not cover reports. I want to use crystal reports as that comes with .Net.
Does anyone have any example programs, or is there any good tutorials on the website.
Many thanks in advance,
Steve
|
|
|
|
|
This site - as well as many others - has a search. CodeProject's search bar is located right under the CodeProject logo toward the top of the page.
You could also use google[^] or another search engine of your choice.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles]
|
|
|
|
|
Hi everyone,
I'm not sure if the title of this thread is good. This is what I'm trying to achieve: I would like to call a static method of a class in a separate assembly based on a string parameter containing the name of the class and method.
I already figured out the basics, this is the code I'm using.
Type MyType=Type.GetType("TestPlugin.TestPluginClass,TestPlugin");
if(MyType!=null)
{
MethodInfo mi=MyType.GetMethod("PluginMethod");
if(mi!=null)
mi.Invoke(null, null);
}
The problem is that this only works when the calling assembly is compiled with reference to the target assembly (TestPlugin in this case). I guess that I'll have to load the target assembly somehow to make it work this way. How can this be achieved?
Thanks for any ideas!
Rado
Radoslav Bielik
http://www.neomyz.com/poll [^] - Get your own web poll
|
|
|
|
|
Try Assembly.Load( <your_assembly_name> )
|
|
|
|
|
Not necessary if the location of the requested assembly that contains the type can be resolved.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles]
|
|
|
|
|
what you really need to do is implement a plugin framework within your code, identify which plugins are available, and have those loaded and accessible from a plugin manager. This article will help you:
MSDN Plugin Framework Example[^]
This signature left intentionally blank
|
|
|
|
|
Thank you for the link to this great article, I think learned a lot from it!
Although I'll just use what Heath suggested below, because I don't really need a complete plugin framework this time, this article will surely come handy one day.
Thanks again,
Rado
Radoslav Bielik
http://www.neomyz.com/poll [^] - Get your own web poll
|
|
|
|
|
|
Brian Delahunty wrote:
Your talking about "Late Binding" there.
Lol no! Late binding is this:
private object foo = null;
public object Foo
{
get { if (foo == null) foo = new object(); return foo; }
}
top secret xacc-ide 0.0.1
|
|
|
|
|
No, that's not late-binding. Late binding has to do with how members are resolved and invoked. The actually implementation is uknown at compile time. Script wouldn't exist without late-binding, and it's an important part of COM. A good example in .NET of late-binding is:
public interface IFoo
{
void Test();
}
class Foo1 : IFoo
{
void Test() { Console.WriteLine("from Foo1"); }
}
class Foo2 : IFoo
{
void Test() { Console.WriteLine("from Foo2"); }
}
public class FooFactory
{
public static IFoo CreateFoo(string cls)
{
if (cls == "foo1") return new Foo1();
else if (cls == "foo2") return new Foo2();
else return null;
}
} Callers to FooFactory.CreateFoo get back an IFoo without knowing the implementing type. That's late-binding.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles]
|
|
|
|
|
Heath Stewart wrote:
That's late-binding.
Ok, you win! :p
What I was thinking is called late initialization.....
top secret xacc-ide 0.0.1
|
|
|
|
|
That is entirely possible and was what our flagship product used heavily when I worked for Proplanner before my new job.
The thing is, the request assembly has to be resolvable. Type.GetType will automatically load the assembly if it's not loaded already, but Fusion (the assembly binder) has to be able to find it.
I recommend you read How the Runtime Locates Assemblies[^], as well as Specifying an Assembly's Location[^] in the .NET Framework SDK.
For example, if you wanted to put your plugins in a directory under your app root called Plugins, then in your .config file (named yourapp.exe.config and in the same directory as yourapp.exe) set a probing path like so:
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<probing privatePath="plugins"/>
</assemblyBinding>
</runtime>
</configuration>
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles]
|
|
|
|
|
... of course another approach is documented in the link I already provided which places a plugin section in the application configuration. Then all that needs to be done is write a hook into the ConfigurationReader that will be called whenever the plugin section of the configuration reader is hit. The format for plugin identification is almost the same as defining a remoting object and we used it for initiating user-written plugins in my web editor our company is using.
This signature left intentionally blank
|
|
|
|
|
There are so many ways to write a plugin host it's not even funny. They're way - which is how I architected it at Proplanner - requires registration (in the .config file, the registry, etc.). The way I mentioned does not. It really just depends on requirements.
So, while I presented a couple different approaches and you presented (a link to) another approach, the fact of the matter is that plugin architectures are numerous.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles]
|
|
|
|
|
Thanks a lot Heath for your help and for the links! This is exactly what I needed this time.
Rado
Radoslav Bielik
http://www.neomyz.com/poll [^] - Get your own web poll
|
|
|
|
|
Hi. I need to map items from a DataSet to a SQL table.
The problem is that in the DataSet I can have the same item repeted, but in
the table, I have a field "quantity" to avoid that. So what I need is a
structure where I get each item and the number of repetitions.
In the DataSet, I have one table and I only need to use one column, and the
items are integers, so the idea is passing from:
100 102 100 103 to
100 (2) 102 (1) 103 (1) or something like that.
I don't know if I can get something with the DataSet Select method. I passed
the column to an ArrayList, but I don't know if that simplifyes something.
Can you help me?
Regards,
Diego F.
|
|
|
|
|
Why not do a SELECT with an ORDER BY? That puts the items in numerical order and then it is a matter of counting each one.
This signature left intentionally blank
|
|
|
|
|
Do you mean in the DataSet? Even if I get them ordered, I don't see how can I work with them. Can you please explain a bit more?
Regards,
Diego F.
|
|
|
|
|
The ADO.NET DataSet is a memory-resident representation of data that provides a consistent relational programming model regardless of the source of the data it contains. A DataSet represents a complete set of data including the tables that contain, order, and constrain the data, as well as the relationships between the tables. So if your first load of the dataset is all of the records ordered by the number.
Then you need to enumerate through the dataset counting the number of each type and that becomes another "table" which you add to the dataset which has the format number, count. Then you output the resulting union to the database.
This signature left intentionally blank
|
|
|
|
|
Hi all,
I would like my application to access the Visual Studio .Net Command Prompt so that i can run a command from my application.
I want my application to automatically register a dll by running the regasm command
>regasm Example.dll
What code would i use to do this ?
Thank you ...
|
|
|
|
|
Read on the System.Diagnostics.Process.Start(...) method.
|
|
|
|
|
System.Diagnostics.Process p = new System.Diagnostics.Process();
p.StartInfo.FileName = "regasm.exe"
p.StartInfo.Arguments = "example.dll"
p.Start();
Something like that should work, or come close.
Custom Software, Custom Solutions. Yye Software.
http://www.yyesoftware.com
|
|
|
|