|
This has been discussed in this forum before. Please click on "Search comments" above and search for something like "screen capture" or "remote screen".
C# - .NET for that matter - is not currently a suitable platform for this low-level operation. Solutions that actively take screenshots are cludgy, slow, and prone to many problems in a point-and-click interface.
The correct solution is low-level: virtual frame buffers. This redirects all GDI and GDI+ drawing to a virtual HDC that is redirected through the wire (often after being compressed).
If you do go with a screenshot approach, at least use intelligent algorithms to determine which areas of a screen have changed and only send those down the wire. Some existing solutions work this way. It's a lot better than sending down entire screenshots continuously because it requires a lot less bandwidth and transfer time and provides a much, much better user experience.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
Hi,
I want to send a simple string (name) to a crystal report for placing in the title of the report. I don't want to use this string in a formula, parameter, boat, or on a train...
I was able to use the code below to get it to work...
Is this the best way to go about this?
//set the Formulas collection to the current report's formula collection
FormulaFieldDefinitions crFormulas = crReport.DataDefinition.FormulaFields;
//set the formula fields in the order they appear on the report.
FormulaFieldDefinition crFormulaTextField1 = crFormulas[0];
//pass in the Field names Chr(34) is double quotes character
crFormulaTextField1.Text = '"'+name+'"';
thanks,
Ron
|
|
|
|
|
Okay, so your program is ending from some other point. You will need to put the write to log code at the point you make the determination that the application is coming to an end. If that is in multiple places then, depending on the way your application is structures, you might consider a central clean up method that you run that cleans up, writes to the log, and performs the necessary exit routines.
Do you want to know more?
Vogon Building and Loan advise that your planet is at risk if you do not keep up repayments on any mortgage secured upon it. Please remember that the force of gravity can go up as well as down.
|
|
|
|
|
Thank for all the help I really appreciate it. Ok so my program ends if the X in the top right corner is clicked is there any way to catch this event??
|
|
|
|
|
Not that I know of, at least in a console application.
Could this be re-written as a Winforms application? You could have a very simple form with just a close button and that event can be caught easily.
Do you want to know more?
Vogon Building and Loan advise that your planet is at risk if you do not keep up repayments on any mortgage secured upon it. Please remember that the force of gravity can go up as well as down.
|
|
|
|
|
Hi,
I've used the following code to get all the section names from an ini file. But whats happening is, am getting only one section name. But the documentation for 'GetPrivateProfileSectionNames' says that that first parameter will contain a "Pointer to a buffer that receives the section names associated with the named file. The buffer is filled with one or more null-terminated strings; the last string is followed by a second null character."
The following is the code that i've used.
//--------------------------------------------------------------------------
StringBuilder temp = new StringBuilder(8192);
int nRetValue = GetPrivateProfileSectionNames(temp, 8192, m_strIniFilePath);
string strSectionNames = temp.ToString();
string[] strArrSectionNames = strSectionNames.Split(null);
//--------------------------------------------------------------------------
Any help would be greatly appreciated.
Thanks and Regards
Vikram Attiganal
|
|
|
|
|
I would imaging that when this is converted in to C# the StringBuilder is reading to the first null and then stops because it thinks it is the end of the string. Strings in C/C++ are null terminated.
What you will need to do is to go through your buffer and find all the nulls yourself and converting it to a string by pointing to the byte after the each null terminator.
Do you want to know more?
Vogon Building and Loan advise that your planet is at risk if you do not keep up repayments on any mortgage secured upon it. Please remember that the force of gravity can go up as well as down.
|
|
|
|
|
You would be "imagining" correctly!
GetPrivateProfileSectionNames (and I assume the original poster is P/Invoking this) fills a string buffer with NULL-delimited strings, with the last string having a second NULL terminator. This is actually pretty common with Win32 APIs when using string buffers with arra-like content (like the GetOpenFileName and GetSaveFileName APIs for the file type filters).
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
Hi
I successfully worked with Remoting Concepts. What my question is, how could we popup message in that remote application. Like Yahoo & MSN Messanger displayes "You have one new mail" then it continues. Like that, My remote server running in separate IP address, if any client that called the method in remote server, then it immediately popups up message like you are called from this person <their name="" or="" ip="">, then continues with the client.
Instead of popups if invoking separate form, it works but i should show the form as ShowDialog instead of show. If it could be showdialog then the client application waits until the form closed from the server. Its a problem for me if no one respond in server place, the client application waits.
I need some sort of solution on this, Thanks in Advance. I don't know this is the right way or we have some other way to intimate to the remote server that they receive some message. I need some possible solutions.
Chandru
|
|
|
|
|
|
|
I used this code for doin the samething...
ifstream(fp);
char buf[200];
fp.open("input.txt", ios::in);
fp.getline(buf,200,'\n');
this code reads first line in the file at a time and stores it into the array buf and increments the pointer to nextline. if u want u can use a condition like fp.EOF (end of file condition) or use a any loop to read line by line...
Hope this helps....
Good Luck
Suman
|
|
|
|
|
This is what we would call C++. You answered on the C# forum...
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
oops!... i am sorry ...yeah it is c++, presently i am workin on both simultaneously....so little bit messed up....anyway i hope we can implement on the same lines using C# headers in c#.
Suman
|
|
|
|
|
System.IO.StreamReader is the class you want. I suspect it has a ReadLine function, the StreamWriter certainly has a WriteLine function.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
This is so far what i have
private void openFileDialog1_FileOk(object sender, CancelEventArgs e)<br />
{<br />
string file = openFileDialog1.FileName;<br />
StreamReader sr = File.OpenText(file);<br />
int j = 0;<br />
char[] tempo;<br />
char tempchar;<br />
while (!sr.EndOfStream)<br />
{<br />
array2[j] = sr.ReadLine();<br />
listBox1.Items.Add(array2[j]);<br />
tempo = sr.ReadLine().ToCharArray();<br />
for (int k = 0; k < 35; k++)<br />
{<br />
tempchar = tempo[k];<br />
array[j, k] = tempchar;<br />
}<br />
j++;<br />
}
|
|
|
|
|
And what happens ?
It seems to me that you'd be better off using a dynamic arraylist than a fixed array.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
it reads and and loads the array into a textbox, it loads two types of arrays but it seems to not load the multidimensional array incorrectly, i want one char in the array, actually int.
|
|
|
|
|
i just had to do that for a project i'm working on. this is what i came up with:
System.IO.StreamReader sReader;<br />
System.Collections.ArrayList textArray;<br />
<br />
sReader = new System.IO.StreamReader(filename);<br />
textArray = new System.Collections.ArrayList();<br />
while(true)<br />
{<br />
string line = sReader.ReadLine();<br />
if(null != line)<br />
textArray.Add(line);<br />
else<br />
break;<br />
}<br />
--
There are 10 kinds of people. Those who understand binary and those who don't.
|
|
|
|
|
|
Doh!!
|
|
|
|
|
|
does one exist? i thought i remember seeing one somewhere...
would this be difficult to do yourself?
|
|
|
|
|
Yeah.. it exists and I am pretty much sure of it seeing somewhere over this forum. I think it is not that much difficult to do, but i am not having code to show. Try searching on this forum using "listview combobox", i am sure u can find some useful articles on it.
Good Luck.
Suman
|
|
|
|
|
Yes, it's very difficult to do if you're using the ListView defined in the BCL. That encapsulates the Windows Common Controls List-View. Drawing iconic headers and colored cells isn't too hard, but siting other controls requires quit a bit of work.
There are third-party controls, however, that do this. They are more analogous to the DataGrid , but provide all the functionality of both plus more. Infragistics[^] and Developer Express[^] are just a couple of the third-party component developers that have such controls.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles] [My Blog]
|
|
|
|