|
Mridang Agarwal wrote: This seemed to work for most of my progams. It retuned the main window handle but when i tried to close a particular program (which happens to be Trillian Instant Messenger), I couldnt get the MainWindowHandle.
It is likely to happen with hidden 'trayed' applications. To be honest, I dont know how you would go about finding its handle An article would be nice if you succeed
xacc.ide-0.1.2.6 Now with even better keyboard customization - Emacs style
|
|
|
|
|
I have written a program that access an sql server 2000 database installed on a windows 2003 server machine. Sql server is setup with integrated security and i don't want to change this. if i install my app in a computer that is a member of the domain and logins windows with the credentials of a windows server user account works good. Is there anyway from a computer that is on the same network that logins using a local windows account and does not have access to network resources access sql server? the result i want to have is :asking username and password for a windows 2003 server user account within my app and authenticate the user against windows server when the user wants to access the db.
Thanks in advance
From Greece:
Dimitris Iliopoulos
dimilio@yahoo.com
|
|
|
|
|
Hi all,
I little bit confused about on what technique has to be used for event logging. My requirement is, there will be windows application which will invoke the dlls functions. each dlls should log there event/error information into a file(including the windows app). If the file execeeds certain amount/certain period i should automatically(programmatically) archieve file and put the file in some backup directory.
For that i have multiple options in c#
1. Logging data into System's Application Log
2. Using Trace Listners
3. Every dlls has to open the log file and write the entry and has to close the file.
Normally what the techinque the people will use for this requirement
(important there is a possiblity one or more dll can write an entry to a file)
Please help
Thanks and Regards
Srini
|
|
|
|
|
Create a logger files wich has an event called LogEvent, and it listens to it.
And your dlls should raise this event everytiem they have to log something.
Q:What does the derived class in C# tell to it's parent?
A:All your base are belong to us!
|
|
|
|
|
Thanks for ur reply,
What is mean by logger files. how to create it and link with .net.
Could you please give more input on that.
Thanks and Regards,
Srini
|
|
|
|
|
Well that is really up to you.
You can use simple txt files, or XML or even database.
And there is a loat of information about these topics on this site and the internet, so searh a little.
And I think there are even tutorials about logging on this site...
Q:What does the derived class in C# tell to it's parent?
A:All your base are belong to us!
|
|
|
|
|
i passed the value get from below:
-------------
///////////////////////////
C#:
[System.Security.Permissions.PermissionSet
(System.Security.Permissions.SecurityAction.Demand, Name = "FullTrust")]
protected override void WndProc(ref Message m)
{
if (m.Msg == 55 && Drvloaded)
{
long test = dp.OnReply(Convert.ToUInt32(m.WParam.ToString()),
m.LParam.ToInt32());
}
base.WndProc(ref m);
}
/////////////////////////////
vc.net
long OnReply(UInt32 wParam,long lParam);
-------------
then after the process by vc.net,i want to pass back some vale(type about
"char/long/WORD..etc) to c#
how i can work this out on "vc.net",thanks
ps:
vc.net,CLR Project
|
|
|
|
|
Hi,
Have anyone tried to apply a custom debugvisualizer by decorating your target calss with the DebugVisualizer attribute?
I cannot use the global assembly:debugvisualizer way as all samples use because my types are runtime emitted.
so i figured that i could decorate my classes with the attribute instead and then reffer to the visualizer type as a fully qualified type name (which should should be possible according to the docs, i should just use the string based ctor)
however i get file not found when i do so , ive picked the fully qualified name from the type and also installed my visualizer in the "C:\Program\Microsoft Visual Studio 8\Common7\Packages\Debugger\Visualizers" folder as im supposed to.
but still no luck..
is there anything special I need to do in order to reffer to the visualizer type as a string?
http://www.puzzleframework.com
|
|
|
|
|
I have studied reflection in .Net. Through reflection we can get the entire information of assembly and also able to generate the dynamic assemblies.
But what is the practical use of Reflection.
Where we need to generate dynamic assemblies?
Ashwani
|
|
|
|
|
Hi,
May be there could be some good use of this feature but to me, it is tooooooooo much disappointing feature of .NET , Now, Whatever program we are making, other people can see the source code of our program through this feature, what could be worse feeling than this for a programmer.
emran
|
|
|
|
|
Reflection doesn't allow you to look at the source code, it only allows you access to information about types in an assembly and provides an API to do things with them.
Disassemblers work by looking for the metadata information in the executable and reverse engineering IL back to the source language. This is possible because .NET is a managed environment and binaries must contain metadata and high level code to be able to be executed.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
The most practical use of reflection I've found is for supporting plugin architectures. You can load any arbitrary assembly and iterate through the types, insantiate them and do all sorts of operations you want on them.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
Ashwani_kumar wrote: But what is the practical use of Reflection.
The use of reflection in base classes to find out whats happening in the inherit class is very practical, eg:
class Menu : Attribute {}
abstract class A
{
}
class B
{
[Menu]
void Foo(){}
}
xacc.ide-0.1.2.3 Now with full keyboard customization
|
|
|
|
|
Ashwani_kumar wrote: But what is the practical use of Reflection.
There are many uses of reflection.
NUnit uses reflection to work out what unit tests to run, and also how to interpret some of the results (for example, you can attribute a test with [ExpectesException()] which is also finds through reflection)
Serializing and Deserializing classes uses reflection to build or extract information from the XML file.
DotNetNuke uses reflection to take information from the database and populate the business objects. A more powerful example of the same idea is NHibernate.
Reflection is useful in factory patterns in order to instantiate the correct class.
The list goes on and on and on.
ColinMackay.net
"Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucius
"If a man empties his purse into his head, no man can take it away from him, for an investment in knowledge pays the best interest." -- Joseph E. O'Donnell
|
|
|
|
|
Hi all,
I was wondering if its possible to share the same code over multiple sub domains?
Basically what I want to do is to offer rebranded subdomains with a seperate css and home page, but running off the same code base and DB. So each subdomain would have its own default.aspx & css files, but everything else would be running off common code. Would this be possible?
Thanks in advance for any tips!
Dave
|
|
|
|
|
Perhaps if you set up an application with subfolders containing the pages for the subdomains, and for each subdomain set up a web without an application. I haven't tried this, so I don't know if it would work at all.
---
b { font-weight: normal; }
|
|
|
|
|
Hi, I have started using Background Worker Component of C# 2005 Express and I am enjoying it. I thought I dont need to learn MultiThreding Theorys as I am comfortable to use it. But I was wondering, If I command to background worker, they cant do their task at the same time. The first one finishes its task and then 2nd one starts. So, I am thinking, was it supposed to be like that or I am missing something in my code.
Cant I do 2 simultaneous work at the same time with background worker ?
Thanks
Emran
-- modified at 23:24 Saturday 4th February, 2006
|
|
|
|
|
Each BackgroundWorker component executes an operation on a separate thread, so AFAIK calling the components' RunWorkerAsync() methods should create 2 parallel threads.
/ravi
My new year's resolution: 2048 x 1536
Home | Music | Articles | Freeware | Trips
ravib(at)ravib(dot)com
|
|
|
|
|
Hi,
thanks for reply.
Ok, then What is the difference between regular multithreaded programming and using Background worker ! Is the background worker is direct replacement of using thread coding !!
|
|
|
|
|
Yeah, it's a more convenient way to do things asynchronously.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
emran834 wrote: Is the background worker is direct replacement of using thread coding
Yes. As S. Senthil Kumar said, it's a more convenient way of writing code to perform a task in a separate thread. Among other things, BackgroundWorker provides a convenient interface for receiving progress notifications and cancelling the task.
/ravi
My new year's resolution: 2048 x 1536
Home | Music | Articles | Freeware | Trips
ravib(at)ravib(dot)com
|
|
|
|
|
I am writing a program that backups files/directories to a specified destination directory. To make the program a little more useful I would like to have it backup the files automatically at a certain time during the day. The only way of doing this that I can think of is using a timer that runs in the background, but I am assuming there is a more efficient approach
Any help is appreciated.
|
|
|
|
|
Sean, your approach of using a timer seems like a sound one. However, be aware that there are three types of timers in the FCL. See this[^] MSDN article for a nice explanation.
/ravi
My new year's resolution: 2048 x 1536
Home | Music | Articles | Freeware | Trips
ravib(at)ravib(dot)com
|
|
|
|
|
OK i'll check it out thanks.
|
|
|
|
|
You may also consider supporting command line arguments in your backup program.
This way different backups could be launched via batch file or by using Windows Scheduler.
Just remember that when using the scheduler under WinXP, you specify the User whos credentials are used to run the task and that account MUST have a password set.
Hope this helps.
Regards
Wayne Phipps
____________
Time is the greatest teacher... unfortunately, it kills all of its students
View my Blog
|
|
|
|