|
Great.....It works...
By the way, Is this bug being already detected by the Microsoft? or being recorded by the Microsoft?
|
|
|
|
|
Hi everybody!
I've performed recording wave sound in low level (by API function) but I have a problem. In WndProc function, the MM_WIM_DATA message is occured but the buffer is not filled. Could you help me.
Thanhks
Hung
|
|
|
|
|
Read the docs about MM_WIM_DATA on MSDN: this message is also sent when waveInReset is called, so you need to check the dwFlags on the WAVEHDR structure.
Yes, even I am blogging now!
|
|
|
|
|
hi guys, I wish to find out the way to remove the whitespaces in a string
e.g "James Bond"
|
|
|
|
|
Check out the "Replace" method of the string class...
Etienne.
|
|
|
|
|
thankz for the reply, i tried using str.Replace(' ', ''); but its not possible. I need to remove all the white spaces within the string so that i can compare the string to another string.
|
|
|
|
|
string input = "How_are_you_Mr._k o b e z t 0 8? ";
input = input.Replace(" ", string.Empty);
MessageBox.Show(input);
|
|
|
|
|
tried this
string c1 = lstContent1.SelectedItem.ToString();
string c2 = lstContent2.SelectedItem.ToString();
c1 = c1.Replace(" ", string.Empty);
c2 = c2.Replace(" ", string.Empty);
System.Console.WriteLine("c1 = " + c1);
OutCome still the same
"1" "James" "Bond"
tried using c1 = c1.Replace(' ', string.Empty);
but got D:\My Documents\Visual Studio Projects\New-FYP (Try-Out) 2\Form1.cs(372): Argument '2': cannot convert from 'string' to 'char'
|
|
|
|
|
Then your "whitespaces" probably aren't spaces ( (char)32 ).
Try scanning your string characters and find out what char the "whitespace" is. Might be a \t or something. Then once you found out, you can use replace. Replace does work, and your code is right. So only thing left is that you have actually no space in your string.
Etienne.
|
|
|
|
|
string temp3 = c1[3].ToString();
string temp3a = c1[3].GetTypeCode().ToString();
System.Console.WriteLine("c1 = " + temp3);
System.Console.WriteLine("c1 = " + temp3a);
Outcome:
c1 =
c1 = Char
weird although it's stated as a char, it is a Tab in the .txt file when i check. is there any way to remove it then?
the format in the .txt file is this
"S_N" "Last_Name" "First_Name"
"1" "Yi Zhuang" "Tan"
"2" "Kai Wong" "Lei"
the file is created by exporting a access database table into a txt file
|
|
|
|
|
well, Tab is a character like any other, no strange thing about it.
If you want to be absolutely sure about the ascii code, try this :
char test = c1[3];
int test_ascii = Convert.ToInt32(test);
MessageBox.Show(test_ascii.ToString());
Write down the number the MessageBox will show, then back to your replace code, use :
int the_number_you_got;
my_string.Replace( ((char)the_number_you_got).ToString(), String.Empty);
Etienne.
|
|
|
|
|
Yes it's working now thankz so much for the help
will be coming here to post question again when i start on the reading and comparing of xml data wif .txt data
|
|
|
|
|
Yes it's working now thankz so much for the help
will be coming here to post question again when i start on the reading and comparing of xml data wif .txt data
|
|
|
|
|
I have an application that reads the registry value and diplays result in a textbox (Using Microsoft.Win32 namespace). It works fine as long as I know the registry name. Here is my problem:
1. I have a subkey name MyKey (HKLM\SOFTWARE\MyKey)
2. The key will have one or two subkeys but I do not know their names(lets call them KeyX, KeyY)
3. Every unknow key (e.g. KeyX)has a string value that I want to read
serviceName 12345
Any ideas how to do this?
|
|
|
|
|
You can call GetValueNames() to retrieve the names of the values and GetSubKeyNames() to retrieve the names of the subkeys.
Yes, even I am blogging now!
|
|
|
|
|
|
Hi all,
I have a byte array need to change it into an array of hex then to a string,
having difficulty allocating this problem. Is there any solution?
Thanks
|
|
|
|
|
I’ve run into a problem while using a c# property grid with custom property editors and would appreciate any help. Bear with me as this may be a little difficult to explain.
The situation is as follows:
I have multiple objects selected in the property grid and they are of the same type. I have a custom modal editor defined on a property of this type. The editor works in every case except the following: if the property for any of the objects is null and not null for the remaining objects and my custom modal editor sets the value to null, a property value changed event will not be fired. This only happens when setting to null in exactly these circumstances. My feeling is that it has to do with the fact that when multi-selecting objects with different property values (for the same property) the region for that property is emptied out (same as null representation) and when it attempts to set the value to null it believes that there is no change to be made, even though many of the objects need to be changed.
Anyway, I hope that made sense and like I said any help would be greatly appreciated.
-Darryl.
|
|
|
|
|
I have been searching all over trying to find some easy good network code examples.
Basicly, I am creating (Only for learning purposes) a simple card game. I have the client side pretty much finished, trying to get the server working. My goal was to have 2 games going at once (Seperate timer for each). After 10 seconds (For that game), it will switch to the next players turn if they didn't select any cards.
What I can't figure out, or find anywhere is a good example of code that shows how a request from 1 client, can be forwarded to another client. Another thing would be for the "game timer" to tell all the clients in that game a players turn was skipped.
Even a simple example of a "telnet chatroom" would work. Multiple clients connect to the server, then all messages are forwarded to all connecting clients would be a step in the right direction.
I am fairly new at C#, with a primarly Perl / PHP background. So, please go easy on me :P
|
|
|
|
|
Are you using remoting ?
If you are, then you can't really send a message from one client to another.
Just pass it through the server.
When it's player 1 turn, server calls
client_1_proxy.TimerStart();
When player 1 clicks client calls :
server_proxy.Played();
Or if the 10 seconds run out :
server_proxy.TimeOver();
Then server checks whoses turn it is, and go over with client_x_proxy.TimerStart()...
It will probably be easier to go with persistant server object, so you don't have to store game state in a file or something.
Etienne.
|
|
|
|
|
Yes, that is what I planned on doing. The server is going to reply the messages, because the server still needs to verify that its a vaild move.
The timer code, I can figure out for the most part. The main issue I need help with, is the network code it self. I have a few examples, some using threads, some note. Some have like 5 different classes, some less.
I need to be to keep track of multiple (Persistant) connections. When the server decides to change the game state (Player moves, players skipped, etc) it needs to let all clients, or only some clients in that game know. (My longer goal was to run 2 or more games at once)
I figured having a seperate class to define the game state information. Client "id"s that are connected, which players have which cards, last card dropped, which players turn it presently is, etc. Then have a timer that interacts with that class. This timer is only for this game instance. When the state changes, it doesn't affect other games.
I hope that explains what my goal is a little more.
|
|
|
|
|
I have the disc, installed it, but can't find any samples anywhere ? Where are they ? Or if there aren't any, where can I find some on internet ? I tried the ones that are built for Longhorn but they won't compile as the CTP (for XP) has some fundamental changes in it (like namespace changes, some features cut-off and so on).
Regards, Desmond
|
|
|
|
|
Hi,
I have an application where I dynamically build a form based on a selection made in a database tree. All controls added to the form are docked at the top. It all works except for the speed. I am using the suspend and resume layout but that still doesn't address the drawing speed. All my controls are also built using the default windows control.
Does anyone know why the controls are so slow to add to a form dynamically?
Is there anything I can do?
Thanks!
|
|
|
|
|
|
I'd suggest sending a WM_SETDRAW message to stop redrawing the form while you're adding the controls.
Another simpler suggestion (and, depending on your code, can give performance enough) is doing all the manipulation on the controls before you call Controls.Add, so it'll minimize redrawing.
BTW, 99% of the "slow dynamic controls" posts I answer here are performance problems within the generation of the controls, i.e., in your data access code, and not a .NET framework performance problem.
Yes, even I am blogging now!
|
|
|
|