|
AFAIK, you should register you service as depending on the SQL Server service, so the OS can properly determine the startup sequence. Actually, you should register any of your service's dependencies. Probably, this information is needed for the right shutdown sequence too (my conclusion here). On .NET, you have the ServicesDependedOn property on the ServiceInstaller. Another remark: by default, if your shutdown process takes more than 20s, Windows will presume your service is hung up and probably will kill your process. There's a registry entry for configuring this time.
[edit]Debugging tip: Use Trace.Writeline or a interop call to OutputDebugString and use dbgview or dbmon to see it.[/edit]
I see dumb people
|
|
|
|
|
I am creating a simple tabbed text editor using the Magic .NET UI bits [http://www.dotnetmagic.com[^]]. My question is how do I programmaticly manipulate opjects that are on the tabs I create?
In a non-tabbed form I would use:
<br />
richTextBox1.Cut(); <br />
richTextBox1.Copy(); <br />
but I cannot figure out how I can get to the textbox inside a tabControl page. Im sure that this is probably simple, but I cant find it. Any help would be greatly appreciated.
I looked at the documentation here: http://www.dotnetmagic.com/articles.html[^]but I couldnt make any sense out of it.
You can find the test project I'm experimenting with here:
http://www.exceed-tech.com/misc/TabTest1.zip [^]
|
|
|
|
|
tabPage.Controls[0].Cut() , assuming your richTextBox1 is the first control on your tab. If you need to find a specific one, just enumerate through the controls in your TabPage.Controls collection and find the Control with the right name or type. This is behavior that all System.Windows.Forms.Control (and System.Web.UI.Control for that matter) exhibit.
"Well, I wouldn't say I've been missing it, Bob." - Peter Gibbons
|
|
|
|
|
Thanks Heath,
Is there an easy way to check for the active control index?
DB
|
|
|
|
|
Hi there, can somebody help me?
I want to filter a parent/child related dataset, based on the value in the child column, but showing the parent table.
Example, I've got the Customers and the Orders tables, and I want only show those Customers, who's Orders are paid. A customer of course may has more orders.
Those damned 'Child' expression only works in funtions.
I do not really want to surf through the whole database, and I dont want to make huge joined tables with a lot of redundant datas. Any idea?
|
|
|
|
|
It's easier (and faster) to do the work on the RDBMS than trying to filter a DataSet . Just use a query like this:
SELECT DISTINCT *
FROM Customers AS C
JOIN Orders AS O ON C.ID = O.CustomerID
WHERE O.Paid = 1
"Well, I wouldn't say I've been missing it, Bob." - Peter Gibbons
|
|
|
|
|
I've been coding in C# for a few months now and one thing that my books never mention is how I should organize my projects in Visual Studio. For instance, on my current project I made an Mp3 player that uses the Speech API to take commands. Should I make 3 seperate projects in VS, one for all the forms (windows app), one for the Speech Code (class library), and one for the mp3 code (class library)? Or should I have just made one project and put all the code in seperate files?
I'm sure there isnt one answer for this, and alot of it comes down to personal preference, but any tips would be much appreciated
|
|
|
|
|
Are there components in your MP3 app that you could use in other applications too?
If so, maybe start by pulling that code into a separate assembly.
Also if you are making enterprise server apps, it's probably a good idea to logically break up your solution into smaller components to facilitate a physically-tiered design.
Cheers,
Simon
"The day I swan around in expensive suits is the day I hope someone puts a bullet in my head.", Chris Carter.
my svg article
|
|
|
|
|
Am building a bootstrapper/app loader that is basicaly a stub that gets an
assembly from a URL, like http://remotehost/code/startup.dll.
I want to iterate thru all the dependancies behind startup.dll and pre-load em (reason is to use in the install to pre-load large assemblies, or to provide some nice dialog progress when loading)
The problem is that some dependencies are in the GAC and others are located
on the webserver. Using assembly.load finds all the GAC and application dir
assemblies, but not the assemblies on the webserver.
If I use Assembly.LoadFrom then dependencies that are in the GAC won't be found and the dependencies behind startup.dll loose thier versioning/strong names since we pass it a string of the assmebly name and not a AssemblyName token.
What I need is a smart Assembly.Load that can bind and probe locally and remote.
Any ideas for a solution?
-- Ingram
Assembly assem = Assembly.LoadFrom(@"http://remotehost/code/startup.dll");<br />
<br />
LoadAllReferences(assem, new ArrayList());
private static void LoadAllReferences(Assembly asm, ArrayList loaded)
{
Console.WriteLine("----------- "+asm);
foreach ( AssemblyName asr in asm.GetReferencedAssemblies() )
{
Console.WriteLine(asr.FullName);
}
Console.WriteLine("----------- **");
foreach ( AssemblyName asr in asm.GetReferencedAssemblies() )
{
if (loaded.Contains(asr.FullName))
{
Console.WriteLine("### already loaded "+asr.ToString());
}
else
{
Console.WriteLine("**** " + asr.ToString());
Assembly asmRef = Assembly.Load( asr );
loaded.Add(asr.FullName);
LoadAllReferences( asmRef, loaded );
}
}
}
This is a revisited question, see Google,
http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&safe=off&threadm=uteRFS89
BHA.1748%40tkmsftngp04&rnum=11&prev=/groups%3Fq%3Dloading%2Bassemblies%26sta
rt%3D10%26hl%3Den%26lr%3D%26ie%3DUTF-8%26safe%3Doff%26selm%3DuteRFS89BHA.174
8%2540tkmsftngp04%26rnum%3D11[^]
Ingram Leedy
You can't depend on your eyes when your imagination is out of focus.
--Mark Twain
|
|
|
|
|
Not the answer you are looking for, but the 1st thing you wanna do is check what is loaded already so those can be filtered out.
Also, a reference in one assembly mite not be applicable to your type and will still work AFAIK. Remember .NET only loads when the assembly is required at runtime.
ANyways hope you find your solution
Who is this miscrosoft, and what devilish plans have they for us?
|
|
|
|
|
Yo hey what's up?
I was skimmin over some of the asynchronous socket examples on MSDN and happened to notice all the call backs were static.
I am not to familar on how this IAsyncResult stuff works but from what I understand they work on another thread receiving data from a client as one example. If a server is receiving data from 2 clients and the everything is already hooked up aka meaning all the call backs.
client1.BeginReceive(state.buffer,0,StateObject.buffersize,0,new AsyncCallback(ReadCallback),state);
client2.BeginReceive(state.buffer,0,StateObject.buffersize,0,new AsyncCallback(ReadCallback),state);
and ReadCallback is static then the are sharing the same instance of it.
But if the instance is already doing work ie. receiving data from one client.
How can it recieve data from another client.
I guess what I am saying is how can 2 threads share one instance of a method.
Thanks for any help or insight on this...
scan
|
|
|
|
|
scan wrote:
I guess what I am saying is how can 2 threads share one instance of a method.
The "ReadCallBack" funtion seems to act as a recursive function (anyways from the examples I have seen) running till done, and normally recursive functions are static in nature (and good in design IMO).
Who is this miscrosoft, and what devilish plans have they for us?
|
|
|
|
|
HI,
Good Morning.
I would be very glad if any of you can help me out of this. I'm a beginner in C# and I've to do this for my project.
I have an MDI form which in turn consists of some SDI form. One of them is a Windows form developed in C#, which consists of some controls like Command Buttons. Another SDI form is a Flash file (.swf). Now I've to establish communication between these two. For example, if I clik on a command button, I've to animate the .swf file, which involves transfer of some data. This is the beginning of the process and still needs to be enhanced.
If any of you need any clarification on this, please mail me to vas@aim.co.kr.
Thanks and Regards.
Srinivas Kadiyala.
|
|
|
|
|
Srinivas Kadiyala wrote:
Now I've to establish communication between these two.
The only way to do that is via XML I would think. That and obviously using the Flash activeX control.
Who is this miscrosoft, and what devilish plans have they for us?
|
|
|
|
|
Hi,
Thanx a lot for the reply.
Now I would something like this :
Suppose I would press a command button in the form. Then it would change the value of a variable and put it in XML. Then I would retrieve the value from the XML and pass it on to the Flash ActiveX control and do some animation in the .swf file and vice versa.
Is it OK? Is this possible? Can you suggest some enhancements to this design? Please give your valueble feedback since I'm new to both .NET and Flash.
Sorry for the trouble.
Cheers...
|
|
|
|
|
Hello All,
I am getting frustrated now....
How do I store cursors and retrive them from a .NET assembly dll?
The resource file support does not seems to extend to cursors. I am
building components not an application and wish to add several cursors
to the component or resource only dll.
Any help?
Best regards,
Paul.
Jesus Christ is LOVE! Please tell somebody.
|
|
|
|
|
Could you help me how can I create listbox (and controls) without client edge / border / static edge ?
Wiizi
|
|
|
|
|
set the BorderStyle property to BorderStyle.None
1001111111011101111100111100101011110011110100101110010011010010 Sonork | 100.21142 | TheEclypse
|
|
|
|
|
How would you go about doing such a thing? any suggestions?
1001111111011101111100111100101011110011110100101110010011010010 Sonork | 100.21142 | TheEclypse
|
|
|
|
|
What are trying to do? You can serialize it...If its a struct, then you Marshal it and read the bytes...
Who is this miscrosoft, and what devilish plans have they for us?
|
|
|
|
|
well it could be a struct, it could be a class, or it could be a string. the infor has to be made into a byte[] so it can be sent off through a socket.
1001111111011101111100111100101011110011110100101110010011010010 Sonork | 100.21142 | TheEclypse
|
|
|
|
|
Then Serialize it thru the BinaryFormatter. Your class will need the Serializable attribute.
Who is this miscrosoft, and what devilish plans have they for us?
|
|
|
|
|
Hi All,
I'm having a problem with the width of the columns in a datagrid. How do I get the columns in a datagrid to "auto expand" to the width of the data in the columns? I've messed around with the PreferredColumnWidth property, but it doesn't give the right results.
Any Ideas?
|
|
|
|
|
Hi
How can i draw grayed image from ImageList ?
Dennny
|
|
|
|
|
use the System.Windows.Forms.ControlPaint.DrawImageDisabled method.
1001111111011101111100111100101011110011110100101110010011010010 Sonork | 100.21142 | TheEclypse
|
|
|
|