|
After .NET 2.0 this tool is no longer supported.MSDN said that you could use it even with newer .NET versions.
Read this blog post how to get the tool.
Life is a stage and we are all actors!
|
|
|
|
|
Hi All,
I am creating a .NET layer "X" (a dll) to be used as an "api" to my other .NET applications that can be either a window or a console. This layer "X" uses an unmanage c++ code that sends windows-messages using ::SendMessage / ::PostMessage. So i thought I created a System.Window.window instance (and hide the window) in Layer X so that Layer X can receive and handle the window messages from the unmanage code.
The problem:
The receive message works, but now Layer X can not close itself. Even after the application that uses it terminates, somehow the process left hanging because Layer X is unable to clean itself up and have a hidden window hanging. I put "window.Close()" in Layer X's ~Destructor. But the ~Destructor itself is never invoked. I think it's a chicken and egg problem.
Comments and suggestion are highly appreciated.
-Chris
|
|
|
|
|
why not send a WM_CLOSE to the hidden window? you could do so in the FormClosing event of your WinApp's main form; or explicitly at the exit point of your ConsoleApp.
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read formatted code with indentation, so please use PRE tags for code snippets.
I'm not participating in frackin' Q&A, so if you want my opinion, ask away in a real forum (or on my profile page).
|
|
|
|
|
Hi Luc,
Thanks for replying. Yes I could do that, but I am trying to make this Layer X independent of the application that uses it. In other words, it will be nice for the applications that use it to not have to know that they need to call Close() on Layer X.
But maybe i can make Layer X to know the application window and set it as Layer X window's window owner. Maybe then the WM_CLOSE is done automatically.
|
|
|
|
|
yes, I expect turning the main form into the hidden window's owner would suffice.
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read formatted code with indentation, so please use PRE tags for code snippets.
I'm not participating in frackin' Q&A, so if you want my opinion, ask away in a real forum (or on my profile page).
|
|
|
|
|
Hi Experts,
i have created one custom validator SSNValidator
I am setting validation result Tag property = 101.
ValidationResult val = new ValidationResult("Invalid Area 101", currentTarget, "SSN Number", "101", null);
But at client side when i catch validationfault exception i am not able to get Tag=101 instead i am getting Tag=client
Please help me out
Thanks
modified on Tuesday, May 25, 2010 10:01 AM
|
|
|
|
|
i know that in .net it supports both instantiated and static methods to assign in the threadstart delegate, and also i have the knowledge about static and instantiated methods, let me explain the question:
class client
{
public static void thisStaticMethod(object obj)
{
}
public void thisInstantiatedMethod(object obj)
{
}
}
above are the two methods i have and what i want to know what happens when we call the static method in ThreadStart delegate and what happens when we call instantiated method in ThreadStart delegate.
for each thread does it creates a separate instance of the method regardless of whether it is static or instantiated. or what happens behind the screen.
|
|
|
|
|
code never gets instantiated; it exists once, on disk; gets loaded in memory; gets executed in a process, by one thread, or by multiple threads, it does not care. Your cookbook does not care how many cooks are reading it.
Data is different; at the class level, instance data resides in the object; and static data resides in the class (and exists once); all threads can access all such data (and that is exactly why we normally need thread synchronization, we don't want several cooks stirring the same pot of data).
Method local data (whether the method is static or not) resides on the stack of the executing thread (each thread has its own stack), so method local data is always separate.
Conclusion: passing a static or an instance method to a secondary thread, is of the same significance as executing a static or an instance method on the main thread. Most of the time, instance methods (and instance data) is preferred over static ones (static gets often abused); when using multiple threads, this is still true, if not even more so.
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read formatted code with indentation, so please use PRE tags for code snippets.
I'm not participating in frackin' Q&A, so if you want my opinion, ask away in a real forum (or on my profile page).
|
|
|
|
|
|
i have the idea about inheritance, but the problem is about the performance when a child class is assigned to a parent class.
please let me explain.
class A is the parent of class B ,an d is the parent of C like wise
A->B->C->D->E->F->G
then i know that when i create an object from class G all the constructors from A to G is called.
Now when i'm assigning an object of G to object of A
A aa = new A();
G gg = new G();
aa = gg;
object "gg" is casted to A type , then is this happens like it happened in creating "gg" all through the hierarchy, or is it just one step from G to A... or is something else happens.. and what about the performance?
|
|
|
|
|
prasadbuddhika wrote: it happened in creating "gg" all through the hierarchy,
No. AFAIK, it is just one step.
Type casting performance - you might want to take a look here.
My signature "sucks" today
modified on Monday, May 24, 2010 11:18 AM
|
|
|
|
|
prasadbuddhika wrote: A->B->C->D->E->F->G
A aa = new A();
G gg = new G();
aa = gg;
nothing gets cast. All the last statement does is forget the existing instance of class G is a highly specialized instance of class A.
If class G represents gray cats, and A represents animals, gg may be the little gray kitten you found yesterday on your doorstep and decided to call Fluffy; still your last statement just says: I'll forget it is gray, I'll forget it is a cat, I just remember it is an animal. But then, it won't meow anymore, as the Meow() method is not in class A, it only exists in F and G.
There is no activity involved.
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read formatted code with indentation, so please use PRE tags for code snippets.
I'm not participating in frackin' Q&A, so if you want my opinion, ask away in a real forum (or on my profile page).
|
|
|
|
|
thanx for tour explanation
|
|
|
|
|
this is called upcasting.
Reference is to 'A', but type still remains 'G'.
This type of upcast later is very useful in dynamic method dispatch.
|
|
|
|
|
thanx new word for me upcasting
|
|
|
|
|
Hello all!
I'm new to asp.net and i'm trying to bind some XML data to a gridview.
abviously I'm not understanding how to do it properly because that my code doesn't seem to
work...Can anyone could help me please?
this is my xml:
#########################################
<?xml version "1.0" encoding "utf-8"?>
<dictionary>
<item>
<key>
<string> hello world </string>
</key>
<value> <anytype xmlns:q1="http://www.w3.org/2001/XMLSchame" d4p1:type="q1:int"
xmlns:d4p1="http-instance">45</anytype>
</value>
</item>
</dictionary>
and this is my code:
########################################
string path = "D:\\myXmlFile.xml";
DataSet oDs = new DataSet();
oDs.ReadXml(path);
GridView1.DataSource = oDs;
GridView1.DataBind();
thanks
Tom
modified on Saturday, May 22, 2010 8:57 AM
|
|
|
|
|
You would actually find more people answering this question if you would post it in the ASP.Net forum.
My signature "sucks" today
|
|
|
|
|
|
Don't cross post. You have started here and answers have been given here, remove the one you have just posted in the ASP.NET forum before anyone answers there as well.
Read the forum guidelines.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Hello, I have an Image I recieve from a stream and I need to save it in the File Format .PBM (Portable Bitmap) because the library I am trying to use only accepts .PBM format. Any ideas How i would do this?
|
|
|
|
|
Spilled wrote: Any ideas How i would do this?
No, however I would start here[^].
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read formatted code with indentation, so please use PRE tags for code snippets.
I'm not participating in frackin' Q&A, so if you want my opinion, ask away in a real forum (or on my profile page).
|
|
|
|
|
Hi Experts,
What i am trying to achieve here is a bit tricky. Let me brief on a little background first before going ahead.
I am aware that we can use a enum as a type to a parameter of a method. For example I can do something like this (a very basic example)
namespace Test
{
class DefineEnums
{
public enum MyEnum
{
value1 = 0,
value2 = 1
}
}
class UseEnums
{
public void UseDefinedEnums(DefineEnums.MyEnum _enum)
{
}
public void Test()
{
UseDefinedEnums(DefineEnums.MyEnum.value1);
}
}
}
What i need to do is create a dynamic Enum and use that as type in place of DefineEnums.MyEnum mentioned above.
I tried the following.
1. Used a method which i got from the net to create a dynamic enum from a list of strings. And created a static class which i can use.
using System;
using System.Collections.Generic;
using System.Reflection;
using System.Reflection.Emit;
namespace Test
{
public static class DynamicEnum
{
public static Enum finished;
static List<string> _lst = new List<string>();
static DynamicEnum()
{
_lst.Add("value1");
_lst.Add("value2");
finished = CreateDynamicEnum(_lst);
}
public static Enum CreateDynamicEnum(List<string> _list)
{
AppDomain currentDomain = AppDomain.CurrentDomain;
AssemblyName aName = new AssemblyName("TempAssembly");
AssemblyBuilder ab = currentDomain.DefineDynamicAssembly(
aName, AssemblyBuilderAccess.RunAndSave);
ModuleBuilder mb = ab.DefineDynamicModule(aName.Name, aName.Name + ".dll");
EnumBuilder eb = mb.DefineEnum("Elevation", TypeAttributes.Public, typeof(int));
int i = 0;
foreach (string item in _list)
{
eb.DefineLiteral(item, i);
i++;
}
return (Enum)Activator.CreateInstance(eb.CreateType());
}
}
}
2. Tried using the class but i am unable to find the "finished" enum defined above. i.e. I am not able to do the following
public static void TestDynEnum(Test.DynamicEnum.finished _finished)
{
}
I guess the post has become too long but i hope i have made it quite clear.
Please help!
Thanks in advance!
Regards,
Samar
modified on Friday, May 21, 2010 4:43 AM
|
|
|
|
|
Hi Experts,
Any suggestions on this?
Regards,
Samar
|
|
|
|
|
Don't be so damn impatient. We are here voluntarily, this is not a paid support forum.
You can't access the finished enum because it doesn't exit. You cut & pasted the MSDN example which names the enum Elevation.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Hi Mark,
I am not impatient. I just wanted everyone to know that this thread is active and not dead. Will take care the next time.
I know the enum "finished" does not exists. That is why i tried and separated the declaration and the caller in separate assemblies and gave reference of the declaration assembly in the caller project. This did not work either.
Also I have clearly mentioned in the post that the method is not built by me and that i have "Used a method which i got from the net".
Last words, it would be appreciated if you use a better language than using words like "damn". This is a forum and not your home.
Regards,
Samar
|
|
|
|