|
Finally managed to solve this problem quite simply after hours of messing around with Registry keys and multiple instances of ODBC Administrator.
In the project folder I opened 'projectname'.csproj file in notepad. I then inserted the line:
<PlatformTarget>x86</PlatformTarget>
just before the line - </PropertyGroup>
This forced my application to use the right ODBC drivers etc as I am using a 64-bit machine and solved my problem.
|
|
|
|
|
|
Don't double post, this service is free so don't get impatient after waiting 13 minutes.
No matter how urgent a problem is to you, it is no where near urgent to anyone who is willing to answer your questions. I tell you this because it sometimes puts people off from answering your questions..
|
|
|
|
|
|
Try using Google for a 'low level global keyboard hook', some articles exist on CodeProject as well, so you can even begin here.
I totally didn't understand the part about not making use of an EventHandler.
|
|
|
|
|
EliottA wrote: I totally didn't understand the part about not making use of an EventHandler
I was referring to something like KeyPressEventHandler ... and only making use of a method to get the last key pressed.
For example:
public Form1()
{
TextBox tb = new TextBox();
this.Controls.Add(tb);
tb.KeyPress += new KeyPressEventHandler(keypressed);
}
private void keypressed(Object o, KeyPressEventArgs e)
{
if (e.KeyChar == (char)Keys.Return)
{
e.Handled = true;
}
}
Thanks for the info.
Kind regards,
The only programmers that are better C# programmers, are those who look like this -> |
Programm3r
My Blog: ^_^
|
|
|
|
|
Well the keypress is an event (as is keydown and keyup) so you would need an event handler to handle the event .
As for a global keyboard hook, see my above advice as to how to handle those events .
PS instead of casting to a char you could test the condition by doing
if (e.Keycode == Keys.Enter)
e.Handled = true;
check out the Keys Enumeration[^]
|
|
|
|
|
Thanks for the information. I found this[^], which performs a keyboard hook.
Kind regards,
The only programmers that are better C# programmers, are those who look like this -> |
Programm3r
My Blog: ^_^
|
|
|
|
|
Hi all
i have no idea about run services.i googled a lot but i could not find much of help.
plz help me about:-
1)how to use runonce registry service?
2)can i use it from my c# application?
3)i got to know that i need to create a batch file, can that batch file be destroied after it is being executed?
http://www.catch22.net/tuts/selfdel[^]
i have checked this link from this only i got few ideas
4)can the batch file contain task to be performed on shutdown of the system if so can yo help me with a sample?
5)where to place the batch file and when to execute it from my application?
|
|
|
|
|
1) Maybe this registry key will give you a hint: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce
2) I don't know how you want to use it from your c# application, but "yes" you can launch a c# application via RunOnce.
3) Why do you need to have a self destructing batch file? Maybe you could let some other part of your app delete the file.
4) Don't know.
5) Please provide more info. I have no clue where you could/should/would place your bat file and I'm even more clueless of when to execute it from your app..
|
|
|
|
|
1)HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce how to invoke this? or call this? or execute this key?
2)can we uninstall a setup created for a c# windows application on shutdown of system using RunOnce.
|
|
|
|
|
1) Have you tried placing a string value here with a path to an executable as value..?
2) I believe that the OS checks the RunOnce (and starts the executables) on startup - not on shut down.
|
|
|
|
|
Ajithevn wrote: 1)HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce how to invoke this? or call this? or execute this key?
You don't have a clue what the registry is or how it works, do you?
You cannot "invoke" that key, or "execute" anything in the registry any time you want. All the registry is is a hierarchical database of information. There is nothing "executable" in it at all.
The RunOnce key is just a list of command lines that Windows executes on startup.
Ajithevn wrote: 2)can we uninstall a setup created for a c# windows application on shutdown of system using RunOnce.
Since RunOnce command lines only get execute when Windows starts, no.
|
|
|
|
|
Heh, that's why I steered clear of this one.
|
|
|
|
|
Yeah, but someone has to step in it. Don't worry, I brought a stick to scrape the stuff off my shoes.
|
|
|
|
|
Ajithevn wrote: or execute this key?
How do you know about it ? Because you can't execute a registry key. You obviously have just enough knowledge to be dangerous.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Hi!
I have made 3 forms. Now in first main form1.cs I use textbox from where i get ip and port. Then I added 2 new forms..server and client. When i click on Client-Connect(button on form1.cs) it opens form client and client searches for servers. But i don't know how i would use variable ip and port from form1.cs with form client that it would connect to manually typed ip from textbox?
Thx
|
|
|
|
|
You should buy a basic C# or winforms book and read it. You certainly should not be working on client server code if you don't know how to use variables.
You can create your other forms with a constructor that takes the values, or you can make them properties on those other forms, so the code that creates the child forms, passes the values in.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
With the advent of .NET back in 2002, forms became true objects; they have members and can expose properties. Simply give your form a member variable and/or property and set it before calling Show() or ShowDialog()
MyForm form = new MyForm();
form.IpAddress = IpAddressTextBox.Text;
form.ShowDialog(this);
You could do that in VB6, too, but the form handling was clunkier.
|
|
|
|
|
Hi friends,
I have two 2 Dimensional string array.I want to trim the null values in the array. coz i can't initialize the array length.
like
Function Getarray(string[,] str)
{
}
by default this array has 250 items
even if i pass 12 items.
str[i,4]
here row no should be varied
how can i trim the null values
|
|
|
|
|
Then why use an array? Why not a List?
|
|
|
|
|
I want to hide Header(ie. Displaying the URL of the Page) and Footer(ie. getting page number and the current date and time) while printing a webpage using c#.
Thanks in Advance
modified on Tuesday, October 6, 2009 6:26 AM
|
|
|
|
|
where is your web page???
in your windows application browser??? or
web application browser??? or
any other web browsers??
Rajesh B --> A Poor Workman Blames His Tools <--
|
|
|
|
|
|
The footer is added by IE (the browser), and you cannot change that with any code on the server. You can, however, change the settings in the client-application.
Look under the menu "File", "Page Setup"
I are Troll
|
|
|
|