|
I guess I'm wondering why the first statement would not be out of scope, then...??? I get valid values for the first statement, but an error on the second... I'm able to do quick watch on the first variable with no problems.
In fact, if I add both to my watch window, and then step past both statements in the debugger, the first variable is valid and the second says "out of scope"... I'm clueless... thanks for your input...
|
|
|
|
|
figured it out...
Reason it was outa scope is because it wasn’t being used elsewhere in the code… technically, it makes sense cuz if it’s not used anywhere other than on the line where the variable is assigned a value, it goes outa scope as soon as you leave that line… ok I’m over it… thanks again for the input
Vince
|
|
|
|
|
Hi,
Okay I am trying to serialize a class and throw it into a MemoryStream so that I can send it from my client to server.
ie..
MemoryStream ms = new MemoryStream(ByteBuffer,0,iRead);
BinaryFormatter b = new BinaryFormatter();
b.Serialize(ms, m_User);
My problem is I don't know how big my serialized class is going to be before I start, which means I don't have iRead.
Could someone help me out with this...
Thanks.
|
|
|
|
|
CodePuppet wrote:
MemoryStream ms = new MemoryStream(ByteBuffer,0,iRead);
You are using one of the non-resizable MemoryStream constructors. Why not use new MemoryStream() instead, and then adjust the capacity with a simple .SetLength() .
Serialization itself[^]. (the tutorial uses a FileStream, but that's not an issue since both FileStream and MemoryStream are IO.Stream derived classes).
|
|
|
|
|
Hi all,
This might be a very easy question and a commen topic and I know there is a lot of info on it but I could not find a single tutorial or artical for creating and using a dll in Dev-C++, I am using the latest version 5.0 beta 7 (4.9.7.0). I know there is a project template type dll to select and most of the code is ready but I can't understand it and there is nothing written in the help documents. And the worst part is there is nothing on how to use the compiled dll . The reason why I choose Dev-C++ for my dll is becouse I love it and it is so easy to use, except for this part maybe , and I have already written the program that the dll is for in Dev-C++. I heard on the site www.functionx.com/visualc/applications/staticdll.htm from FunctionX that dlls compiled in Visual C++ can't simply be "plugged" in programs written in Dev-C++ and Borland C++, is that true? And how do I use and create a dll in Dev-C++?
Aidman » over and out
|
|
|
|
|
|
Where else should I post this topic? Everything else seems to be related to Visual C++...
Aidman » over and out
|
|
|
|
|
|
Hmm... But Dev-C++ is a diffrent compiler... ok I will try
Aidman » over and out
|
|
|
|
|
I am sure that .Net was sent to drive us all insane.
I have a data grid bound to a datatable in a dataset.
I have a label that displays the number of items in the grid, or shall we say it should
I wanted to update the row count in response to RowChanged and RowDeleted, just set the label equal to DataTable.Rows.Count. But no, thats not updated until after the event has fired.
Are there any events in DataTable, DataSet, DataView or anything else that fires _after_ the row count has been updated?
Looks like I have to put some convulted logic in there to work out what the user is doing
Thanks
Stephen.
|
|
|
|
|
The order of events being triggered are as follows :
- RowChanging
- RecordStateChanged
- RowChanged
- and only then the Rows.Count value is updated (!) ( this.Rows.ArrayAdd(row); )
Since DataRowCollection (what you get with this.Rows) is an internal class, and on the other hand the collection itself (ArrayList) doesn't trigger any event when objects are added, updated or removed, I am afraid you are a bit bound to rely on code like this :
- make sure to subscribe for all RowChanged events.
- make sure to read the DataRawChangedEventArgs .Action property passed along with it, and check for one of these actions {Add, Change, Commit, Delete, Nothing, Rollback}.
- then, from the current Row Count value, and this action, just try to guess the final Row Count value. (*)
- alternatively to (*), create a short life timer in your RowChanged event handler and let it go. Then get the actual Row Count value when the timer signals.
|
|
|
|
|
Thanks for that, I had come to the same conclusion, but it's good to hear it from someone else.
I wounder if any of this behaviour has changed in V1.1 of the framework?
Stephen.
|
|
|
|
|
I have a panel and label whos click event points to the same event handler
How do I
1) Work out if the sender was a panel or a label
2) if the label is the child of the panel (i.e. lbl.Parent = PanelX;)
how can I get the parent of the label so that I can work on it.
private void button1_Click(object sender, System.EventArgs e)
{
Panel abtn = (Panel)sender;
// what if the sender was the label not the panel
// How do I get to the Panel
if (prevbtn != abtn)
{
prevbtn = abtn;
}
}
|
|
|
|
|
if (sender is Panel)
{
Panel panel = (Panel)sender;
}
else
{
Label label = (Label)sender;
Panel parent = (Panel)label.Parent;
}
please note that i am presuming that when the label is added to the controls collection, its parent parameter is automatically set.
1001111111011101111100111100101011110011110100101110010011010010 Sonork | 100.21142 | TheEclypse
|
|
|
|
|
Cheers, works a treat
Satvinder
|
|
|
|
|
Hello people
I am having a small problem getting my UI to work the way I would like it too, basically I need to display a list of items that is generated during the application runtime. There are two ways I can do this but I have problems with both, a solution or suggestion for either would be greatly appreciated :
1) Textbox
How can you get a Textbox to scroll to its last line? i.e. displaying the last line added to the control via .AppendText (setting focus using .focus & .ScrolltoCaret doesnt work)
2) Listbox
How can you permanently disable the vertical scrollbar on the listbox?
EDIT : In an ideal world I would prefer to use a listbox with all scrollbars disabled but I cannot find any docs about this. With regards to the textbox problem it would seem this is an MS "feature" :
http://www.dotnet247.com/247reference/msgs/5/25733.aspx
|
|
|
|
|
MrEyes wrote:
1) Textbox
How can you get a Textbox to scroll to its last line? i.e. displaying the last line added to the control via .AppendText (setting focus using .focus & .ScrolltoCaret doesnt work)
In an ideal world I would prefer to use a listbox with all scrollbars disabled but I cannot find any docs about this. With regards to the textbox problem it would seem this is an MS "feature" :
http://www.dotnet247.com/247reference/msgs/5/25733.aspx
When MS says something is by design, they are not saying that you can't override the TextBoxBase.ScrollToCaret() class method and provide your own implementation, especially when you know the default implementation only does a SendMessage(hWnd, EM_SCROLLCARET, 0, 0), which is a WIN32 message sent to the underlying WIN32 editbox.
After all, make sure you have a working WIN32 implementation, and then add SendMessage calls to your C# app. You don't even need to override the TextBox classes (TextBox and/or TextBoxBase), although it is better to do so in terms of object-oriented spirit.
MrEyes wrote:
2) Listbox
How can you permanently disable the vertical scrollbar on the listbox?
Same here. In addition, how can you think about a listbox without a scrollbar? How do you reach non visible items without the scrollbar (and without a keyboard of course) ? That would be pretty much non-standard UI. But heck, you choose. Just create your own System.Windows.Control derived class, and make sure to properly set the createparams property (that's a simple class wrapper which stores all standard WIN32 styles).
Good luck!
|
|
|
|
|
Web site: http://test.labdotnet.com/GenuineChannels/GenuineChannels.html
Genuine Channels implement bidirectional TCP channels (for .NET Remoting infrastructure) that solve the primary problem of native tcp channels and all sequential issues. Also they implement some features that help to build durable, viable and stable client-server solutions.
Brief explanation
Microsoft .NET Framework implementation of TCP channels allows using TCP channel only as a server or client connection. If you want to provide feedback from the server to client, server must connect to the client’s port. This scheme consumes two TCP sockets and is not workable if client is behind NAT or Masquerade server. Also, native implementation closes TCP connection after non-customized period of time.
Genuine Channels use the only connection from the client to the server. There is no problem if client is behind firewall, NAT or Masquerade server. Also, Genuine Channels implement some features to help building durable, viable and stable client-server solution.
Features
Only one TCP connection is used between client and server.
Fully compatible with .NET Remoting infrastructure.
Each connection has queue of messages being sent.
Constraints on the queue are possible. It greatly helps to force reconnection if current connection is too slow.
Automatic client reconnection to the server. Server and Clients does not lose messages during reconnection. It’s very useful if your server must talk to the client.
Full support of sync, async and one-way messages.
Adjustable timeout to wait for reply from the remote host.
Real async processing. You can have any number of threads at a server and at a client that will automatically use the same TCP connection.
Each exception has unique identifier that simplifies centralizing error processing or translating error messages to any language.
Automatic ping to check TCP connection if connection has not been used for (by default) 120 seconds.
Detailed logging system that receives all events and can save even the entire incoming and outcoming TCP streams as well as exceptions, stack traces and object’s guids. You can write your own logger and attach it to the system.
Dmitry Belikov.
|
|
|
|
|
|
how do i get the filename of a process?I know how to get the list of processes on a local machine, but i'd like to know how to get the full path (i.e: c:\windows\system32\svchost.exe) of a process.
|
|
|
|
|
you can use the Process.GetProcessesByName or Process.GetProcesses to get a Process object. You can then use the MainModule property to get a ProcessModule object for the process, and the ProcessModule has a FileName property that gives a full path to the processes .exe (etc.)
1001111111011101111100111100101011110011110100101110010011010010 Sonork | 100.21142 | TheEclypse
|
|
|
|
|
|
no problem.
1001111111011101111100111100101011110011110100101110010011010010 Sonork | 100.21142 | TheEclypse
|
|
|
|
|
Hi,
I am sending a file between a client and server I made and I am not sure how to detect when the file is complete. The only way I can think of is sending the size of the file to start and then continously checking to see if it has reached that size on the other end.
There must be an easier way...
If anyone could help me out a bit that would be awesome.
Thanks very much,
Steve
|
|
|
|
|
I would think that would be the best way to do it. After all, that must be what IE does when it shows you how much you've downloaded so far and how much you have left to download. Besides, then you could show some nice little progress bar.
Hey, what can I say? I'm a chick magnet...a babe conductor...a logarithm for the ladies.
-Strong Bad from HomeStarRunner.com
Essential Tips for Web Developers
|
|
|
|