|
I've got a couple of kinda dumb questions. What can you expect from someboy whose learning?
1) What is MFC and what do you do with it?
2) While typing code my cursor line goes from a skinny line to a fat blinking rectangle. It also overwrites any previous written code. How do I get back to the skinny line and stop the overwriting?
I figure I may have accidently hit something I shouldn't have. Although I haven't any idea what it was.
Thanks.
|
|
|
|
|
JMOdom wrote: 1) What is MFC and what do you do with it?
Dont you have a book on that topic. I dont want to be rude but you need to read a good basic book about MFC.
JMOdom wrote: 2) While typing code my cursor line goes from a skinny line to a fat blinking rectangle. It also overwrites any previous written code. How do I get back to the skinny line and stop the overwriting?
And even that on windows. BTW find the "Insert" key and press it to toggle the overwrite or insert functionality you are talking about.
"A good programmer is someone who looks both ways before crossing a one-way street." -- Doug Linder
coolestCoder
|
|
|
|
|
well thats ok, not to worry
below are the answers to your questions
1) MFC is Microsoft Foundation Classes. They are a set of classes developed by Microsoft and given to application developers to expedite development. Kind of framework where you do not need to do all the basic stuff, just use the class objects provided in MFC.
2) You must have hit "Insert" on your keyboard just press it once more and it'll be ok. Its toggle button.
Learning is a never ending process of Life.
|
|
|
|
|
Learning is a never ending process of Life.
That's one statement I can't argue with. I expect that the last thing I learn in this life is what it is like to die. (Morbid, Huh?)
|
|
|
|
|
JMOdom wrote: 1) What is MFC and what do you do with it?
Microsoft Foundation Classes.
Back in the 90s, Microsoft wrote a C++ library that wraps the low-level C Windows API.
As far as your second question, coolestCoder answered it. Yeah, that Insert key can be annoying when you accidently hit it.
|
|
|
|
|
MFC is a very good framework to create Windows applications in C++. If you use C# it is completely useless. For study purposes it may be very interesting to read Jeff Prososes book Programming Windows95 with MFC. It gives you a very bright introduction in many concepts that are useful.
If you intend to use c#, you should focus on .NET Unfortunately .NET is so huge that it takes a lot of time to find your way. Don't get frighted by that, because programming is great fun.;)
|
|
|
|
|
Thanks for the answers folks. I'm just now trying to learn C# 2005 at the local junior college. I took a year of Visual Basic 2003 last year there.(They hadn't upgraded to VB2005 at that time.) After I get done with my classes I might try to see about learning C++. If I can manage all that, then I should have a good foundation on computer languages.
I'm also working on AutoLisp to enhance my drafting work. As you can see I've set myself a rather full schedule.
Well thanks again.
|
|
|
|
|
I read some codes, where the conditional statements or rather to say, statements that are not likely to throw exceptions are tried to write out of the try catch blocks. Only statements which can potentially throw exceptions are included in the try catch block.
I want to know why these "other statements" are written out of the try catch blocks ? does exception handling incurs performance / speed loss ? If yes how much loss can be incurred in an enterprise application where we need to catch each and every exception ? Can this (performance loss) be assessed in some way ?
"A good programmer is someone who looks both ways before crossing a one-way street." -- Doug Linder
coolestCoder
|
|
|
|
|
It should be easy right? I want a textbox that looks like the one above where I typed my subject. Are these panels? Or how can you get this look with a textbox?
thanks!! I love this place!
|
|
|
|
|
What do you mean by recessed?
dd314159 wrote: I want a textbox that looks like the one above where I typed my subject.
Theres nothing special that i've noticed , its just a regular textbox!?
In the VS toolbox you have TextBox , the Multiline property by default is false, that what makes the textbox have only one line. If you set it to true then it allows many lines like the textbox where you type you Text while posting something.
A screenshot with hightlights on what your referring to would be great
What version of .NET are you using , and are you talking about windows applications or web applications?
Gideon
|
|
|
|
|
Hi Thanks for the reply. I reread my question and I can see that it was confusing.
What I'm asking is how to get an "inset" textbox - so that it looks like it is below the surface of the windows form - as opposed to appearing flat or appearing raised like a button.
Hope I've expressed my question in an understandable way now. If not I'll send a screen shot.
I'm running .NET 2.0 and I guess I'd like to be able to have inset textboxes on windows forms as well as web forms.
Thanks!
|
|
|
|
|
um well the textbox i'm typing in right now is flat , even the subject box is.
http://gidsfiles.googlepages.com/textbx_flat.jpg[^]
The only styles availiable if visual styles are enabled are in the textBox.Border style properties.
but you could try not calling Application.EnableVisualStyles(); This will get everything to the old win98 style , so everything else has the style.
Gideon
|
|
|
|
|
I am working on a web application project. I am using c# as my programming language and an oracle 10g database.
I am in a situation where I need to read a large text file and Insert it in to an Oracle database.
I have used steamreader and the Oracle's odp.net and was able to successfully insert the text into a table.
Can one of you seasoned developres show me how to do the samething using Microsoft data provider(System.Data.Oracleclient name space)and if possible the streamreader. I appreciate your help.
|
|
|
|
|
I am working on an application that maintains an open connection to an sql database. I also have a timer that checks to see if the connection has closed and if so, it tries to re-opens the connection. This is working fine at the moment as my application and the database are running on the same computer. However this application will eventually run on a different computer to where the database will be. What I would like to know is if for some reason the connection from the computer running the application and the computer with the database were to become disconnected, would my application view this as the connection being closed?
|
|
|
|
|
Darkness84 wrote: I am working on an application that maintains an open connection to an sql database
First of all, I would like to know the conditions under which you need an open connection to the database (always) ?
I think you can open the connection just at the time of your query execution. what is the problem in this kind of scenario ?
Persisting database connections will load your database server. I dont think that this is desirable.
"A good programmer is someone who looks both ways before crossing a one-way street." -- Doug Linder
coolestCoder
|
|
|
|
|
I am using SqlDependency so that my application will respond immediately to changes in the database and thus i need the connection to be open.
|
|
|
|
|
Hi,
I dont know much about the SqlDependency, here[^] is an article on CP, which specifies (at the last) that the connection need not be open to recieve change event. Will this solve your problem ?
"A good programmer is someone who looks both ways before crossing a one-way street." -- Doug Linder
coolestCoder
|
|
|
|
|
Not sure, but I'll have a read. Thanks.
|
|
|
|
|
Hi All,
I am an Student and learning C#. my work is to write a class for calculating the number which is prime number and w ehave to call that method in a main program to display the output.
And i have to get the number from the user end using the Console.ReadLine().
No array declaration only using the for loop or the if else condition loop.
please help me in coding for calculating the Prime Number.
Awaiting your response ASAP.
Regards,
Chitra
|
|
|
|
|
You want us to do your homework for you? Seriously?
|
|
|
|
|
|
Thanks Guyz,
I have tried it as this but the problem is i have to put all the methods in a another class progam such as PrimeNumClass.cs and i have to call that in the main program to display the output.
here is my code:
<br />
namespace PrimeNumber<br />
{<br />
class Program<br />
{<br />
static void Main(string[] args)<br />
{<br />
int n = 2;<br />
int totalPrimeNumbers = 0;<br />
int x;<br />
double sumOfPrimes = 0;<br />
<br />
while (n <= 100)<br />
{<br />
bool isPrime = true;<br />
<br />
for (x = 2; x < n; x++)<br />
{<br />
if ((n % x) == 0)<br />
{<br />
isPrime = false;<br />
break;<br />
}<br />
}<br />
<br />
if (isPrime == true)<br />
{<br />
Console.WriteLine(n + " is a prime Number.");<br />
<br />
sumOfPrimes = sumOfPrimes + n;<br />
totalPrimeNumbers++;<br />
}<br />
n++;<br />
}<br />
<br />
<br />
}<br />
}<br />
}<br />
Here everything is in Main Program itself. But i want it all in a seperate class Nmaed PrimeNumClass.cs and i have to call that class in the main Class to display the output.
please help me. itz very urgnet.
regards,
Chitra
|
|
|
|
|
chitra4sat wrote: Here everything is in Main Program itself. But i want it all in a seperate class Nmaed PrimeNumClass.cs and i have to call that class in the main Class to display the output.
Creating a new class is easy. Just right click on your project and click on Add then Class from the pop menu. Fill in the text box with the name of your of your class, in this case, PrimeNumClass.
The IDE will create a source file for you that looks like this:
using System;
using System.Collections.Generic;
using System.Text;
namespace PrimeNumber
{
class PrimeNumClass
{
}
}
Now, once you get to this point, you need to add a method to the class that contains your prime number algorithm. In this case, it would probably be best to make the method static. Also, make sure that it has public access so that it can be called from your Main function.
I'm going to leave it here and let you take over. If you have any problems, feel free to ask.
|
|
|
|
|
Hi Thanks,
I have created it as you said the PrimeNumClass as you have mentioned .
but what are all the things have to be inside that class and let me know it by code.
becoz i have the output in the main program and all the funcctions are carried out there. but i have been asked that in the main program there should not be anything but we have to create the object and w ehave to call that method to display the output of the prime number.
so please help me what to do ?
|
|
|
|
|
chitra4sat wrote: but what are all the things have to be inside that class and let me know it by code.
becoz i have the output in the main program and all the funcctions are carried out there. but i have been asked that in the main program there should not be anything but we have to create the object and w ehave to call that method to display the output of the prime number.
You need to add a method to your PrimeNumClass. For example, in your Program class, you have a method named Main. When you run your console application, the application invokes your Main method.
So add a method to your PrimeNumClass. You need to give your method a name, return type, and specify its access. In addition you need to decide if your method takes any arguments. For example, below is a class with no methods:
namespace ClassDemo
{
public class MyClass
{
}
}
Now, let's add a method to it that doesn't return anything and takes no arguments:
namespace ClassDemo
{
public class MyClass
{
public void SayHello()
{
Console.WriteLine("Hello!");
}
}
}
The class now has a method called SayHello. If I want to use this class, I can create an instance of it and invoke the SayHello method:
MyClass mc = new MyClass();
mc.SayHello();
Based on what I've shown you here, add a method to your PrimeNumClass. Then put the code you have in your Main method into this method.
|
|
|
|