|
Hey thanks ...........
I solved my problem.
Nice site, and nice members too.
Once again Thanks
|
|
|
|
|
Yes, but did you hook into the event? Or just write the handler?
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.
This message is made of fully recyclable Zeros and Ones
|
|
|
|
|
Hi,
Please help me who know these answer:
I need to Know the which cultureinfo is used in system.
For example: I need to know my system has which datetime format is used us or uk. To know the datetime format of US or UK. Can any idea in Localization or Globalization
Thanx in advance
|
|
|
|
|
Clickity[^]
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.
This message is made of fully recyclable Zeros and Ones
|
|
|
|
|
Application.CurrentCulture
|
|
|
|
|
hi everyone...i have a basic knowledge of asp.net using vb.net and am working now on a project that use c# classes i get to code where i see someting like this Dictionary<string, PageConfig>...so whats that mean
please allow me to be a good programer
|
|
|
|
|
|
thank you
please allow me to be a good programer
|
|
|
|
|
I've been working on a CRS system, and was running into a nasty error...
For some reason every ~16 or so search queries, the program would crash, and give me a WIN32 exception, telling me that my program had used up all its allocated handles.
Ok, so I wasn't disposing of my objects correctly somewhere...
After much searching, I found that the foreach loop that was disposing of the results was not working as expected. (the search results were displayed using Panels).
If I called:
<br />
int i = window.FlowPanel.Controls.Count;<br />
It would return the expected number of (say) 20.
However when I ran:
<br />
foreach (Control c in window.FlowPanel.Controls)<br />
{<br />
c.Dispose();<br />
}<br />
It would cut out of the foreach loop at the 10th object.
If I ran the same foreach loop directly afterwards, it would cut out at the 5th object etc etc.
I solved the problem by using this snippet:
<br />
while (window.FlowPanel.Controls.Count > 0)<br />
{<br />
foreach (Control c in window.FlowPanel.Controls)<br />
{<br />
c.Dispose();<br />
}<br />
}<br />
<br />
GC.Collect();<br />
This solved the problem, but can anyone explain this behaviour?
Cheers,
Mark.
Mark Brock
"We're definitely not going to make a G or a PG version of this. It's not PillowfightCraft." -- Chris Metzen
|
|
|
|
|
It's not that unexplained - Think of it this way: If you have a list and you iterate through it, what happens when you delete one of the list entries? What is the next entry for an entry which has been deleted? What happens when the Controls list is traversed by a different process?
Since foreach does effectively that - calls Controls.Next each time round the loop - it is very understandable that at some point you will have a problem. Normally, you would get a "Collection was modified; enumeration operation may not execute" exception, but I guess Dispose doesn't check that!
Use Controls.Remove to take the controls out of the list, then Dispose them. You will need to need to modify the foreach to a for loop (and I suggest iterating backwards from the last to the first, to make it safer.) You will probably find you can rely on the frame work to do the dispose this way.
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.
This message is made of fully recyclable Zeros and Ones
|
|
|
|
|
Damnit, beat me to the punch.
var question = (_2b || !(_2b));
|
|
|
|
|
Thanks!
Mark Brock
"We're definitely not going to make a G or a PG version of this. It's not PillowfightCraft." -- Chris Metzen
|
|
|
|
|
You're changing the collection you're iterating through--
So the object you started off with at the beginning of the loop is not the same one at the end.
I'm surprised it even let you do that...
a
for(int x=FlowPanel.Controls.Count-1; x>=0; x--)
{
FlowPanel.Controls(x).Dispose();
}
should do the trick, I think.
var question = (_2b || !(_2b));
|
|
|
|
|
Sorry about beating you to it - it was just luck - but I still think using Remove from the controls list will be a better solution than Dispose!
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.
This message is made of fully recyclable Zeros and Ones
|
|
|
|
|
OriginalGriff wrote: Remove from the controls list will be a better solution than Dispose!
Agreed, no arguments there. Didn't think it through completely ;>
var question = (_2b || !(_2b));
|
|
|
|
|
Thanks!
Mark Brock
"We're definitely not going to make a G or a PG version of this. It's not PillowfightCraft." -- Chris Metzen
|
|
|
|
|
hello friends!!
I have made a library for my c# project by combining 3 libraries (using ilmerge).
I wanted to know, is it possible for someone to decompile my new library or view the code?
if yes, how do i protect it?
or is there any other way of merging the library with my project?
|
|
|
|
|
Use Reflector[^] to see the result.
Normally a dll can be protected by Obfuscation.Dotfuscator is a Visual Studio Tool using for obfuscation.
|
|
|
|
|
dotfuscator is good but it does not encrypt the code.
also the project shows an error after being linked with the obfuscated library. obviously because it cannot import the namespaces. how do i correct this? do i need to merge my dll with exe?
|
|
|
|
|
I think you are using dotfuscator in the Visual studio project Dlls.Instead of that use it for dll's and exe in the BIN folder.ie,in the output directory not in the Visual Studio project.
While using dotfuscator browse all of your dlls and also your exe from your build output directory.Otherwise this dll won't work with that exe because of the change in method names and private variable names.
|
|
|
|
|
Thanks arun,
I was only importing dll and not the exe
Now i get the problem.
Thanks again.
|
|
|
|
|
Its ok buddy.
|
|
|
|
|
Arun Jacob wrote: Use Reflector[^] to see the result.
Wow, awesome tool! Thanks!
I wish there was something like that for my VB6 code that I also have to maintain. Of course, there's no time, money, etc to convert my VB6 code to .NET. :-|
________
Joe
|
|
|
|
|
|
amitupadhyay007353543543 wrote: hey pal, googled for u. Check out this link
http://vbcity.com/forums/topic.asp?tid=115861[^]
Wow, thanks!
My desire is for something that will help me find the dependences and code in my VB6 program. By doing a google on VB6 disassembler, I found a bunch of stuff.
I always thought that VB6 compiled directly to assembler/machine code.
My VB6 program started out as a simple quick interface to some custom hardware. However, over the years, it's become a huge monstrosity. Since the program was never planned to be huge with many diverse support functions, it's become a bunch of added_on/hacked_on functions.
I've started the new version in C#. And, I'm and doing the code and functions properly this time to support a complex GUI. However, for a few reasons, I'll still need to support the VB6 program for a few more years. I dread every time I have to go back to VB6 and Visual Studio6. However, as long as I'm getting paid, then it's all good.
Wow, also, I just realized. I have a proprietary calibration routine in my VB6 code. It's part of the overall code base. Now, I just disable/hide that Windows form in the version of code that goes to our customers. However, it seems a VB6 decompiler can expose that routine. Yikes! That's good to know. From now on, I'll strip out that module when I build a customer code version.
By the way, I knew to strip out that proprietary calibration module in my C# customer code version. Until I find/see a very good way to protect that C# code, I'll keep doing that. It would be nice to have just one single C# code base.
Thanks again!
|
|
|
|