|
LimitedAtonement wrote: the ListView is useless: it only approximates my needs,''
I didn't say that. I said that I would rather find a 3rd party control that comes as close as possible to my needs and not rely on Microsofts implementation which only generally does what I need. You use the correct tool in the draw for the job at hand. If you want to go through all the pain of hanging additional functionality on a general MS control, more power to you. But, I'll use the one that is already pretty close if not dead on to what I need without spending the extra money on developing my own. Trust me, I do that enough already. When it costs me, say, $395 to get a control that does what I need, why should I spend 100 hours at, say, $40 an hour ($4,000) developing a control to do the same thing?
|
|
|
|
|
LimitedAtonement wrote: I'm in Microsoft land
You're giving them (MS) delusions of competence, you are going to have to buy or roll your own. Infragistics do a nice one but their object model is a little overwhelming.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Hello,
I'd like to know if it's possible to "wrap" a running process, and get all it's Outgoing network traffic? E.g when I'm playing a game, trap its network traffic and send it to a different server?
PS: This is not used for any form of hacking.
Thanks in advance,
Zaegra
Motivation is the key to software development.
|
|
|
|
|
for redirecting it is possible if it doesn't use direct IP accsess
C:\WINDOWS\system32\drivers\etc
inside there is a file named host (Without extension).
You can redirect a specific DNS name to specific IP
If you type www.google.com it will automatlcly go to 209.85.129.147, because it is on DNS server.
If you put in host file
127.0.0.1 www.google.com
and then you save that file.
After that all links that try to use www.google.com will look only on your machine. (127.0.0.1 is localhost)
For monitoring look at Packet Monitor C#[^]
|
|
|
|
|
Thanks! I will try this
Motivation is the key to software development.
|
|
|
|
|
How can I do it? I have a custom borderless form that I want to not overlap the taskbar when maximized, and I was told that it is possibly to prevent that through the use of WM_GETMINMAXINFO + WndProc. Is it really possible, and if so, how?
Thanks.
|
|
|
|
|
Are you coding in C#?
As i see your question, it shoud belong into c/c++/mfc board
|
|
|
|
|
Yes, I'm very much coding in C#.
|
|
|
|
|
I would do this whay:
this.FormBorderStyle = FormBorderStyle.Sizable;
this.WindowState = FormWindowState.Maximized;
this.MaximumSize = this.Size;
this.FormBorderStyle = FormBorderStyle.None;
This whay it can be seen with a border with less than a second. If you want to avoid and get the screen size, you need to use PInvoke of SystemParametersInfo with Constant SPI_GETWORKERAREA
and you could get the size of worker area. Also there can be problems when you have AutoHide enabled for taskbar. If you have then i suggest using PInvoke to constantly monitor changes when it apears or dissapears
|
|
|
|
|
> PInvoke to constantly monitor changes when it apears or dissapears
Please elabroate on that one. ![Smile | :)](https://codeproject.global.ssl.fastly.net/script/Forums/Images/smiley_smile.gif)
|
|
|
|
|
|
Sorry, but those didn't really help me.
Any ideas on WM_GETMINMAXINFO?
|
|
|
|
|
protected override void WndProc(ref Message m)<br />
{<br />
if (m.Msg == 36)
{<br />
}<br />
base.WndProc(ref m);<br />
}
this is from sdk:
The WM_GETMINMAXINFO message is sent to a window when the size or position of the window is about to change. An application can use this message to override the window's default maximized size and position, or its default minimum or maximum tracking size.
A window receives this message through its WindowProc function.
You can also look into events as ResizeBegin and Move. Althou when i have overriden WndProc, my Form didn't open
Why it didn't help. I have tested and my taskbar wasn't hidden.
|
|
|
|
|
Hmm, I probably did it wrong then. Can you show me your code?
|
|
|
|
|
this.FormBorderStyle = FormBorderStyle.Sizable;
this.WindowState = FormWindowState.Maximized;
this.MaximumSize = this.Size;
this.FormBorderStyle = FormBorderStyle.None;
I used this code in on load event. When i set the form Maximum size, even if you maximize it won't go beyond MaximumSize property
|
|
|
|
|
Thanks, that worked. Love you ![Laugh | :laugh:](https://codeproject.global.ssl.fastly.net/script/Forums/Images/smiley_laugh.gif)
|
|
|
|
|
I do have code which is reading the data from an excel sheet properly. but have a weird issue.
If the excel sheet has a column containing long numbers data eg. 89.00000001 and if that column is not resized to its max, that cell is displaying "#####" if you open the excel sheet. So my application code is also reading it as "#####" instead of the correct data. If i resize that column to display the data properly and save, then my application code is reading the data correctly.
I can have my users to have the input excel sheet have all the columns maximized, but was wondering if there any way to have it done programmatically.
Do let me know.
My code snippet is :
// get data in cell
for (int i = 2; i <= iValue; i++)
{
dr = ds.Tables["dtExcel"].NewRow();
for (int j = 1; j <= jValue; j++)
{
oRng = (Microsoft.Office.Interop.Excel.Range)oSheet.Cells[i, j];
string strValue = oRng.Text.ToString();
dr[j-1] = strValue;
}
ds.Tables["dtExcel"].Rows.Add(dr);
}
return ds;
Thanks
Prasanna
|
|
|
|
|
PrasannaKulkarni wrote: 89.00000001 and if that column is not resized to its max, that cell is displaying "#####" if you open the excel sheet. So my application code is also reading it as "#####" instead of the correct data.
This isn't really possible unless you've doing something very wrong. If you get the Value of the cell, you get the value. The "######" you see is strictly limited to the display of the value, not the value itself.
As I look at your code, I see you're getting the Text property of the cell, not it's Value.
|
|
|
|
|
appreciate your so quick response.
Me excel document has everything from text values to numeric values. Whats the right way to read the data?
Prasanna
|
|
|
|
|
Read both and analyze what you've got. You should already expect certain types over values in certain ranges of cells. If you expect a certain cell to have a numeric value, you should only be looking at the Value property of that cell. You still need to validate what you get from it though.
|
|
|
|
|
Please could somebody help... My brains gone dead
I'm trying to pass the following to a wcf service
public IList<tbItem> GetItemsWhereIn (IList<tbClass> iclass)
{
iServiceClient svc = new iServiceClient();
IList<tbItem> list = svc.FindItems(iclass);
return list;
}
The problem is passing parameter iclass to svc.FindItems
error Cannot convert from system...IList<tbClass> to tbClass[]
The wcf service is setup as
public interface iService{
[OperationContract]
List<tbItem> FindItems(IList<tbClass> iclass);}
And the linq query as
public List<tbItem> FindItems(IList<tbClass> iclass)
{
...linq code working correctly
}
If you could point the way I would be very greatful ![Big Grin | :-D](https://www.codeproject.com/script/Forums/Images/smiley_biggrin.gif)
|
|
|
|
|
I think you need to tell the Client Service Reference to generate the Client proxy using genertic Lists rather than arrays (Lists<T>, IList<T> and other collection types are normally sent up and down the wire as T[] unless you tell the service reference to generate the proxy with something else:
- Right click your service reference
- Select Configure Service Reference
- In the Collection Type drop down select System.Collections.Generic.List
Note that you can't set the Value to IList<T> as Services don't play well with Interfaces / OO in general.
CCC solved so far: 2 (including a Hard One!)
|
|
|
|
|
Thanks for answer, this did the trick
I just needed to then change this line
IList<tbItem> list = svc.FindItems(iclass.ToList());
![Big Grin | :-D](https://www.codeproject.com/script/Forums/Images/smiley_biggrin.gif)
|
|
|
|
|
I have a List<MyClass> I use this list to populate a combo box so that the user can select an item from the list, and I can easily grab which one they selected:
onSelectedIndexChanged(...)
{
this.currentItem = this.comboBox.SelectedItem as MyClass;
}
The strange thing is, when you first select an item from the list, the box doesn't display any text. If you select the same item again, it does.
The box will only display the correct text if you select the same item twice in a row, and everything works as normal when I don't set this.currentItem
Upon further testing it seems to happen when I access properties on the instance of MyClass right after selecting it. If I comment out a bunch of code the combo box works fine, although it's only reading a few values nothing is actually being changed, not that I see how it could make any difference.
Does anybody have any idea what's going on?
EDIT: I know what it was, purely my fault. When an item was selected a numeric up down control was set with a value from that item, this triggered the ValueChanged event, which reset the value back to the item, and triggered Sort on my list, which clears out and refills the combo box with the items in the new order. Bit of a pain in the arse really, I must pay more attention in future
My current favourite word is: Delicious!
-SK Genius
Game Programming articles start - here[ ^]-
modified on Friday, October 2, 2009 10:15 AM
|
|
|
|
|
Hi.
I got a server and a client application. Server sends bytes to client in TCP. But the problem is that it's "too fast" I mean in a way. For be more specific. I have objects of a class (in a List) in the server side, I format that to xml string, and then format the string to bytes and send this byte array.
//Client:
NetworkStream = new NetworkStream(SocketClient);
while (ListOfObjectToSendOut.Count > 0)
{
NetworkStream.Write(BytesToSend, 0, BytesToSend.Length);
NetworkStream.Flush();
Thread.Sleep(100);
}
//Server:
TcpClient myClient = new TcpClient("localhost", 8000);
NetworkStream NetworkStream = myClient.GetStream();
byte[] bytes = new byte[3000];
while (true)
{
int IncomingByteLength = NetworkStream.Read(incomingBytes, 0, 3000);
}
You can ask, what's my problem?. Let's say that the Object I want to send is 150 bytes long. And I want to send out 5 Object. My problem that i need to happen this in an order like this:
Write 150 byte
Read 150 byte (and than "unformat" it)
Write 150 byte
Read 150 byte (and than "unformat" it)
and so on.
With this way I could unfomate the 150 byte in the Client side.
BUT!!! In a real world it will write out 150 byte and 150 byte again and so on and THAN the Client will Read 450 or 600 or 750 bytes. It is imponderable. And I CAN NOT unformat 300 or 450 ... to my Object. So the Flush doesn't flush it (I read in msdn that it is ok, cause flush wont do anything with the networkstream)So the problem is that the Server sends out 150 bytes and send out the next 150 bytes so fast that the Client will read those together (for example 300 bytes), which is not good.
I need to READ THIS "PACKAGES" SEPARATE in the client side.
- I can solve this to write a Thread.Sleep(100) but i dont want to do that, It would be to slow!
- I can solve this proble using UDP, but i dont want to use UDP.
- I could solve this porblem with a a solution like:
Take a sign byte after every 150 byte, and seperate in the client side by that sign. And then format the bytes back. But I dont want to do that.
- I tried Socket.NoDelay doesn't help
- I tired close and dispose and than make it again the networkStream in EVERY loop. It doesnt help.
Now all you programmers, here is a big deal, Who is the Best Programmer? What can I do? (I hope you can understand my problem )
Thanks!
|
|
|
|