|
hi all
i wanted to ask about how to ignor keyboard And mouse input
|
|
|
|
|
For your keyboard i your Key_Press event you can set the e.Handled to true. Other way is to implement IMessageFilter and use AddMessageFiletr , so you can handle all events for your application. Look in MSDN for more information and how to use them.
Mazy
No sig. available now.
|
|
|
|
|
I've got a bit of an obscure problem extracting my objects from a HashTable. The basic idea is that the hashtable is populated with objects - which are classes of UTServer. UTServer is a class that contains various variables and a single method - refresh(). I also need to use a hashtable because of the key it uses (since I have to link my hashtable to a listview later on and want it to be as fast as possible)
I don't appear to have any trouble adding the UTServer classes into the hashtable. However getting these out and reading the variables held inside is proving to be difficult.
My Code as follows:
//Declaring the hashtable publicly
Hashtable servers = new Hashtable();
//Adding a UTServer into the hashtable
UTServer myServer = new UTServer();
myServer.ip = "192.168.0.1"
myServer.port = "7777";
myServer.queryOffset = "10";
myServer.game = "ut";
myServer.serverID = 1;
servers.Add(myServer.serverID, myServer);
(when counting the objects in servers - it returns the correct amount)
//UTServer class that is added into the hashtable
public class UTServer
{
public String ip = "";
public String port = "";
public String queryOffset = "";
public String game = "";
public long serverID;
public UT2003Server remoteServer = new UT2003Server();
public void Refresh()
{
remoteServer.Ip = ip;
remoteServer.Port = int.Parse(port);
remoteServer.Protocol = UT2003Server.QueryProtocol.Mixed;
remoteServer.Refresh(game);
}
}
//My code that doesn't work
object obj1 = servers[1];
UTServer b = new UTServer();
b = (UTServer) obj1;
MessageBox.Show(b.ip);
(it should in the messagebox show the ip "192.168.0.1" however it gives a null pointer exception instead.
I would greatly appreciate any advice anyone has, thank you.
Peter
|
|
|
|
|
Peter Mills wrote:
object obj1 = servers[1];
This is a bit of a stab-in-the-dark but the literal 1 you have is an int where as you define UTServer.serverID as a long
Try:
object obj1 = servers[(long)1];
--Colin Mackay--
EuroCPian Spring 2004 Get Together[^]
"You can have everything in life you want if you will just help enough other people get what they want." --Zig Ziglar
|
|
|
|
|
That's done it! WOW!!!! Thanks for the help, I'd been struggling over it for hours!
Thanks,
Peter
|
|
|
|
|
I have a Cobra LS 1900 bar code scanner that I would like to add in to a C# application. But I have no idea how to do this. The scanner I have connect to the keyboard connection and keyboard is connected to the scanner basically it’s a Y cable. If any one gives some direction which way I should go Greatly Appreciated!!
Thanks so much
CJ
|
|
|
|
|
See .NET TWAIN image scanner[^] here on CodeProject.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
I am writing a POS for our school's bookstore and am using a keybaord wedge scanner as you described. In my case I was able to plug the scanner in and read codes right out of the box. I was worried about how I would access it so I thought to try the simplest solution first. I created a simple form with a text box and label. When the text box had focus I scanned a bar code and the numbers (under the bar code) appeared in the text box. Give it a try it may work like mine did right out of the box.
|
|
|
|
|
??? tight budget since I really want to transfer to C# but I don't want to pay 2000.00
Actual Linux Penguins were harmed in the creation of this message.
|
|
|
|
|
|
The compiler is free, you can download it from Microsoft[^].
And you can download a free IDE here Borland[^]
Free your mind...
|
|
|
|
|
As they said, the SDK contains the compiler and is free. If you want a good, free IDE there's also SharpDevelop at http://www.icsharpcode.net/OpenSource/SD/Default.aspx[^].
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
I'd also recommend SharpDevelop, while their are a few bugs and annoyances I find it to be excellent.
|
|
|
|
|
As they have spoken so it is. Have fun with C sharp!
...the mind is not a vessel to be filled but a fire to ignited
|
|
|
|
|
Hi there,
Wondering if anyone knows how to send an object that is already serialized in .Net remoting. And listen and read the serialized object that is being received. I want to be able to send a serialized object and recieve and store it in a database, as well as pull a serialized object out of the database and send it through .net remoting.
Right now, I send an object that gets serialized and then deserialized at the other end. Then serialize it again to put it in the database. Then to send it, I pull it out of the database deserialize it and the send the object through .net remoting where it gets serialized again before it is sent.
This is alot of overhead that should not be required. I'm sure there is probably an easy way to do this???
Thanks alot,
I could easily see this being covered in another article but I have searched and can not find anything.
thanks again.
|
|
|
|
|
Another way, yes. Easier, perhaps not. The trick is to use the SOAP in the SoapServerFormatterSink without serializing and deserializing the object. You could override ProcessMessage to intercept the request and response streams appropriately and save these as text (since it is SOAP) to a database. You could then use this server formatter sink in your remoting configuration instead of the default SoapServerFormatterSink which would serialize and deserialize the object.
You could also use a regular sink in the chain to grab the SOAP and put it in a database, but the default formatter sink would still serialize and deserialize the object.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
But how do I call the method to begin with. I would call the method on the client, but it would require an object to pass in, which it would then serialize, then i use a formatter and replace its serializing with mine from the database?
This is the best I could come up with.
How would I call a blank method for invoking the method, and then in the formatter chain input my serialized object in the formatter i make?
I actually haven't done any remoting only read and looked at code samples.
Thanks very much for the help.
Ya, so all i need is to invoke the client proxy method, with blank info some how? and then add my serialized object in the formatter?
Thanks again.
|
|
|
|
|
Everything in this case (if I understand your problem correctly) happens on the server. The client would be none-the-wiser what's going on at the server (as is typically the case anyway). The Remoting server is configured to use a derivative SoapServerFormatterSink - the sink in the chain that actually performs the serialization. This formatter sink merely saves the SOAP that represents the object to the database, and retrieves the SOAP from the database to send back to the client, so no serialization is actually performed.
The implementation depends upon many things. For example, you could use a get and set method (don't use a property, though, because you'll incur an additional round trip to get the accessor). The client passes an object to the set method that gets serialized. It goes to the server in the form of an IMethodCallMessage which you store the parameter in the database. For an IMethodReturnMessage you get the stream from the database (for instance, using a TextReader ) and pass that back to the client.
I hope this explains the concept a little better. As I mentioned the first time, this isn't necessarily an easy thing. It's just something you're going to have to try. It should work based on what I know and my experiences with .NET Remoting.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Ok, thanks very much for the help.
That should help alot.
|
|
|
|
|
Oh, and you might consider configuring the formatter sink in your configuration file or through the Properties dictionary to use includeVersions="false" since your objects are being persisted and might change over the lifetime of the persisted data, meaning that (if you version your assemblies correctly) it would be valid because the Types would be different (even by simply changing the version). This could save you a lot of headaches down the road.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
I compile a C# Web Service with the following command line
csc /t:library /out:ForwardRate.dll ForwardRate.cs /r:System.Data.OracleClient.dll
Following successfull compilation, I copy the DLL to the /bin directory of IIS. When I locally open the URL for my service, I get a page correctly describing my Web Service. However when I use the invoke button to test, it generates an exception of DLL not found. Unable to locate a dll (OCI.DLL). This dll is in the path, but it is not in the /bin directory where the service dll is located. I have since tried to create some simple console programs that duplicate the service behaviour and they compile as above and run without any problem. Does it make sense that any DLL's that a service assembly needs to reference at runtime have to reside in the /bin directory of IIS? Or have I missed out on something else?
Chris Meech
We're more like a hobbiest in a Home Depot drooling at all the shiny power tools, rather than a craftsman that makes the chair to an exacting level of comfort by measuring the customer's butt. Marc Clifton
VB is like a toolbox, in the hands of a craftsman, you can end up with some amazing stuff, but without the skills to use it right you end up with Homer Simpson's attempt at building a barbeque or his attempt at a Spice rack. Michael P. Butler
|
|
|
|
|
That is really strange. I have a web service running and using the ODP.NET, and don't have any references to OCI.DLL.
OCI.DLL is Oracle Call Interface and is installed by the Oracle Client.
Is the Oracle Client installed on the machine you are using to test ??
Free your mind...
|
|
|
|
|
Guillermo Rivero wrote:
Is the Oracle Client installed on the machine you are using to test ??
Yes it is. The two ways that I have checked this are one, using the Oracle Installer to confirm that Oracle Client is installed, and two I put together a couple of test console programs that would connect and query exactly the same as the service is supposed to. These test programs compiled and ran without a problem.
Guillermo Rivero wrote:
I have a web service running and using the ODP.NET, and don't have any references to OCI.DLL
My understanding is that both the classes of Oracle Client of .NET v1.1 or classes of the Oracle Data Provider .NET (from Oracle) require a minimum of Oracle Client 8.1.7. Additionally, once Oracle Client is required, OCI.DLL will get linked in eventually. It's about as low as you get in accessing the database.
I just find it odd that the console programs work but the service does not.
Thanks, though.
Chris Meech
We're more like a hobbiest in a Home Depot drooling at all the shiny power tools, rather than a craftsman that makes the chair to an exacting level of comfort by measuring the customer's butt. Marc Clifton
VB is like a toolbox, in the hands of a craftsman, you can end up with some amazing stuff, but without the skills to use it right you end up with Homer Simpson's attempt at building a barbeque or his attempt at a Spice rack. Michael P. Butler
|
|
|
|
|
|
Try putting oci.dll in your bin directory along with your assembly. Either inetsrv.exe or aspnet_filter.dll doesn't seem to search for files in the PATH and putting native DLLs in the bin directory has worked for us before. There might have been a different problem, though. I remember reading something about this a long time ago and now I can't remember where it is.
Also, are the "console programs" you're talking about .NET console apps that use the Oracle.NET client, or Oracle's console apps? Is oci.dll even in a directory specified by the PATH environment variable?
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|