|
How to free the display of the form/control? SuspendLayout() can not work.
Thanks!
|
|
|
|
|
what you need is the invalidate function..
invalidate has several constructors.. but to clear out the hole form you simply use "Invalidate()";
ex. if (x==0)
Invalidate();
//This will clear the form surface if the value of X is 0
there are other constructors calling regions, polygons etc but there would be of no use to enumerate them.. another one you could use is the one used to clear a rectangular section of the form:
Invalidate(Rectange rectf)l
ex. if (x==0)
Invalidate(new Rectangle(new Point(0,0),new Point(50,0),new Point(0,50), new Point(50,50));
//This will clear a 50 by 50 pixel square section of the screen starting from coord(0,0)
-- modified at 18:29 Sunday 23rd October, 2005
|
|
|
|
|
Hi,
I have a winform app that is occasionally going into a loop and taking up 99% of CPU. I have stepped through it with the debugger 20 times at least and all appears fine so it seems it's only happening when running standalone (ie: not via VS.Net).
I simply can't work out why it's doing it so what I want to know is how I could catch the app doing this and then throw an exception or display a message showing me where it is in the program. Is there any way in .Net to do this?
Failing that are there any tools that "profile" the running app so I can try and work out where the problem is?
TIA for any suggestions or help...
Mike
|
|
|
|
|
It doesn't have to be looping to hang like this. It just needs to call a function that blocks execution and the function call never returns. But, you never know...
If it does this frequently, you can try recompiling the app in Debug mode and running the application under the debugger and just wait for the problem to happen. When it does, flip back to the debugger and hit the Pause button. You SHOULD see a highlight on the line that's hung or a line inside your infinite loop. If not, you can try looking at the Call Stack to see what method your in inside your app to at least pin down approximately where your app is hung.
I also found the Runtime Debugger helpful a couple times to root out a particularly nasty bug a while back, Runtime Debugger (CorDbg)[^]
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Like Dave said, you can attach to the Visual Studio debugger and hit Break All when you sense 99% CPU usage.
If you want a decent *free* profiler, I'd suggest DevPartner Profiler Community Edition[^]. Plugs into VS .NET and the price is just right
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
Thanks Guys... I found what it was in the meantime so I've solved it now... but I have to honest and admit I didn't know about "break all" - seems you really do learn something new every day! (It's also a bit emabarrassing when I've been using VS.Net for 3 years and counting!!)
Anyway, it turned out to be a Regex Match function that was getting stuck finding URL's and email addresses in some HTML I was giving it. The HTML I'm matching is a chunk scraped from one of our client's pages which was not always the same so sometimes the regex would work and other times it would go into an endless loop. I reviewed how I was fetching the HTML from the pages and now it seems to work fine again.
Cheers,
Mike
|
|
|
|
|
i would check all the looping statements and add a message to each.. the one that is displayed while the looping takes place is your problem.. anyway i think either your CPU is not very performant and cannot process a longer loop fast, or your loop is veeeeeeeery long, and in that case u will have to find a simpler way to code that section..that is, in case your loop ever stops.. or there could be that the end-loop condition is never met.. check your code.. there can not be anything wrong with the compiler.. if there are no errors that's its job... you can also use Watch and Breakpoints but I prefer attaching message boxes to suspicious sections
Ravenash
|
|
|
|
|
I have a deployment project which runs Custom Actions before and after installation - these actions call a class to deal with backing up a database and then updating the schema to a current version.
Is there anyway of debugging this class as the deployment is being executed?
At present I write all actions out to a log and ensure everything is working that way. If I want to test something failing by inserting some code I need to rebuild the deployment each time.
|
|
|
|
|
|
I am using a NET Custom Action and the technique in the link worked a treat.
Thanks very much.
|
|
|
|
|
Hello,
I am developing one application using VB.NET & Access + Oracle as a databases, and I want to install it on client machine. I want to make setup of my application in such a way that it will determine immidiately that .NET Framework should be installed before starting installation of my appl.(and obviously it shoud install it...)
I read some MSDN stuff and I was trying to do something as follows :-
1. I have tried it by adding "Launch Condition" to Setup Project that checks whether framework is present or not and displays message box that it must be installed b4 but does not installs it automatically.
2. If I add "Custom Action" to Setup Project, the action is taken after installation of my application.
Can anyone please suggest me how i should go about it???
This is VERY URGENT and I hope ne1 of you will help me sure...
Thannks in advance....
Regards,
Rohan
|
|
|
|
|
Search MSDN on Bootstrapping + Net Framework. There is a bootstrapper component that handles the NET Framework install.
|
|
|
|
|
Thanx for replying...
I have seen that document...and accordingly I have installed "Microsoft VS.NET 2003 Bootstrapper Plug-in Setup". As I have mentioned, I have also added "Custom Action" and "Launch Condition" to my setup project. But "Launch Condition" only determines whether the condition specified is true or not and if its true then proceeds to install the application. Also "Custom Action" is executed after my application's installation...wherein I have specified to install .NET framework.
Now, I don't know how to take the custom action before doing nething else...
Can u please tell me, if according to current situation, if .NET framework is installed after my application's installation is completed, then will it work on target machine???
Looking forward to see your reply...
Regards,
Rohan
|
|
|
|
|
Rohan_bhat_31 wrote: Can u please tell me, if according to current situation, if .NET framework is installed after my application's installation is completed, then will it work on target machine???
Of course. The .NET framework always installs to the same place, and registers itself with the OS. Your app will run fine as soon as an appropriate .NET framework is present.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hi
How can I share the .NET framework in a workgoroup for a single project
shyjupkandachira
|
|
|
|
|
What? I hope I'm interpreting your question correctly.
The .NET Framework must be installed on each PC that's going to run a .NET managed code application. You can't "share" a single copy and have all the .DLL's and stuff work from a remote volume.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
-- modified at 7:34 Monday 17th October, 2005
|
|
|
|
|
or you can run Start/Run/regedit .. Software section/ Microsoft and copy the full .Net Framework section to a folder in .key format.. then u copy it on all computers and simply run it.. this will add all registry keys.. this is the final step though, i presumed you know where all the .dll's and other resource files are... you realise those have to be copied too, using THE SAME path
|
|
|
|
|
In .NET 2003 after creating a Office Project and compile, the Word is opened and a fraction later is closed...
If I clos teh VS and enter the doc created by the project the Word is opened and this error apears:
"The current .NET security policy does not permit testWordProject to run from the folder .\testWordProject_bin\. Do not change the security policy in your computer. The .Net security policy is controlled by your administartor or the developer who wrote the custom macros. .......bla bla..."
How can I solve this?
I have OffciePro 2003 and Office comps from installed from the VS DVD...
PLS HELP
"Tow things are infinite,
the Universe and human stupidity,
and I am not so sure about the former!"
Albert Einstein
|
|
|
|
|
After reading some articles I convinced that C# (.NET 2003)is not good enough yet for heavy array operations. Therefore, I want to use VC++ for math functions and C# for GUI applications. How can I use them together?
Any comment will be appreciated.
Yours
Nuray
|
|
|
|
|
The best way to do it is to write your code in C++ and provide a managed wrapper using MC++.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
I use VS .NET 2003 (Framework Version1.1). I downloaded NET Framework Version 2.0 Redistributable Package Beta 1 (x86). I don't undertand how do I use new Framework. After the installation no shortcut is created.
Thank you in advance.
Nuray
|
|
|
|
|
You can't use VS .NET 2003 with .NET Framework 2.0 Beta. You'll have to make do with the command line tools or install one of these[^].
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
Thank you. Microsoft website is not clear.
If I install Visual Studio 2005 Beta 2 I think I will have .NET Framework 2.0 Beta. Is that correct?
Yours
Nuray
|
|
|
|
|
|
Does any one know of a good place to get help on programming imaging applications for Pocket Pc’s running Windows CE 4.2 .NET or better?
Ronald Hahn, CNT - Computer Engineering Technologist
New Technologies Analyst
HahnTech Affiliated With Code Constructors
Edmonton, Alberta, Canada
Email: rhahn82@telus.net
|
|
|
|