|
You can position a control anywhere you like by setting it's Left, Top, Width and Height properties.
In this case, it seems to me that it's another form that is opening.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hi,
I'm writing a simple Rdp client in C#. In the Remote Desktop connection provided with windows, we can redirect the winkey, and other hot keys such as alt+tab. So I know its possible but I've been unable to do so. Reading on MSDN i thought the following will work -
private void Form1_Load(object sender, EventArgs e)<br />
{<br />
userControl11.axMsRdpClient1.Server = "testserver";
userControl11.axMsRdpClient1.Connect();<br />
userControl11.axMsRdpClient1.AdvancedSettings2.EnableWindowsKey = 0;<br />
userControl11.axMsRdpClient1.AdvancedSettings2.HotKeyCtrlEsc = 0x23;<br />
}
but it doesn't seem to work.SO every time i hit the windows key, its the local windows menu that pops up. I want the remote computer's windows to do so. Same with the alt+tab and other escape sequences Anybody knows how to do this?
Rahul
|
|
|
|
|
I guess the Windows key works in Full Screen mode right? However, you still can not use CTRL+ALT+DEL. You have to use 'Windows Security' menu from Start -> Settings.
|
|
|
|
|
Nope there is an option which lets u allow redirect these keys even in the window mode. Yeah, ctrl+atl+del is SAS.. so i don't redirect that...agreed. But the rest can be redirected. Just try it on the rdp thing provided with windows.
|
|
|
|
|
can anyone give details about httphandlers and httpmodules.
please tell where can we use this and what r the fundamentals of httphandlers and
httpmodules.
hello every one
|
|
|
|
|
Hi..
i want to convert string[] to byte[].suppose i have two .jpg file,first i have convert .jpg file to string[] by using Regx expression in c#. now i want to convert string[] to byte[]. but it overlapping the byte[].just i want string[] to append the
byte[]..
|
|
|
|
|
abdulsamad.shaik wrote: first i have convert .jpg file to string[] by using Regx expression in c#.
Sounds very dubious to me....
abdulsamad.shaik wrote: now i want to convert string[] to byte[]. but it overlapping the byte[].just i want string[] to append the
byte[]..
This sounds like a real mess. Do you want the file in jpg format as a byte array, or the actual image data ?
System.IO.File.ReadAllBytes will give you the former, my image processing articles will show you how to do the latter.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
abdulsamad.shaik wrote: i have convert .jpg file to string[] by using Regx expression in c#.
Just what are you trying to do?
Cheers,
Vıkram.
Déjà moo - The feeling that you've seen this bull before.
Join the CP group at NationStates. Password: byalmightybob
|
|
|
|
|
This all sounds pretty strange. I think that you have to explain what it is that you are trying to accomplish really.
abdulsamad.shaik wrote: i want to convert string[] to byte[].
That part is easy, using the Encoding classes.
suppose i have two .jpg file,first i have convert .jpg file to string[] by using Regx expression in c#.
No you haven't, as that is not possible. An image file is a binary file, and regular expressions work with string data. If you read the binary file as if it was text, you will lose a lot of data.
just i want string[] to append the byte[]
You can't change the size of an array, so you have to create a new array that has room for both arrays, and copy the data into it.
---
single minded; short sighted; long gone;
|
|
|
|
|
hi there...
This is regarding reading events from event log viewer of windows.
I am working on an application which prints the event log entries on the console.
Basically I am NOT directly connecting to event-viewer. Rather I am provided with a dll, which is reading events from eventviewer and sending the instance id to my application.
I could manage to get the event-id from instance id.(with the help of hexadecimal code 3FFFFFFF)
But the problem is that
I need to get the instance id from event id...
We know that instance id is combination of eventid and some 16 bits(with 2 bits on) before it.
But if somebody can tell me on what basis the value of first two bits is set, we can find the instance id from event id - I hope
As far as, I realised is that... if the event is information we get the bits 01.
but the values keep on varying when it comes with warning or error.
(can someone help me out, to find the Instanceid from event id...)
Thanks
Rahul
|
|
|
|
|
Hi... Sorry for my english...
I have this code...
<br />
<br />
public void Connect()<br />
{<br />
NpgsqlConnection cnxPg = new NpgsqlConnection("Connection string...");<br />
cnxPg.Open();<br />
}<br />
<br />
public void pgSelect(string strQry)<br />
{<br />
if(cnxPg.State.ToString() == "Open")
{<br />
NpgsqlCommand npgComm = new NpgsCommand(strQry);<br />
}<br />
}<br />
Ok... firs that all... that doesn't works
Then i want to do something like this...
<br />
public void pgRow()<br />
{<br />
}<br />
How can i return the connection to use it in other functions? How can i return the query results to uset it in other functions too?...
Did you understand me?... my english it's not so good, so i did my best...
Please help me
Thank you all
|
|
|
|
|
Spiderk wrote: NpgsqlConnection cnxPg
This is a local variable, it needs to be a member variable.
Spiderk wrote: that doesn't works
Your error is obvious enough that I worked it out, but in future, posting your error message is a lot more helpful than 'that doesn't works'
Spiderk wrote: How can i return the connection to use it in other functions?
Make it a member, or make it a lazy initialised property, so the property recognises if the connection is null, and creates it, then returns it.
Spiderk wrote: How can i return the query results to uset it in other functions too?...
By setting a return type other than void. For example, an array of entity objects, or a DataSet or DataTable.
It seems to me that you're stumbling on some entry level stuff, have you been using C# for long ? It looks to me like you need to work through some basics before you worry about databases or forms.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Christian Graus wrote: Spiderk wrote:
that doesn't works
Your error is obvious enough that I worked it out, but in future, posting your error message is a lot more helpful than 'that doesn't works'
Ok ok... don't be mad XD...
Christian Graus wrote: Spiderk wrote:
How can i return the connection to use it in other functions?
Make it a member, or make it a lazy initialised property, so the property recognises if the connection is null, and creates it, then returns it.
How can i do that??...
Christian Graus wrote: By setting a return type other than void. For example, an array of entity objects, or a DataSet or DataTable.
Ok... thanks... i will investigate it that later...
Christian Graus wrote: It seems to me that you're stumbling on some entry level stuff, have you been using C# for long ? It looks to me like you need to work through some basics before you worry about databases or forms.
Actually, i don't have too much time with c#... but i want to learn about connecting this...
Be more patient man... i'm not perfect ...
Thanks anyway for your answer and for waste your time in my question
See ya...
|
|
|
|
|
Spiderk wrote: Ok ok... don't be mad XD...
I'm not mad, I'm just trying to point out how your comments don't actually provide all the info you could give to help us help you.
Spiderk wrote: How can i do that??...
private string _s = null;
public string S
{
get
{
if ( s == null)
{
_s = "This string is lazy initialised";
}
return _s;
}
}
That's a lazy initialised property.
Spiderk wrote: Be more patient man... i'm not perfect
I'm just trying to help, but it seems to me that you're a little out of your depth, hence my advice.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hello, today I needed to rename a folder and it would not let me do it. The error message said that file may be locked by a process. So I rebooted,thinking it would kill the process, and then tried to rename the folder and it still failed . So then I went to ProcessExplorer and search the output from 100 of the running processes that had the keyword Java in it.
This was very time consuming . I want to write a utility that would search through process tables and look for the process that has a lock on the specified file or folder.
Problem is that I have no idea where to start. I don't know how to read all of the process tables. I don't know what to check in the process table to determine what it has locked and how to kill the lock, if I wanted to. What is the structure of the process table? Do I need special permissions to access it?
I would be very appreciative if someone could help me!
|
|
|
|
|
|
if i have a multi-threaded client server(lets consider 1 server and many clients).and i have to run a .exe file on my server. and i want each of the user threads which contains data to go to the .exe file which will run with these inputs and then reply the output back to the client through the server.
Is this possible??
I really Appreciate ur help
|
|
|
|
|
Sounds like you want a web service on the server, perhaps ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
As Christian said possibly a web service, or .NET Remoting if the clients are all on the same network. Another form would be a Windows Communication Foundation if your up to it.
only two letters away from being an asset
|
|
|
|
|
While playing around with a Black Jack program, I got wondering about the best way to do a decision matrix in C#.
What I am thinking of is basically a 2 dimensional matrix with each row/col combination containing a value representing 1 of a number of different options (e.g. Hit, Stand, Double, Split, etc).
Is a 2 dimensional array the best way to implement it, or is there a better method?
Any opinions?
David Wilkes
|
|
|
|
|
amatbrewer wrote: While playing around with a Black Jack program, I got wondering about the best way to do a decision matrix in C#.
What I am thinking of is basically a 2 dimensional matrix with each row/col combination containing a value representing 1 of a number of different options (e.g. Hit, Stand, Double, Split, etc).
Is a 2 dimensional array the best way to implement it, or is there a better method?
That seems pretty elegant to me, but what you're proposing is only good for evaluating the 1st move of the hand. If one axis represents what the dealer is showing, and the other axis represents what you have showing, it's a very fast lookup of what to do.
After the first move, you either need to code a more traditional if {} else {} type code construct, or have another decision matrix, since you don't have options like splitting and doubling-down available to you after the first decision...
The pure decision matrix approach scores higher for me than the if {} else {} construct for your purpose because:
1) Once the array is initialized, evaluating decisions is very, very fast
2) If you structure your code properly, your intentions are perfectly clear. You cannot mess up the logic.
Pseudo-code:
enum Action {
Hit = 0,
Stand = 1,
DD = 2,
Split = 3
}
private static Action[][] _decision = new Action[][]
{ new Action[] */ 2 */ { Hit, Hit, Stand, DD, Hit, ... },
new Action[] { Hit, Hit, Stand, Hit, DD, ... },
.
.
.
new Action[] { Stand, Stand, Stand, Stand, ...}
}
private static Action Decision(Int32 dealerShow, Int32 meShow) {
return _decision[meShow - 2][dealerShow - 2];
}
Share and enjoy.
Sean
|
|
|
|
|
Thanks for the reply!
Blackjack got me thinking about it, but I can think of a number of projects (current and proposed) that this could be useful for.
I appreciate your example; it is much more elegant then what I was originally thinking of. Not sure I understand the syntax of “Action[][] _decision” and “private static Action Decision(Int32 dealerShow, Int32 meShow)” but it gives me something to research.
Thanks again!
David Wilkes
|
|
|
|
|
|
I have an application that creates Word documents. I can create and close any number of documents while in the application. But when a document is created in my application and another is created outside of the application, exiting both leave the instance of Word running the task manager.
After some investigation, I noticed that launching Word creates a new instance and obviously an associated PID value shows up in the Task Manager. Launching Word again just adds another handle to the initial Word process, not another instance to the Task Manager; thus the PID has two handles to Word documents.
When you exit one of Word documents, the handle remains (OpusApp?) and is enabled but not visible. Still two handles, but one is visible and the other is not. When the last Word instance is exited, everything is cleaned up, all handles of Word are release, and the process is removed from the process manager.
My problem is this:
I create a word document in my application (new PID)
I go outside the my application and launch Word (i.e. Start Menus->Word)
I now have one entry in the Task Manager (from my application) and the second Word document is attached to it with a new handle.
I close the second Word document, the document closes, but the handle remains enabled, but not visible.
When I close the document I created, Word remains in the Task Manager because I’m checking (application.documents.count) to see if there are anymore instances of word documents out there and there is because this handle is still hanging around in the instance I create even though its not active.
Is there a better way of doing this? Or checking that documents are visible?
Am I just way off base?
Thanks,
Eric
|
|
|
|
|
I had same problem before.
This is what I have to do to close the document and application so the instance won't be in task manager. I am not so sure how you are closing your document.
I close word document programmatically thought.
public void CloseMSWord()
{
msWord.DisplayAlerts = Word.WdAlertLevel.wdAlertsNone;
msDoc.Saved = true;
msDoc.Close(ref msfalse, ref optional, ref optional);
msWord.DisplayAlerts = Word.WdAlertLevel.wdAlertsNone;
msWord.Quit(ref optional,ref optional,ref optional);
msWord = null;
}
Sinc I'm only using word applicatino one at a time, I make sure the Word process is not running in task manager by using following code.
public void KillProcessByName(string processorName)
{
try
{
System.Diagnostics.Process[] p = System.Diagnostics.Process.GetProcessesByName(processorName);
for(int i=0 ;i
|
|
|
|
|