|
Hi All,
I am using Visual Studio 2005, .Net 2.0. In my application, i am using more number of Designer Host instances, So when i am using more than 36 instances of Designer Host, i cant able to resize the controls. If the number of instances of Designer Host is less than equal to 36 , then it is working fine.
Below is the link of an example given by the microsoft. It is also giving the same problem when adding more than 36 forms(i.e. Designer Host Form).
http://msdn.microsoft.com/en-us/magazine/cc163634.aspx
Can anyone please give me a solution.
Thanks & Regards,
Vaira Muthu.
|
|
|
|
|
We are working on a .net application that would require to update the inventory tables of Peoplesoft database. What is the best way to do this, i.e, to update the inventory tables of Peoplesoft by an external application?
|
|
|
|
|
You asked it twice yesterday and you've started asking it again today. The question is, what does it have to do with C#?! Even though your application is on .NET, your query has something to do with some third party stuff.
You will need to read the Peoplesoft API manual and/or go and ask it in one of their forums. There is no point in reposting this stuff every day here.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
Dear Friends,
I need a Regular Expression for validate a text box which allows 0 to 1000 in C# Windows applications...
|
|
|
|
|
Sounds trivial to me. What have you done so far ?
Christian Graus
Driven to the arms of OSX by Vista.
"I am new to programming world. I have been learning c# for about past four weeks. I am quite acquainted with the fundamentals of c#. Now I have to work on a project which converts given flat files to XML using the XML serialization method" - SK64 ( but the forums have stuff like this posted every day )
|
|
|
|
|
Lol you made me smile this morning!
|
|
|
|
|
Err, [s]he's posted a message on thisd forum and you've replied. Now it's #your# problem.
Panic, Chaos, Destruction.
My work here is done.
|
|
|
|
|
|
is a numericUpDown control not an option?
|
|
|
|
|
0|[1-9]\d{0,2}|1000
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Hi,
I am working as an asp.net developer.My TL asked me to study Search Engine Optimization(SEO) techniques.From where can I study SEO,or any one knows any books or sites please inform
Thanks
Denny
|
|
|
|
|
|
Some tips from Google[^] herself. Don't forget to download the PDF[^].
I are troll
|
|
|
|
|
Hi,
Using a thread and a while(true) is the best way? or is there any method that isn't consuming cpu on the background every iteration?
DateTime nextCheck = DateTime.Now.AddSeconds( t );
while (true)
{
if (DateTime.Now > nextCheck)
{
nextCheck.AddSeconds( t );
do the thing...
}
}
|
|
|
|
|
Hi,
this is a very bad idea.
Assume nextCheck has not been reached yet, then the while(true) loop is basically empty, and spinning all the time, keeping an entire core occupied. Watch the Task Manager"performance" pane: it will show 100% CPU if your system is single-core, 50% when dual-core, etc. So that is a big waste.
There is an easy fix: make sure some time elapses for free, no matter what path is taken inside the loop; i.e. when the test fails do a Thread.Sleep(x); where larger x values are less expensive, however they may decrease the accuracy of the kick-in moment. So probably 333*t is a good value, it makes you loop three times with typically two fails and one hit.
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
mhmm Didnt get the 333*t part,
Is this okey?
DateTime nextCheck = DateTime.Now.AddSeconds( t );
while (true)
{
if (DateTime.Now > nextCheck)
{
nextCheck.AddSeconds( t );
do the thing...
}
else { Thread.Sleep( nextCheck - DateTime.Now ); }
}
Another question,
If it gets to the part of "Thread.Sleep", I'm 100% sure the current thread is itself ? I guess so because if its reading that line... right?
|
|
|
|
|
Hi,
1.
your snippet is acceptable under most circumstances. The one problem with it is this: let us assume we are in the else part, just finished the subtraction, and are going to launch the sleep; suddenly the system decides to switch threads because something higher-priority kicked in; after three seconds, the higher-priority thing is back, and your thread now goes to sleep voluntarily, for a timespan that is of by three seconds. Bad luck.
When you have a fixed sleep as in <thread.sleep(333*t)< code=""> your thread will try and loop once every 333 msec (assuming t=1), or 666 msec (for t=2), etc. so effectively for a repeat of t seconds it will try three times, failing two and succeeding one. The 333 stems from 1000 milliseconds per second, and 3 short sleeps for 1 activation of the "do the thing".
2.
yes Thread.Sleep() is always executed by the thread that executes it, just like "I am myself" and "it now is today". All always true.
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
Quake2Player wrote: while (true)
{
if (DateTime.Now > nextCheck)
That is really bad code! It just lurks around iterating like crazy asking "HAS THE TIME COME? HAS THE TIME COME?" and does it NON-STOP! That's rude and possibly one of the worst ways to do it.
Can the thread not sleep for t seconds for every iteration instead? Or use a timer?
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
What's wrong with a timer ?
Christian Graus
Driven to the arms of OSX by Vista.
"I am new to programming world. I have been learning c# for about past four weeks. I am quite acquainted with the fundamentals of c#. Now I have to work on a project which converts given flat files to XML using the XML serialization method" - SK64 ( but the forums have stuff like this posted every day )
|
|
|
|
|
.NET provides 3 different timer classes that can execute a method on regular intervals.
You can look here[^] for a start.
|
|
|
|
|
Hi,
I experienced something really weird today. First, some context: Im trying to retreive list of files from .csproj file (visual studio project). I found that file list is at this path: Project/ItemGroup/Compile. So I loaded the file into xml document and queried nodes by SelectNodes method. Nothing special. But... When I call something like this:
doc.SelectNodes("/Project/ItemGroup/Compile")
then no nodes are returned. Call like this:
doc.SelectNodes("/*[name()='Project']/*[name()='ItemGroup']/*[name()='Compile']")
works and returns expected result!
And nothing special in xml, looks like this:
<ItemGroup>
<Compile Include="****" />
</ItemGroup>
Does anybody have an idea whats happening?
IComplexApplication app = Programer.Implement(); // Programing is simple!
|
|
|
|
|
hello my friends. here is my questions
1)
i have made an application with a database.
i have made a win application with a database included. i wite the code using datasets,datatables etc... if i want to see the new datas in a table i have to reload the MyDatabase.mdf file in order to see them if i save datas when i run the application, so if i make a setup.exe for this app when i run it and do some sabes in the database will iu be able to see them in the app??
2)
i created an setup.exe
but when i fire tha icon to run it it says something about the database
"An attempt to attach an auto-named database for file C:\Documents and Settings\Administrator\My Documents\Visual Studio 2005\WebSites\WebSite1\App_Data\aspnetdb.mdf failed. A database with the same name exists, or specified file cannot be Opened, or it is located on UNC share."
any suggestions???
thank you
|
|
|
|
|
Go to the ASP.NET [^] forum and try asking there.
|
|
|
|
|
I'm working on a managed MIDI wrapper. Because the only valid devies are those that ae installed, the wrapper exposes a static public property that is an array of devices that are instances of the Input or Output classes (it is not possible for them to create their own instances of these classes).
It's extremely important that any devices used are stopped and closed etc correctly before the program closes.
To do this, I've made the Devices[] property getter return a singleton's static property that is the array, and put the necessary logic in the singleton's destructor.
Is this the best approach?
public class Output
{
private class Singleton
{
static Singleton()
{
Output[] result = new Output[GetNumberOfDevices()];
if (result.Length > 0)
{
for (UInt32 u = 0; u < result.Length; u++)
{
result[u] = new Output(u);
result[u].SetDeviceCapabilities();
}
}
Devices = result;
}
internal static Output[] Devices { get; private set; }
~Singleton()
{
Output.CloseAll();
}
}
internal Output(UInt32 id)
{
}
public static Output[] Devices
{
get { return Singleton.Devices; }
}
public new static void CloseAll()
{
foreach (Output device in Devices)
device.Close();
}
public override void Close()
{
}
internal static UInt32 GetNumberOfDevices()
{
return InteropFunctions.midiOutGetNumDevs();
}
internal void SetDeviceCapabilities()
{
}
}
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia) Why are you using VB6? Do you hate yourself? (Christian Graus)
modified on Thursday, May 28, 2009 4:54 PM
|
|
|
|
|
This is a good example of where you should use the Dispose pattern. You can find a bit about the Dispose pattern at http://msdn.microsoft.com/en-us/library/b1yfkh5e.aspx[^] on MSDN.
Here's a bit of a template example of the class members I would add to implemented it in your case:
private object syncRoot = new object();
private bool isDisposed = false;
~Output()
{
Dispose(false);
}
public override void Close()
{
Dispose();
}
public void Dispose()
{
Dispose(true);
GC.SuppressFinalize(this);
}
protected virtual void Dispose(bool disposing)
{
lock(syncRoot)
{
if(!isDisposed)
{
if(disposing)
{
}
}
isDisposed = true;
}
}
I would also consider having some separate class, like a MIDIDeviceManager to control the life cycle of our Output objects and provide system information like the GetNumberOfDevices() method. In my opinion it would be a bit cleaner than having it all in the Output class. It could also allow you to only create the Output device instances the user needs, rather than an array of all of them.
|
|
|
|