Who ask you about difference between working and screwing around?
I only want to know how to hook keyboard press in a windows form even after it's minimized or not focused.
Look, I managed to solve my own problem.
I ask here nicely to get some help so I can finish this faster.
This is what I called (solution) even it's not what I want, I appreciate it.
Abhinav S wrote:
Handling the forms keydown event would give you a count of key strokes within the application.
Dave, I believe you know how to do this.
But I don't know why everytime you respond my question, always something weird like your question above.
I tried to learn, not "gimme code to hook keyboard press please thank you email me bla bla".
Next time if you're not going to give me some help, then please find another question to answer.
How do you define "more useful"? There are many reasons why you would choose one over the other but it will depend on the problem you are trying to solve and the skill levels and experience of your developers.
One of these days I'm going to think of a really clever signature.
You get Access Denied because the account your code is running under does not have permissions to the remote machine. By default, if you don't specify any account information in the Management connection objects, it'll use the account your code is running under. If that account doesn't have permissions on the remote machine, it'll fail.
On the Oracle DB there's a stored proc defined like:
PROCEDURE pGetHashes ( iFrom IN NUMBER, iTo IN NUMBER, sHash1 OUT CHAR, sHash2 OUT CHAR );
When I call this procedure from within my app, I only get a value for the sHash2 parameter. The value of the sHash1 parameter is always null. (Running the same stored proc from sqldeveloper gives a result for both hash values.)
Underneath I have added the code which I use to call the stored proc. Does anybody see anything I might have done wrong?
int iFrom = 0;
int iTo = 1000;
using (IDbCommand command = dbConnection.CreateCommand())
OracleCommand orclCommand = command as OracleCommand;
orclCommand.CommandText = "pGetHashes";
orclCommand.CommandType = CommandType.StoredProcedure;
orclCommand.Parameters.Add("iFrom", OracleDbType.Int32, iFrom, ParameterDirection.Input);
orclCommand.Parameters.Add("iTo", OracleDbType.Int32, iTo, ParameterDirection.Input);
OracleParameter orclParam = new OracleParameter("sHash1", OracleDbType.Char, 100);
orclParam.Direction = ParameterDirection.Output;
orclParam = new OracleParameter("sHash2", OracleDbType.Char, 100);
orclParam.Direction = ParameterDirection.Output;
orclCommand.BindByName = true;
// after this the orclCommand.Parameters["sHash1"].Value is always null.
// the orclCommand.Parameters["sHash2"].Value has the correct value.
For extra documentation. Running the following PLSQL from within sqldeveloper results in both a value for Hash1 and Hash2:
SET SERVEROUTPUT ON;
nFrom NUMBER := 0;
nTo NUMBER := 1000;
pGetHashes( nFrom, nTo, sHash1, sHash2 );
dbms_output.put_line('Hash1: '|| sHash1);
dbms_output.put_line('Hash2: '|| sHash2);
Thanks for any light you can shed on this problem.
My application works well on Vista, Win 7 32 and 64 bits.
It modifies some registry key in HKEY_LOCAL_MACHINE.
But when run on Win 8 (both 32 and 64), with minimum level UAC (I drag the slider to bottom, then restart), it doesn't work. And there is the error:
"Application attempted to perform an operation not allowed by the security policy. To grant this application the required permission, contact your system administrator, or use the Microsoft .NET Framework Configuration tool. Requested registry access is not allowed."
When I disable completely UAC of win 8 by editing registry, then restart computer, my application works well.
If I run regedit on Windows 7 then it runs with elevated priviledges which causes a UAC dialog to pop.
I find it unlikely that your application is doing nothing and yet is allowed total access to the registry on Windows 7. Do you have UAC enabled on your Windows 7 test box? Are you only editing some user data and as such the app might have access? Or perhaps are you installing it on Windows 7 (installing does seem to provide certain priviledges)? Also are you sure that the user for windows 7 and that for 8 both have the same priviledges?
You might be trying to modify TrustedInstaller keys. TrustedInstaller is a special user that has power beyond that of Administrator(s). You will need to take ownership of the key in order to work around that (completely ruining the security on your user's machine). If you need to change keys owned by TrustedInstaller you are doing something very very wrong.
If you are not trying to modify TrustedInstaller-owned keys you probably need to indicate which permissions you want when you open the key:
using (var key = Registry.LocalMachine.OpenSubKey("SOFTWARE\\Foo\\Bar", RegistryKeyPermissionCheck.ReadWriteSubTree))
// .. or ..
using (var key = Registry.LocalMachine.CreateSubKey("SOFTWARE\\Foo\\Bar", RegistryKeyPermissionCheck.ReadWriteSubTree))
He who asks a question is a fool for five minutes. He who does not ask a question remains a fool forever. [Chinese Proverb]
I am currently a student in TYBSC(IT) so I had a query that in C# windows form If for example a clientname combobox is there and on selecting the client Name in the combobox the 2 text boxes clientAddress and ClientNumber should be retrieved from the database and get filled in the textboxes.
Sir please help me in my project my mailing me a demo program so that I can Find A Solution to It.
Please Sir and as sson as possible as jan end is ma submission date
publicpartialclass Form1 : Form
string Id = "";
string Address = "";
privatevoid Form1_Load(object sender, EventArgs e)
// TODO: This line of code loads data into the 'database1DataSet1.Test' table. You can move, or remove it, as needed.
privatevoid comboBox1_SelectedIndexChanged(object sender, EventArgs e)
string SelectedId = Convert.ToString(comboBox1.SelectedValue);
if (Convert.ToString(comboBox1.SelectedValue) != "")
database1DataSet1.DataSource = Database1DataSet1TableAdapters.GetData(int.Parse(SelectedId));
var Id = from r in testTableAdapter.GetData()
where r["Id"].ToString() == SelectedId
var Address = from r in testTableAdapter.GetData()
where r["ProductId"].ToString() == SelectedId
foreach (var unit in Id)
Id = id.ToString();
foreach (var measure in Name)
ProductMeasure = measure.ToString();
textBox1.Text = Id;
Hello everyone! I would like to know how I can read metadata of exported types using the Managed Extensibility Framework. I am using Visual Studio 2008 with .Net Framework 3.5.
In .Net Framework 4.0, this can be achieved through type 'Lazy' but this is not available in .Net Framework 3.5.
Since 'ExportMetadata' was provided in the version of MEF provided for .Net Framework 3.5, I do believe there is a way of reading the metadata in the framework 3.5 but I don't know how this is done. Any guidance, please?
When you add a reference over the network, the IDE will make a local copy of this dll anyway.
So, nothing should be stopping you from copying the dll to your own machine / project folder and referencing it from this local location.
i use c# with asp.net ,i didn't understand how to add zoom bar to my google map.
in the aspx file the map configure like this:
<cc1:GMap ID="GMap3" runat="server" Width="850px" Height="500px" Language="he"
and the key is configure in the cs file.i saw lots of exsample but evrything in aspx file ,and if i try to change there something i have error in the visual studio.
so i hust want to know how to add this zoom bar in the left
Have a self-hosted WCF REST service w/ custom authentication (UsernamePasswordValidator). I need to return business specific errors from the validator. All methods I have tried to do this with have failed because all the errors get hidden by the HttpWebRequest object in a generic "Forbidden." error. My latest attempt was to write an error code back. Normally, I would do this by using the OperationContext.Current to get the response stream, but OperationContext.Current = null. How does one initialize this in a self-hosted service?
I have a form with a progressBar on it. I'm doing writes in another class (through my interface) and need to show my progress of doing the writes, but I'm getting an error message *. Hopefully someone has an idea how to get the error to go away and so I can update my progressBar from a different class.
I'm more of a C++ developer doing C#, so there might be something that an experienced C# person would know of that I'm missing.
It looks like this:
Form with progressBar displayed
privateint writeIt(refbyte wDat, byte sDat)
result = cr.ProcessTWriting(ref wDat, ref pb_Progress.Value); //this passes a ref to the progressBar value
* In the code above, I'm getting "A property, indexer or dynamic member access may not be passed as an out or ref parameter" error message.
My interface looks like this:
iCR.cs (which is in another VS project due to future CR6, etc. which will use the interface)
int ProcessTWriting(ref byte wDat, refint pb_value);
Then, I want to pass my references (to progressBar value) to where I'm writing my bytes (i to 1024), and update the reference to the progressBar as it iterates through, writing to it's destination.
This would be in my CR5.cs which implements iCR.cs (and is in another VS project still...think Factory pattern):
Sorry in advance for my english. Possibly is not good enough yet...
Do you have the possibility to change your interface?
I'm thinking that a solution to your problem could be the use of events on your CR5 class. (Observer pattern)
You could create an event on CR5 class that can be subscribed by the class that contains the progress bar. Then, you can fire your event on the AttempWrite function with a parameter that indicates de current progress value to set into the progress bar.
Is it a possibility? Or are you constrained to this interface contract?
Last Visit: 31-Dec-99 18:00 Last Update: 20-Sep-14 0:45