|
just change you app to be a console app...
Project, Properties, Common Properties, General, "Output Type" = Console Appliation.
You will need to create main as per a console app, and the will have to show the main form...
"When the only tool you have is a hammer, a sore thumb you will have."
|
|
|
|
|
I am C# Student and I have an application that I am developing that I need to get a string value from a text box in the child form into the parent form where I am converting it to an int to use in a random number generation. I have not been able to get any help or find the solution anywhere, so any help would be great. Please only give me C# code as I have never programmed anything but this. Thank you for your time.
Thanks,
Brad
"If you fell sad about your life, just go to the mall"
|
|
|
|
|
hi,
how can TcpClient detect other side closed the connection?
i want to check when the server close connection and i can start process received data afterward.
any help?
regards,
jim
|
|
|
|
|
I'm redesigning the way our application saves and restores sessions. Presently it's serializing using SOAPFormatter, and that's not so good. Most importantly, it's not backwards or forwards compatible. So I want to use XML so that the format is forwards-compatible, and future versions of the application are backwards-compatible with older formats.
Does anyone have any tips regarding this? Any good techniques or interfaces to use? XmlDocument vs. XmlWriter/XmlReader?
Since some of my data involves Rectangle and Point objects, for instance, and Color objects, too, etc., is there a good way to handle that data without having to handle them specially and write extra code for that?
XmlSerializer even seems tantalizing because it might be quick and easy, but I'm afraid that it will be too tied to the internal data representation or class/package structures.
Thanks!
|
|
|
|
|
Hmm, maybe Reflection will somehow help me with the System classes.
|
|
|
|
|
Do most people use databinding with winforms or
do they use a homegrown solution. My experience with
databinding has been problematic at best. I've ran into
numerous problems with anything other then a simple form.
These problems range from programmatically setting a value
in a text box, and the databinding ignoring it, to strange
problems with nulls. I guess I'm stuck in my ways but I
prefer the old ddx, ddv validation of atl and mfc. Although
I am willing to change
I'm also curious about ado versus ado.net.
Is a In memory database really needed? When and were
would the decision between the two be made.
Also does anyone know of any orm tools for c++ and classic ado.
I dont want to cross post to two boards so I am hopeing this is the
correct place. I apologize if they are not.
Thank you
|
|
|
|
|
Data binding is a done in a new way in C#. I think the best thing to do is research and find out. I love .NET databinding. Its very flexible and powerful.
Same story with ASP.net it has been totaly redon based on the .net framework. It runs a lot fast (some people say up to 3 times faster) and is way more powerful and flexible.
About orm tools im not sure.
|
|
|
|
|
Hiya
What exactly is the get and set used for?? I have looked in a number of books but still don't understand what they are for..
Thanks.
|
|
|
|
|
look for accessors
(Properties in VB)
Free your mind...
|
|
|
|
|
The quick and easy is as follows. If you want to control assignment of values to an object you use a private/public variable system. The object accesses the data via the private variable and the public variable is how other objects interact with the object.
Example:
private string username = "";
public string Username
{
get
{
return username;
}
set
{
if !(socket.Connected) username = value;
}
}
This only allows another object to change the username of the object when "socket.Connected" is false. If you didn't use public/private with get/set you would not be able to control the value assignment and other objects would always be able to change the value and set it to whatever they want.
|
|
|
|
|
Does anyone know why PageScale doesn't work while double buffering?
Gary Kirkham
A working Program is one that has only unobserved bugs
I thought I wanted a career, turns out I just wanted paychecks
|
|
|
|
|
Hi,
My app runs a DOS program as a process. Most of the time, given the right command line arguments, the DOS process runs by itself without needing any user intervention, but there is a certain situation that can arise where it expects the user to respond "y" or "n" to a question. Is there any way to detect that the process is waiting for this user input?
Thanks
|
|
|
|
|
Is it really a DOS program, or is it a Win32 console-mode program?
There are probably only two cases:
1) You need to be parsing the output of the program in order to decide whether to respond with a 'y' or an 'n'. In that case, you should be reading the program's standard output and you will see when the question appears.
2) You don't care are are always going to give the same answer. In this case, just go ahead and stuff a 'y' or 'n' into the standard input and it will be buffered for the application to read.
The less likely options where you might need something more complicated involve the application intentionally flushing buffers and such, but don't go there until you've considered the options above.
--
-Blake (com/bcdev/blake)
|
|
|
|
|
Blake Coverett wrote:
1) You need to be parsing the output of the program in order to decide whether to respond with a 'y' or an 'n'. In that case, you should be reading the program's standard output and you will see when the question appears.
Well, that's want I'm doing at the moment, but I was wondering if there was a more flexible and fool-proof way of doing things. Right now I'm comparing strings coming out of the stdout (actually, it's the stderr) to a string I know will appear if it decides to ask this question. Then my program will pop up a yes/no message box and, depending on the users response, sends either a 'y' or 'n' to the stdin. The problem is, what if that string changes in the DOS program I'm running (I didn't write it), and what if there are other situations that might need a users response (again, I didn't write it).
|
|
|
|
|
The question of "what if there are other situations that might need a users response" is exactly why you should stick to parsing the output. At least then, if the output doesn't parse you'll know you have an unexpected situation and can abort. If you just assume the first time it stops for input it is asking that y/n question you might end up stuffing a 'y' into a completely different question by mistake.
--
-Blake (com/bcdev/blake)
|
|
|
|
|
True, but only if exactly the same line that I'm using to catch the question I expect to see occurs again, but in a different context (and, in fact, there are two different lines I try to catch, so both lines would have to appear to trick my code). Otherwise, it'll just hang up waiting user input that never comes, although the stderr is sent to a window so the user ought to be able to see that something abnormal has happen and can click on the cancel button. I guess I'll just have to settle for that. I guess I could set a timer and if there is nothing on the stdout or the stderr for some period of time, I could warn the user and give them the option of sending something to the stdin. The problem with that is that the program I'm running can pause and seemingly do nothing for several seconds even in normal operation.
|
|
|
|
|
Hello All,
I am developing an application that should communicate with a COM component. The COM component is developed in VC++.
The COM component is successfully created after
Activator.CreateInstance(..) call, but getting destroyed immediately.
Can you help me out in solving this issue.
Thanks in advance.
Mahesh
|
|
|
|
|
If the variable that the return value of Activator.CreateInstance falls out of scope, the COM object will be (eventually, sometimes sooner) disposed (cleaned-up). Have you set the return value to a field in a class to keep a reference of it?
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Thanks for your response.
I have assigned the return value(object) to a member variable of the class.
Still the instance is getting closed immediately.
|
|
|
|
|
Why don't you import the tlb? (tlbimp.exe)
If your C# app has the [STAThread] attribute in its entry point, make sure to have an appropriate COM object (registry lookup under the InprocServer32 or LocalServer32 key, ThreadingModel value).
A few suggestions : change the attribute to [MTAThread] (read the docs), create a new thread and create the COM instance from there.
Otherwise, if you can't afford a simple tlbimp, then I suggest to have a c proxy that would start the com object for you.
RSS feed
|
|
|
|
|
Hi,
How can I extend an array like int[] or create a dynamic length's int[]? For example:
int[] a = new int[10];<br />
<br />
for ( int i = 0; i < 10; i ++ ) {<br />
a[i] = i;<br />
}
Now I want a to be int[11] and a[10] = 10, how can I do it?
Thanks.
|
|
|
|
|
|
|
I was able to add the Microsoft Web Browser control in Visual Studio .NET 2003, but alot of the properties are in grey so I can't point url to the control, please tell me exact how I can add a url to the Microsoft Web Browser control I added on my C# windows form application, what code I write? I'm total noob, I only know how to use the IDE but I don't know the C# language syntax, please help X_x;;
http://www.hentaitheme.com
Free Public Ragnarok Online Game Server
|
|
|
|
|
Hi .. just add the Web Browser Control to you application, then use
object flags = 0;
object targetFrame = String.Empty;
object postData = String.Empty;
object headers = String.Empty;
this.axWebBrowser1.Navigate("http://www.ebay.com/", ref flags, ref targetFrame, ref postData, ref headers);
But if you want more informations there are some WebBrowser Source Codes here on Codeproject! That you are a beginner is no problem, but learning is to understanding If you want to program such things you have to learn c#
Greets
Matthias
|
|
|
|