|
Has anyone ever developed a com class to allow data to be extracted from MT4 platform? I have developed a TCP/IP wrapper class which works great, but MT4 does not seem to allow multiple TCP/IP sessions!?
I see this (http://www.mql5.com/en/articles/249[^]) article online, has anyone have any experience with this? Its supposed to work for MT4 as well.
Mike
|
|
|
|
|
Hello , I'm learning English. My English is low.
My question is : I have two keyboards in my pc. I was studing this article from Using Raw Input from C# to handle multiple keyboards[^] from Emma Burrows. I understan the article.
Now I can identify any keyboard, for example : Keyboard 1 is A, Keyboard 2 is B.
In my aplicacion that I'm doing in C#, I use two keyboards, A and B, if I press any key from keyboard A, my program say : Hello Word. If I press any key from Keyboard B, my program say : Bye ! World! . This is in my program.
My question is : I want isolate keyboard B, the keyboard B must exist only for my program, for example, if I want write in notepad when my aplication is running with keyboard B, this must be imposible because I want use keyboard A and B ONLY in my program , but I want write with keyboard A in notepad, I must can it. I must write in others programs only with keyboard A.
The keyboard B must not exist for other aplications. Only must exist the Keyboard A for the aplications , but my program work with keyboard A and B.
This is because I'm using a barcode gun, for windows it is a keyboard. If you are writing a e-mail and I use the barcode gun, you can see numbers in you email when you are writing. I want avoid that.
If you are writing with keyboard A a e-mail and I use the barcode gun or keyboard B, Windows must ignore the codebar gun.
Ok, I hope do you understand me.
|
|
|
|
|
You picked the wrong hardware for this requirement. You're using a USB barcode scanner running as a HID device. That, as you've found, runs as a keyboard to Windows. Had you picked either a serial- or network-based scanner, you wouldn't have to write a single line of code to satisfy your requirement. The scanner won't show up as a keyboard.
Now, since you've picked the wrong hardware interface, you have to spend an awful lot of time writing code to get around this problem. The only way to do that now is to write an application that is essentially a global keyboard hook.
You'd be using the same code that you used from the example article in an application that, instead of processing the key and using it, eats the key and doesn't pass it on to the system.
|
|
|
|
|
Hello Dave. My problem is: I have a small gym. I'm doing a program of access control. I have a computer. I use this computer to listen music, write a letter, navigate in internet ... anything.
When a new user is in my gym, I want print a card with : photo's user , Name's user and a barcode user. When the new user come to my gym, He only must pass the card with her codenumber in the scanner barcode.
You imagine: If I'm writing in FireFox www.anypage...., or writing in word... and in that moment, a user pass her card from codebar scanner , I can see www.goo4748383747 , and I have will delete the numbers.
Therefore I want isolate the codebar scanner of Operative system. Do you have any information about globals hooks?
Thanks !!!
|
|
|
|
|
OK. Your explanation of what's going on justifies my response. YOU ARE GROSSLY OVER ENGINEERING THIS!!
Scrap the USB scanner and get one with a serial interface. DONE! Your code is up and running practically in a day.
Your app only has to watch the COM port for data to come over it and then process as normal. No screwing around with split keyboards at all!
|
|
|
|
|
I do not want to be stubborn.
Hello Dave,I forget say you this: I have a new computer. My computer have not COM PORT , only USB. Nowadays, all computers have only USB , for any companies COM PORT is obsolete.
Therefore I'm searching information about that. If is very dificult, I need a old computer with COM PORT.
¿Can you help me? Thanks.
|
|
|
|
|
|
Yeah, get a USB to Serial converter cable.
BTW, it's Parallel ports that are obsolete. Machines and motherboards are still coming with Serial ports.
|
|
|
|
|
thanks !! I will think this option !!! Thanks Dave.
|
|
|
|
|
tsw1985 wrote: This is because I'm using a barcode gun, for windows it is a keyboard. If you
are writing a e-mail and I use the barcode gun, you can see numbers in you email
when you are writing. I want avoid that.
That doesn't sound like a real business requirement.
Hypothetically...
This is a cash register app that allows it to scan items, issues receipts and can also send email to other stores.
Now if the clerk is typing an email why would they pick up the scanner and use it?
Conversely what if the clerk wants to send the email and then put the scan code in the email...so they write some text, scan a product (which puts the code in the email) and then they write some more.
So in the one case you have a scenario that just will not happen. And then you 'fix' it. And that completely precludes the second scenario.
|
|
|
|
|
After reading your post and the replies, my recommendation is to buy a second computer (even something as simple as a Fit-PC or a Plug PC) to run the app. It could then interact with the main PC via a Web Service or something.
|
|
|
|
|
Hi every one! I want to know how to send sms using GSM modem. i mean connecting a 3G enabled mobile phone in to our computer through USB and sending SMS using C# application. advance thanks for all!!! please help me.
|
|
|
|
|
I don't know how to do the connect to 3G phone via usb for sms, but you could try this company, it has an api that allows two way sms communication. Clickatell
|
|
|
|
|
Hi All
I am trying to create a generic method for calling stored procedures
I would like to pass in the Parameters in via an array
At the moment i am having trouble adding the parameters to the SqlCommand
This is what i have so far
Can anyone advise
thanks
Simon
Calling the method
string[] paramNames = new string[1];
paramNames[0] = "@date = 2012-1-1";
string err="";
WriteToDatabase("exec LoadData", CommandType.StoredProcedure, paramNames, out err);
Method
public static bool WriteToDatabase(
string sql,
CommandType commandType,
string[] paramNames,
out string errorText)
{
bool success = false;
errorText = "";
try
{
using (SqlConnection connection = new SqlConnection(ConnectionString))
{
connection.Open();
List<SqlParameter> parameters = new List<SqlParameter>();
foreach (string paramName in paramNames)
{
parameters.Add(new SqlParameter() { ParameterName = paramName });
}
using (SqlCommand command = new SqlCommand()
{
Connection = connection,
CommandText = sql,
CommandType = commandType,
Parameters = parameters
})
command.ExecuteNonQuery();
connection.Close();
}
}
|
|
|
|
|
Well, you have supplied as the value for paramName @date = 2012-1-1 . That's not a parameter name, that's a parameter name and associated value. Also, what type is your parameter?
|
|
|
|
|
si_69 wrote: I am trying to create a generic method for calling stored procedures
Normally that isn't a good idea. It adds complexity and does not have a significant impact on maintenance costs.
si_69 wrote: Can anyone advise
So if you still want to do it...
1. You must create a sql statement dynamically with matching parameter place holders corresponding to those in the collection(array.) So you are creating SQL dynamically.
2. You must then create a SqlCommand with at sql. Then you populate it the parameters with the collection.
|
|
|
|
|
0) It probably shouldn't be static.
1) You should probably not keep creating the Connection and Command -- create one and hold onto it (in the closed state).
2) Where does ConnectionString come from?
3) Here's your code with a few changes. It compiles, but it's untested:
public static bool WriteToDatabase(
string sql,
System.Data.CommandType commandType,
out string errorText,
params System.Tuple<string,object>[] values
)
{
bool success = true;
errorText = null;
using (System.Data.IDbConnection connection = new System.Data.SqlClient.SqlConnection(ConnectionString))
{
try
{
using (System.Data.IDbCommand command = connection.CreateCommand() )
{
command.CommandText = sql ;
command.CommandType = commandType ;
foreach (System.Tuple<string,object> param in values )
{
System.Data.IDbDataParameter p = command.CreateParameter() ;
p.ParameterName = param.Item1 ;
p.Value = param.Item2 ;
command.Parameters.Add(p);
}
connection.Open();
command.ExecuteNonQuery();
}
}
catch ( System.Exception err )
{
success = false ;
errorText = err.ToString() ;
}
finally
{
connection.Close();
}
}
return ( success ) ;
}
WriteToDatabase
(
"blah blah blah"
,
System.Data.CommandType.Text
,
out error
,
new System.Tuple<string,object> ( "@date" , System.DateTime.Now )
) ;
|
|
|
|
|
hi everyone i was wondering how to load a textfile into textbox on a windows application, and also when it is loaded, edit the data and save any changes made via a second form. many thanks
|
|
|
|
|
|
Set the MultiLine property of TextBox to True as given here
http://msdn.microsoft.com/en-us/library/12w624ff.aspx[^]
for showing and editing multiple lines. Then the following code can be used to read all the text from the inputFile to the TextBox and then to save the modified text from the TextBox to the outputFile
TextBox1.Text = System.IO.File.ReadAllText(inputFileName);
System.IO.File.WriteAllLines(outputFileName, TextBox1.Text);
|
|
|
|
|
+5 for short and to the point answer
Happy Coding...
modified 12-Apr-12 3:06am.
|
|
|
|
|
|
You need StreamReader to read the data from file and show into text box, Here is the code snippet for that:
sr = new StreamReader(filename);
while (!sr.EndOfStream)
{
if (txtBox.Text.Trim() == "")
{
txtBox.Text = sr.ReadLine();
}
else
{
txtBox.Text = txtBox.Text + Environment.NewLine + sr.ReadLine();
}
}
Note: TextBox Should be Multiline, replace the "filename" with your file location and you must include:
using System.IO;
Now for saving the data, you need to write the text of textbox in file. For that ou need StreamWriter. For this You can take the reference from following link:
http://msdn.microsoft.com/en-us/library/8bh11f1k.aspx[^]
Happy Coding...
|
|
|
|
|
Hi all
I am having a picture box with a world map image of size 1800*3600 in it. Now I would like to create heat maps at different points based on latitude and longitude positions and the intensity of heat maps should be different for each point.
can anyone help me in designing the above said feature
thanks
|
|
|
|
|