|
While executing my C# console program, I'm unable to see the output window (console), it just blinks and exits as if some batch file has been executed.........how can i make the console window stay open till i closes it.........Thanks
Thanks
|
|
|
|
|
Put a Console.ReadKey() in there. This will keep the window open until someone presses a key.
|
|
|
|
|
thanks buddy............tht did worked.........!!!
Thanks
|
|
|
|
|
apart from pressing F5 directly u can go for Ctrl+F5 ... it will work fine ...
vikas da
|
|
|
|
|
Place onece the following code
Console.Read();
|
|
|
|
|
Hi All,
How can i know from the keyboard scan code what is the real key ?
I using KBDLLHOOKSTRUCT Structure in my keyboard hook to get the pressed keyboard information - But i still don't understand how can i know what the meaning of the key that was pressed even if i know the scanCode of the pressed key.
I don't want to use "switch..case" to check for each option pair So ... i looking some .net Framework class ( or win32 function ) that can find the value of the scanCode of the pressed key.
Beside this - how can i know if the key that pressed is 'A' or 'a' or '5' pr '%' - ?
Thanks for the help
|
|
|
|
|
Hi Yanshof,
Is this win32 function of any help to you. It will enable you to translate the vkCode member of the KBDLLHOOKSTRUCT to a character code.
MapVirtualKey Function
The MapVirtualKey function translates (maps) a virtual-key code into a scan code or character value, or translates a scan code into a virtual-key code.
To specify a handle to the keyboard layout to use for translating the specified code, use the MapVirtualKeyEx function.
AlanN
|
|
|
|
|
Thanks,
I will try this now.
Is there is some .net framework class that i can use ?
As you said - the MapVirtualKey Function is win32 function.
|
|
|
|
|
|
How can i know if the user pressed on LShift+Q or just on Q button ?
|
|
|
|
|
It seems that with the DayaGridView SelectionMode property I can only select one selection mode like FullRowSelect or FullColumnSelect. But I would like the ability to select either a full column or a full row. Just like in a Excel spreadsheet.
Is this possible or not?
Thanks,
Mark
|
|
|
|
|
I am gonna use SendMessage API function from my c# managed code and my problem is which data type to choose for its parameters .
[DllImport("user32.dll", CharSet = CharSet.Auto)]
public static extern int SendMessage(int hWnd,
int Msg,
IntPtr wParam,
IntPtr lParam
);
my problem is about wParam and lParam's data types . The message I am trying to send is WM_COMMAND message with BN_CLICKED notification type . How can I use this function. How can I convert string data type to IntPtr ??? How can I do it
?
|
|
|
|
|
|
Hi, I m working on remoting to develop trading application to accept bid/ask value from user and broadcast to every connected user.
Process is working smoothly on localhost as well as on LAN.
But it is not working when i host app on static IP based server.Client send bid/ask value to server but does not get updates except client running on server.
Currently i m running server app manually by clicking on server.exe.
I did not get any change if I replace http channel with tcp
Any comment/suggestions r invited. Thanks all.
Client and Server Configuration file are given below.
Server Config File
-----------------------
<configuration>
<system.runtime.remoting>
<application name="Trading">
<service>
<wellknown mode="Singleton" type="Server.Broadcaster, Server" objectUri="Broadcaster.soap"/>
</service>
<channels>
<channel ref="http" port="16784">
<serverProviders>
<formatter ref="binary" typeFilterLevel="Full"/>
</serverProviders>
<clientProviders>
<formatter ref="binary"/>
</clientProviders>
</channel>
</channels>
</application>
</system.runtime.remoting>
</configuration>
Client Config file
-----------------------
<configuration>
<system.runtime.remoting>
<application name="EventClient.exe">
<client>
<wellknown type="Common.IBroadcaster, Common" url="http://203.200.95.133:16784/Trading/Broadcaster.soap"/>
</client>
<channels>
<channel ref="http" port="0">
<serverProviders>
<formatter ref="binary" typeFilterLevel="Full"/>
</serverProviders>
<clientProviders>
<formatter ref="binary"/>
</clientProviders>
</channel>
</channels>
</application>
</system.runtime.remoting>
</configuration>
|
|
|
|
|
webSpider wrote: <channel ref="http" port="16784">
If you are going through a firewall that will block that port that's not going to work.
led mike
|
|
|
|
|
Hi Led,
Thanks for reply,
well, firewall is off on server.
Is it should be off on both side?
how can i open port on client/server side.
ant other clue?
thanks
|
|
|
|
|
Also you will need to enable port forwarding in the router/modem if one is used.
|
|
|
|
|
I have been looking for a while now and cannot seem to locate a reason why VB sizes a Boolean as either a 32bit or 64bit value instead of just a single byte.
I am making the assumption that it has something to do with alignment in memory and speed in access but I would love to locate a real resource to verify it for me.
|
|
|
|
|
I think bools just default on .NET to the default pointer size. I could be wrong.
|
|
|
|
|
leppie wrote: I think bools just default on .NET to the default pointer size. I could be wrong.
Do you mean default int size? (not yanking chain,just asking )
Learn to write self marginalizing code!
Call 1-888-BAD-CODE
------------------
Silver member by constant and unflinching longevity.
|
|
|
|
|
This is the disassembly of Boolean, not sure if it will help.
public struct Boolean : ...
{
internal const int True = 1;
internal const int False = 0;
...
|
|
|
|
|
My VB is very rusty, but the following code outputs a '2', indicating a 16 bit value. This is very likely due to memory alignment.
Dim b As Boolean
Debug.Print(Len(b).ToString)
Semicolons: The number one seller of ostomy bags world wide. - dan neely
|
|
|
|
|
In C# System.Console.WriteLine ( "{0}" , sizeof(bool) ) ; yields 1, indicating one byte.
Both C# and VB.net are CTS languages so they should be the same.
|
|
|
|
|
Interesting... The following code for me in VB:
Dim var As Boolean = True
Console.WriteLine(Len(var).ToString)
Console.WriteLine(System.Runtime.InteropServices.Marshal.SizeOf(var).ToString) Renders:
2
4
|
|
|
|
|
See my response here[^] for why Marshal.SizeOf returns a different size.
As to using Len, I have a feeling you get different sizes due to this (from http://msdn.microsoft.com/en-us/library/dxsw58z6.aspx[^]: With user-defined types and Object variables, the Len function returns the size as it will be written to the file by the FilePut function. If an Object contains a String, it will return the length of the string. If an Object contains any other type, it will return the size of the object as it will be written to the file by the FilePut function.
Scott.
—In just two days, tomorrow will be yesterday.
—Hey, hey, hey. Don't be mean. We don't have to be mean because, remember, no matter where you go, there you are. - Buckaroo Banzai
[ Forum Guidelines] [ Articles] [ Blog]
|
|
|
|