|
snorkie wrote: I'm not sure what to do with this.
snorkie wrote: I didn't see any hits for that string in Google either.
Try this[^]
|
|
|
|
|
I'd have 9,000 posts on codeproject too if I spent all my time being a jackass. I even posted that I googled and didn't find anything. I should have posted that I didn't find anything helpful! I know what the exception is. My code caught and logged it... What I'm not sure about is what to do with it. The error code from the message, "A system call that should never fail has failed." is not exactly normal.
Hogan
|
|
|
|
|
snorkie wrote: I'd have 9,000 posts on codeproject too if I spent all my time being a jackass.
Your post didn't say anything about searching for the ERROR CODE, so f*** off you brain dead a**hole.
Oh, and have a nice day.
|
|
|
|
|
Sounds like a great idea. Its 5:00pm and I have nothing to do tonight!
Hogan
|
|
|
|
|
never encountered it before,
snorkie wrote: I'm not sure what to do with this.
may be you should log it to the "This log shall have no entries" log.
Yusuf
|
|
|
|
|
Hi snorkie,
Have a look here:
http://msdn.microsoft.com/en-us/library/ms740668(VS.85).aspx[^]
Reflector tells me that Socket.Receive ultimately calls on "ws2_32.dll" to get the job done and its recv function is returning a failure code of WSASYSCALLFAILURE (10107).
The description in the link above suggests a possible multi-threading issue or a corruption of the underlying network stack.
pb
|
|
|
|
|
Hi everybody hope you could solve my problems well let me explain it...
I have a c++ dll that uses MFC
I need to create an instance of a class inside that dll in a c# project
I need to end with another dll that can be added as reference in that c# projects
I have the code of the c++ dll so if necessary i can change it.
ok solutions? i have found many possible "solutions" but all that information confused me, well the possible solutions i found are:
Inside the c++ dll project add a managed class that just act as a proxy, the problem with this solutions begins when trying to compile it because causes many errors with "/clr" options...
Create a new managed c++ project that act as a proxy and use the dll, but i just couldnt use the dll inside the new project...
Create a rcw in c# with sentences like comimport... marhall... etc... but i just couldnt find a good tutorial for dummies. example i dont know where to get the GUID :S.
ok any solution that you can give me? an url to read? or what to search please help me...
Inside
|
|
|
|
|
EcK3kO wrote: I need to create an instance of a class inside that dll in a c# project
You can't do that.
One thing you can do is wrap that class in a managed class using C++/CLI. There are a massive number of introductory articles and information about CLI on the internet. There is even a series of beginner articles here on Code Project and of course a large amount of information on MSDN.
|
|
|
|
|
Hello,
I just finished one of my first programs, a program to show and hide windows by process. I'd like to go ahead and give it to my boss to put it in production, but the memory usage ranges from 12-15MB, and doesn't seem to make any sense.
A co-worker of mine has a similar piece of software (handles z-order of windows), which he programmed in delphi, and it only takes 4-5MB of RAM.
I attempted to call the garbage collector more frequently, but, as expected, this didn't have much of an effect (from what I've been reading, it does its job pretty efficiently on it's own).
Does anyone have any tips for memory optimization?
Thanks very much,
Matt
|
|
|
|
|
First, if you're looking in TaskManager to see the memory usage, it's lying to you. You're app isn't taking that much memory. A .NET app, like Java, runs in a kind of virtual machine. What you're seeing is what the .NET CLR has reserved for your application, even if the memory isn't being used. No, you can't do anything about it since all memory management is done automatically by the CLR.
If Windows needs the memory the CLR has reserved back, the CLR is more than happy to return whatever it can. The reseason the memory is reserved to start with is because when your code allocates memory for an object, it's much quickler to allocate it out of the managed heap the CLR maintains, than it is to go back to Windows, ask for a block of memory, add it to the managed heap, then allocate your object.
Calling the GarbageCollector doesn't do anything for you except screw up the internal optimization algorithm it uses. Unless you're an advanced developer with a definite need to do this and know precisely why you're doing it and the consequences of doing it, you show never force the GC to do an early collection.
Plus, 12 to 15MB of memory is nothing now-a-days, so what are you worried about??
|
|
|
|
|
Dave Kreskowiak wrote: Plus, 12 to 15MB of memory is nothing now-a-days, so what are you worried about??
from OP
OP wrote: A co-worker of mine has a similar piece of software (handles z-order of windows), which he programmed in delphi, and it only takes 4-5MB of RAM.
The Boss will make big fuss about .net
Yusuf
|
|
|
|
|
Yusuf wrote: The Boss will make big fuss about .net
Then the boss needs to read up on it and make form and educated opinion. The size of the runtime means nothing when it's productivity in writing code that's far more important. Ask him if he knows how memory management works in the .NET CLR. Does he know how it works in Delphi? Then compare the two.
Oh, and this reading is not just for the boss. It should be for you too, so you can explain it to him...
|
|
|
|
|
Hi,
I agree with Dave.
bbranded wrote: Does anyone have any tips for memory optimization?
The best optimization tip, assuming the functionality requirements warrant it: add lots of code and functionality, and rejoice when multiplying the source by 1000 makes the memory footprint grow by a much smaller factor.
Luc Pattyn [Forum Guidelines] [My Articles]
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets
modified on Sunday, June 12, 2011 9:03 AM
|
|
|
|
|
Thanks for the info guys. I remember reading a blog post about it, but failed to be able to cite it to the senior dev.
I understand what you're laying Luc. Neato.
Thanks,
Matt
|
|
|
|
|
you're welcome.
Luc Pattyn [Forum Guidelines] [My Articles]
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets
|
|
|
|
|
This isn't a solution as such - but an observation. When an .Net application is minimized, the reported RAM useage in task manager decreases dramtically. I found this with an app that I did that ran in the tray mostly. On launch I forced it to minimize before placing it in the tray and all the clients stopped moaning!
Also, make sure you've compiled it as 'Release', not debug if you're just testing/running the exe rather than an install, that can make a difference too.
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)
|
|
|
|
|
|
Hi everyone,
I use Regex for splitting a string. Now i have 2 Questions:
1. I have e.g the string "something || anything && anotherthing" and I want to split it into string[3] ={ something, anything, anotherthing }; is there an easier way than to use 2 Regex like Regex("||") and Regex("&&") and split it first with one Regex and then each element with the other?
2. I have heard that when you split a string you can leave the splitsequence (like in the example before "||") to one of the stringsresults. How can I do that?
Thanks for your help!
|
|
|
|
|
If you have the same delimiter between strings, then the easiest way is to use Split() method of string class.
string str = "aaa::bbb::ccc";
string[] splittedStrings = str.Split("::");
But, if the explression is more difficult, then Regex is a good solution
|
|
|
|
|
Why not just use the following regex: "( \|\| )|( && )" It finds either and can be used in your split.
Hogan
|
|
|
|
|
Somehow that is not working...
I tried
Regex reg = new Regex("(\\|\\|)(&&)");
on
string input = "something || anything && anotherthing";
but it isnt Spliting it even once
|
|
|
|
|
Try again with the correct string
Regex reg = new Regex("( \|\| )|( && )");
Hogan
|
|
|
|
|
Oh there was an | between the brackets...
Thanks a lot, and this also solves Question 2
|
|
|
|
|
Hello,
I have a little Stored Procedure (SQL Server 2005), which returns some tables. Now, I'm getting those tables in the DataSet in my code. The problem is that I'm not getting TableName of none of the tables. All I get is a default naming convention "Table", Table1", Table2" ....
What is the way to get the TableName from SP? How can I basically know which table represents which select in the SP?
Thanks,
Maxim
|
|
|
|
|