Answer Questions
Joseph Stalin Calling a class function from inside a worker thread
I have a class, which creates and starts a worker thread, i want from inside the worker thread to call one of the class functions, how do i do that i called the function from inside the worker thread but it is still the same thread...... if i can't then, generally,how do i notify/update the class that started the thread, from inside the thread Also have a look at running you threads using the backgroundWorker component Search the .Net help for "BeginInvoke" and "InvokeRequired". Inside the class, create the delegate private delegate void MyDelegate ( String msg); suppose this is the fu ...Show All
http://www.ilkon.com Save my program for God's sake!!!!
Just as I was getting some decent work done on my project, I set down my keyboard to make a bathroom run, and once i returned, I found my cat lying on my keyboard... When I tried to clean up the constaint garbage that was created by him, I tried running my program and found a ton of new errors. What makes it worse is that I have this bugged sucker saved... Tried cleaning it up, and like a freakin moron, I saved it before I re-ran the program. Apparently I changed something mere mortals such as my self shouldn't have touched. partial class Form4 { /// <summary> /// Required designer variable. /// </summary> private System.ComponentModel. IContainer components = null ; ...Show All
Sina Hakami Intellisense filter?
Is there anyway to filter intellisense based on events, properties methods In other words, lets say I know i'm looking for a property in an object, I'd like to view only properties and not everything through intellisense... is this possible The Whole Tomato Visual Assist add in supports this behavior, but to be honest it's designed for c++ so it's occasionally wonky with c#, mostly in asp stuff, but it's still wonky. Maybe one of the c# dedicated addins supports this too Cal- Blast, It's not currently possible in VS 2005 to filter (or sort) the IntelliSense completion list. There are a few strategies to get this informaiton from VS, though they do take you away from the edito ...Show All
Winkling accessing inner exceptions in embedded try catch
when we have a global try catch and a lot of small try catches inside the code. How do I get the embeded inner error that causes an error if this exception is located many levels inside the code The thing is if I use throw exception , my code will not continue, right , but the whole point of using try catch is that I want my code to continue execution. Thanks Hi, rtaiss If an error occurred inside try block, it will break out (leave the left code in the block unexecuted) the block and to execute the corresponding catch block code. If you could be more specific, it may be clearer. Thank you yep, i m worried about production environnement like this: void mysub() { ...Show All
rgalgon GDI+ And Redrawing
Hello, I'm making a little app just for kicks, with the sole purpose of being visually pleasing, but I've come across a problem that has stumped me. The traditional (control name)_Paint method is what I am currently using to make sure that the window in my app stays up to date. The problem is that in my app, multiple layers of opacity can come into effect, and the _Paint handler often will make an area too dark by drawing over it too many times, and will eliminate any underlying colors. The only solution I can think of to my problem is storing an array filled with the info of each previous thing the user has drawn. But obviously, refreshing in this way would be massively inefficient. And it is already somewhat slow. It's sort of hard to ex ...Show All
regthesk8r Multidimensional Arrays
Ok, my book really sucks I think. After struggling with an example in the book, I looked in the MSDN and searched these forums. I believe my book is wrong when it shows: int[,] student = new in[4][3]; I tried doing it that way but it errors. int[,] student = new int[5,4]; gives me no error and works. I am going to go with that. Unless someone can tell me that int[,] student = new in[4][3]; is indeed a correct format or what kind of a typing error it could be... The following also seems to be in the wrong format: int[][] x = { { 2, 3 }, { 4, 5 }, { 6, 7 } }; I don't think you can do it that way... Foolios wrote: int [][] x = { new int [] { 2 , 3 , 4 }, new int [] { 5 , 6 , 7 , 8 ...Show All
efratian How can I know whether the app is running in development mode?
Some of the features included in the application I'm currently developing are supposed to be used in 'administrator' mode, but, in fact, the only administrator is the developer and it's likely that none of these will be used by final users. Therefore, instead of defining a particular user to be the administrator, why not letting the application to know wheter it is running whithin the development environement or as a standalone, compiled application I remember a property like this was exposed in VB6, and I assume it is also included in the .net environement, but after some time of messing with the object browser and the internet, I give up and ask for HELP! Where can I find this property ...Show All
feby Computer stats (WEB)
Does anyone have a free webproject that shows computer stats Like Bandwidth Up and Down in use, ram use, processor use....Uptime...These things... Thanks !!!!! Ok, I'll try this...today and then I post if it fits my necessity. Thanks If you mean local client machine hardly. If you mean server machine where website is hosted you can use performance counters as was already described. some of these can be done using the performance counter. Take a look at this thread here, for information on how to get the RAM use/CPU Usage: http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=773531&SiteID=1 in terms of the networking stuff, not entirely sure. One other reference/resource which I believe w ...Show All
_Michael_ How do you convert int[,] into object[,]?
I've got 3 questions. Need help please, 1. I have a multidimension integer[5,3] that needed to be converted into object[5,3]. Is there any best way of doing it 2. What is the best/common practice of searching a record (to see if it existed) a) using executescalar() and what is the object that it returns b) any other suggestion 3. What is a safearray for Can anybody give me a simple example to demonstrate how to use safearray and its benefit Thanks in advance! Thanks for the reply, I thought there was a simple way such as object[]=int[]; I'm new to this C#. language. I find a lot of ways to search a record in a database. The one that I just knew is by usin ...Show All
EvilPaul How to draw this image using GDI+
Could you show me the way to draw following image by using GDI+ Thank you very much. Thank you very much. It works well. You need to use the Graphics.DrawPie and Graphics.FillPie method to draw a pie. Here is a little example: public void FillPieInt(PaintEventArgs e) { // Create solid brush. SolidBrush redBrush = new SolidBrush(Color.Red); // Create location and size of ellipse. int x = 0; int y = 0; int width = 200; int height = 100; // Create start and sweep angles. int startAngle = 0; int sweepAngle = 45; // Fill pie to screen. e.Graphics.FillPie(redBrush, x, y, width, height, startAngle, sweepAngle); } ...Show All
Swapna.B. RTC API 1.X SDK
Hello Everybody, I installed the RTC API 1.3 and then 1.2 SDK but I cannot find it as a refference to add in my project in Visual Studio 2005. I know that this api is primarly for VB and C++, but I just need the libraries in order to create VoIP SIP phone...Does anyone know how to point to the RTCDLL.DLL, it's simply not there, not in the system32..i used guide from http://www.supinfo-projects.com/en/2004/rtc_api/1/ but I cannot locate this library... Please help... Regards, Alen ANYBODY ...Show All
Tilfried Weissenberger C# programming -> structure
HI why we can't initialize the variable inside the structure. Hi I have so many Query regarding structure in c#. please explain all these question in a descrptive way. 1. when to use structure Can any one explain me with real time example. 2. how structure is value type how we come to know that particular type is value or reference. Is there any criteria to identify the value type and reference type 3. why we cant initialize the variable inside the structure. Is it something related to value type. but we can initialize the variable inside the class 4. Why we can't create the parameterless(default) constructor inside the structure. 5 A struct cannot inherit from another struct or ...Show All
JamesCox1968 communication between threads
i am trying to write the sieve of eratosthenes multi threaded but am having a problem getting my threads to invoke and pass information to each other.Any one got any ideas Can you poste the full relevant code This code doesn't give me an idea what you want and what you do. For example, the tnext.compute_prime method, how does his sig and body look like. yes i am but i want to keep the code as simple as possible. i solved the problem of creating another thread . my major one right now is creating and setting a global flag which i can change depending on prevailing conditions. i want a single thread to be able to create another thread only once in its runtime . i want it to execute a certian block of code once once and not do i ...Show All
cdun2 Properties.Settings.Default.Save(); does not save a user.config file.
I have settings that are in the user scope and I can update them at runtime. When I call the save method,nothing gets saved. Any ideas Thank You for the information. I learn something new everyday! In my case it is saving the settings in the App.Config file but I can't get it to load or save any settings. Here is what I have: < userSettings > <namespace .Properties.Settings > < setting name = " WindowLocation " serializeAs = " String " > < value > 0, 0 </ value > </ setting > < setting name = " WindowSize " serializeAs = " String " > < value > 363, 359 </ value > < ...Show All
calmal20 return type of BSTR??
I want to write a function in a class library which is the return type of the function is BSTR, how can i do that Can anyone give me an example source code There is no BSTR type in .NET, you should use String. Hi, chongsk You mean the one in UnmanagedType Enumeration Thanks Hi , Could u please post the solution for ur problem , if u have got Thanx in advance. Regards, Ch.T.Gopi Kumar. Ya, There is no BSTR type in .NET.Use String in the class library. This'll be converted to BSTR , when the above library is used in VC++ client. Thanx, Ch.T.Gopi Kumar. ...Show All
