Friday, July 31, 2009

Need Help With C++!!!?

Ok so this is basically what i need.





i need a list control.


there should be 3 columns, in 1 column comboboxes, and in the others there should be just static text.





so it basically should be like the image shown here: http://www.codejock.com/public/assets/im...


except there should be comboboxes instead of checkboxes





heres some details of my project:





* Using Visual Studio 2005


* This is a MFC application





Can anyone help me please? This should be a really simple task but i cant seem to do it. ive seen like 100s of apps having the same thing i need.





plz, anyone help!!

Need Help With C++!!!?
Does not look easy. May be you can contact a C++ expert at websites like http://askexpert.info/ to help you code it.


Need help fixing my C++ program.?

I need help getting my program to compile.





...


void rotate(Point%26amp; p, double angle)


{


double new_x = (((p.get_x()*cos(angle))


+(p.get_y()*sin(angle))));


double new_y = (((-(p.get_x())*sin(angle))


+(p.get_y()*cos(angle))));


double dx = new_x- p.get_x();


double dy = new_y- p.get_y();


p.move(dx,dy);


}


...


int main()


{





cout%26lt;%26lt; "The original point p (5,5) rotated 5 times by 10 degrees then scaled 5 times by .95 is:""\n";


Point p(5,5);


double angle = 10;


double scale = .95;


int rotation_count = 0;


int scale_count = 0;








while (rotation_count%26lt;5)


{


rotate(p, angle);





cout%26lt;%26lt; "The point is now " %26lt;%26lt; p.get_x %26lt;%26lt; "," %26lt;%26lt; p.get_x %26lt;%26lt; "\n";


rotation_count++;


}


...


This is the error I recieve


Error 1 error C3867: 'Point::get_x': function call missing argument list; use '%26amp;Point::get_x' to create a pointer to member d:\my documents\visual studio 2005\projects\a3q2\a3q2\assgn3q2.cpp 52





line 52 : cout%26lt;%26lt; "The point is now " %26lt;%26lt; p.get_x %26lt;%26lt; "," %26lt;%26lt; p.get_x %26lt;%26lt; "\n"

Need help fixing my C++ program.?
you forgot the parenthesis on the method calls:





line 52 : cout%26lt;%26lt; "The point is now " %26lt;%26lt; p.get_x %26lt;%26lt; "," %26lt;%26lt; p.get_x %26lt;%26lt; "\n"





should be:





line 52 : cout%26lt;%26lt; "The point is now " %26lt;%26lt; p.get_x() %26lt;%26lt; "," %26lt;%26lt; p.get_x() %26lt;%26lt; "\n"





-devon


C++: What's the easiest way to put the filenames of a directory in an array?

I'm using a Microsoft Visual Studio 2005 MFC application.





I would like go through a directory, reading file names. If the file name (not including extension, of course) is three letters long, I would like to put that filename into an array, and then move on to the next file to test whether it belongs in the array, until I've reached the end of the directory. What is the easiest way to do this? Should I use a CFileFind, or is there a more efficient method?





Specific examples would be appreciated. Also, please keep in mind that this is an MFC application: NOT a console application.





Thanks!

C++: What's the easiest way to put the filenames of a directory in an array?
Doesn't matter if console or not, you still can use console techniques, just need to modify to fit your instance.


for the cout, replace that with your array, I would recommend a dynamic array or better yet use a vector class so you don't have to worry about allocation





CFileFind finder;


BOOL bWorking = finder.FindFile("*.*");


while (bWorking)


{


bWorking = finder.FindNextFile();


cout %26lt;%26lt; (LPCTSTR) finder.GetFileName() %26lt;%26lt; endl;


}
Reply:Ugh...Truthfully, I'd recommend that you program Windows with the Windows API instead of using the stupid Microsoft MFC or Borland VCL frameworks because they both produce incredibly bloated, slow code. They also don't teach you how to really program the operating system since they are bloated, slow wrappers which EVENTUALLY calls the Windows API functions. Anyways...





The 1st thing that comes to mind is the size of your array. Normally, you would have to write code so that the allocated memory block or array for the file names is large enough for a good number of file names (this can waste memory), or you have to write code that will dynamically allocate another block of memory when your 1st buffer gets full. Something to keep in mind...





As far as getting the file names, do something like this:


1) Call CFileFind::FindNextFile(). Set a flag if it returns 0 (last file in directory).


http://msdn2.microsoft.com/en-us/library...





2) Call CFileFind::GetFileName().


http://msdn2.microsoft.com/en-us/library...





3) In a loop, read the file name and copy it to array/memory block if necessary.





4) If the flag wasn't set, go back to step 1.

flowers uk

How to make C++ with a for loop and a 2d array?

Does anyone have the source code behind doing something like that i am wondering how to do it and if i can see a code to help myself learn it that would help alot thx. im using microsoft visual studios 2005

How to make C++ with a for loop and a 2d array?
Use nested loops.





for(int i = 0; i %26lt; numRows; i++){


for(int j = 0; j %26lt; numColumns; j++){


do something to array[i][j];


}


}





This will access every element in the array going from top to bottom and then left to right.


A question about C#?

In Visual Studio 2005, the main() method (the program entry point) always resides in a file called "Program.cs." I want to change my program entry point to another file, how do I do this in VS 2005?

A question about C#?
Right-click on the Project and go to Properties.





On the Application tab, you'll see a drop-down list labeled "Startup Object". You can select any class in your project that has a static Main() method from that drop-down.


C++ help! when i build the solution and try to test it,....?

the output disappear without letting me check if it's right or not. how can i make it to stay? i am usin microsoft visual studio 2005.





this is my code:





#include %26lt;iostream%26gt;


#include %26lt;iomanip%26gt;





using std::cout;


using std::cin;


using std::endl;


using std::fixed;


using std::setprecision;





int main()


{


//declare variables


int registrants = 0;


int fee = 0;





//enter input


cout %26lt;%26lt; "Enter number of registrants: ";


cin %26gt;%26gt; registrants;





//calculate and display order price





cout %26lt;%26lt; fixed %26lt;%26lt; setprecision(2);





if (registrants %26gt; 0)


{


if (registrants %26gt; 1 %26amp;%26amp; registrants %26lt;= 4)


cout %26lt;%26lt; "Seminar Fee: $" %26lt;%26lt; registrants * 100 %26lt;%26lt; endl;


else if (registrants %26gt;= 5 %26amp;%26amp; registrants %26lt;= 10)


cout %26lt;%26lt; "Seminar Fee: $" %26lt;%26lt; registrants * 80 %26lt;%26lt; endl;


else if (registrants %26gt; 11)


cout %26lt;%26lt; "Seminar Fee: $" %26lt;%26lt; registrants * 60 %26lt;%26lt; endl;


//endifs


}


else


cout %26lt;%26lt; "Invalid Data" %26lt;%26lt;endl;


return 0;


} //end of main function

C++ help! when i build the solution and try to test it,....?
The common solutions seem to be using getch() or system("pause") in the correct place to hold the terminal window open while you examine the output.





If you are not just a Windows drone, a more portable solution is to include and call a function something like the below at the proper point(s) in your program.





// A simple debugging routine to use with DOS console apps to hold the DOS box open


void HoldConsole(void)


{


char hold[3];





cout %26lt;%26lt; "\nHit %26lt;Enter%26gt; ";


cin.getline(hold, sizeof(hold), '\n');


cout %26lt;%26lt; endl;


}
Reply:Put in some wait-for-keyboard-input code to pause the execution.





Hope that helps.
Reply:insert the statement





getch();





one line before return 0; ... and don't forget to include the library conio.h


Exception when I run a program developed with C# .net 2.0?

I used visual studio 2005 to developed an application. it was working well. recenty i used "Computerinfo" class of "Microsoft.VisualBasic.Devices" namespace. for which I had to add a visual basic dll as reference. But my problem is when I run the program from Visual Studio 2005 IDE It works fine. but after publishing It throws an exception with 'detail', 'quit' and 'continue' button.





************** Exception Text **************


System.Management.ManagementException: Provider load failure


at System.Management.ManagementException.Th... errorCode)


at System.Management.ManagementObjectCollec...


at System.Management.ManagementObjectCollec...


at Microsoft.VisualBasic.Devices.ComputerIn...


at Microsoft.VisualBasic.Devices.ComputerIn...


at MountUp.MainUI.MainUI_Load(Object sender, EventArgs e)


at System.Windows.Forms.Form.OnLoad(.....

Exception when I run a program developed with C# .net 2.0?
I recall reading somewhere that not all of the "My" objects available to VB function properly in C#. Since most of the objects provided through the "My" keyword are available to C# through other means, it's probably better in the long run to spend a little more time to write the code for that directly. You didn't say exactly what property you were trying to access when the exception occurred, but from what I can see that's available through the ComputerInfo class you'll probably have to resort to pinvoke to get most of that info.

hamper

Error : Not all paths return a value?

Hello,





when I write web method using C# in Visual basic 2005,


I can't return the string value to the client request.


I got such kind of error Not all code paths return a value.


Don't know how to cope that problem.





My code is as follow.





Thanks in advance

















=================Code==============


using System;


using System.Web;


using System.Web.Services;


using System.Web.Services.Protocols;





[WebService(Namespace = "http://www.tp.edu.sg/")]


[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]


public class CountryLanguage : System.Web.Services.WebService


{


public CountryLanguage()


{





//Uncomment the following line if using designed components


//InitializeComponent();


}





[WebMethod(Description = "Return official language of particular country.")]


public string OfficialLanguage(string country)


{


string l = "Singapore"; string r = "English";


//if(l.CompareTo(country)==0)


int res = String.Compare(country,l);


if (res == 0)


{


return r;


}


}

Error : Not all paths return a value?
If (res == 0) test fails, you don't specify a return value. Need to do something like:





if (res == 0)


return r;


else


return .... some value ...
Reply:The simplest thing you can do is insert this line before the closing mark "}" of your method:





return String.Empty;





or





return null;





Good luck!
Reply:hey You have to return some value when res!=0 also





if(res==0)


{


return r;


}


else


{


return somethingelse;


}
Reply:the function OfficialLaunguage is supposed to return a string.


It only returns a string if res == 0.


Rescue Pets Online HELP!!!?

when ever i try to register it gives me this ....








Server Error in '/' Application.


--------------------------------------...





Index was outside the bounds of the array.


Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.





Exception Details: System.IndexOutOfRangeException: Index was outside the bounds of the array.





Source Error:





An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.





Stack Trace:








[IndexOutOfRangeException: Index was outside the bounds of the array.]


System.Data.RecordManager.NewRecordBase(... +1694516


System.Data.DataTable.NewRecord(Int32 sourceRecord) +21


System.Data.DataRow.BeginEditInternal() +82


System.Data.DataRow.set_Item(DataColumn column, Object value) +138


RegistrationAndLogin.DataSets.CountriesR... value) in C:\Visual Studio 2005\epets\RegistrationAndLogin\DataSets...


ChildRegistration.OnLoad(EventArgs e) +1879


System.Web.UI.Control.LoadRecursive() +47


System.Web.UI.Page.ProcessRequestMain(Bo... includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1061














--------------------------------------...


Version Information: Microsoft .NET Framework Version:2.0.50727.832; ASP.NET Version:2.0.50727.832

Rescue Pets Online HELP!!!?
to be frankly honest, im not fluent in computer language, but sometimes websites run into stupid problems, so your best bet is to try agian later. If theres any more problems, call a service provider, or the company.


Be-bratz.com help!?

I was trying to get on to be-bratz.com to register. i bought the doll and plugged the usb key in. System.Data.RecordManager.NewRecordBase(... +1694516


System.Data.DataTable.NewRecord(Int32 sourceRecord) +21


System.Data.DataRow.BeginEditInternal() +82


System.Data.DataRow.set_Item(DataColumn column, Object value) +138


RegistrationAndLogin.DataSets.CountriesR... value) in C:\Visual Studio 2005\be-bratz\RegistrationAndLogin\DataS...


ChildRegistration.OnLoad(EventArgs e) +2489


System.Web.UI.Control.LoadRecursive() +47


System.Web.UI.Page.ProcessRequestMain(Bo... includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1061


that popped up and i cant get on. PLZ HELP!!

Be-bratz.com help!?
hey,i have issues too.well i called technical support.they said that there is very high traffic on their website right now.they are working on the problem.they told me to try early morning or late at night.they also said to try maybe after january the 3rd since kids will be back in school.also if you have windows vista like i do,it wont work on it at all.i have to go to someone else's house to try to get mine to work,bummer.but i would suggest trying to wait.they told me also that once you are able to register,you wont have any problems after that.it is just everyone trying to register at one time.hope i helped!
Reply:I just got off the phone with Tech support, they are having issues with their server and hope to have it fixed in a few hours, it ruined my daughters Christmas :(
Reply:my was doing that a lot but just now it started to work so if your on do it right now. I thought it was wierd cuz i had anthor thing hooked up to the other usb port and when i put that in it worked.





theres a solution.
Reply:its happening to my daughter doll too, im piss. I don't even think they have a tech number
Reply:i have the same exact problem " it was a x-mas gift"
Reply:I have the same problem. I e-mailed the co. My daughter is very upset. She got it for Christmas. I will let you know if they help me.
Reply:I have windows xp and I bought this for my daughter for christmas as one of her main gifts. She is a bratz fanatic and she was looking forward to getting online with her doll. She already gets on the regular bratz site and they have all this amazing stuff that you can do if you get the be-bratz, needless to say we haven't been able to do any of it, and at this point I am very frustrated and tired of making excuses to my daughter for something that my hard earned bucks paid for. My thing is how do you sell millions of these things and don't prepare your systems for the major ovehaul. I think that the bratz have earned enough money to have the best darn website ever. I said that I was going to call MGA, the makers of bratz to see what the deal is. If anyone else have another number can you please give it out because I am all out of places to go.
Reply:idk y but that happend to my sister i tried mine and it worked fine so im not sure wat to do


Using ASP.Net Ajax drag and drop?

i want to create a simple easy drag and drop using Ajax in Visual Studio 2005 in C# i've already created the site in ASP.NET not ASP.NET enabled website will this be a problem?

Using ASP.Net Ajax drag and drop?
With regrads to your question of Ajax drag, drop, it depends on what you are trying to do with the drag drop. Drag Draop can be done with basic javascripting and you might not require ajax (unless you need to communicate server side)





I have put a link to a article that discusses on AJAX drag drop with .NET





You cannot run the .NET code unless the site has .NET enabled on it. It depends on the type of web server hosted. If it is not a microsoft IIS server, it may not be able to host a .NET code. I would clarify with the provider if they host .NET and then decide whether to move to a different provider or write in a language that they support.





Hope that helps...
Reply:This is not a matter of what type of project you started. The functionality/behaviour which you described should not be implemented in AJAX. This would simply be a bad choice.





You should consider implementing dragging and dropping behaviour using JavaScript.
Reply:Yes.





the asp will only run on microsoft brand server (iis). Not Apache. Consider making a version in PHP or Perl!

bloom

How much space should I dedicate to Windows XP?

I have Macbook and currently dual-booting Mac OS and Ubuntu. I want to add windows to this as well. How much space should I dedicate to it.





If I want bare XP Sp2, Microsoft office 2007 Ultimate and Visual Studio Express 2005 C++, C#. Plus bits and pieces?

How much space should I dedicate to Windows XP?
from my personal experience, twenty gigs is plenty, you will get all your updates and have plenty of room for you programs as well,


i personally use minimum of 50 gigs partition for windows xp.


i have big hard drives, i do this on all of my pcs, and then use bigger partitions for different files, i have one for music only . one for videos only and one for pictures and i have changed the drive letters to correspond ie drive V for video , drive M for music, and drive P for pictures , and drive D for documents





but this is the way i do it, you do not have to follow my way, but just use about 20 gigs for xp





this is the link to a group i use you are welcome to join





http://uk.groups.yahoo.com/group/arc_pc_...
Reply:why bother, youre already using linux, get a different release. i use linspire xp2007, and run windows applications in a VM shell.
Reply:I'm not sure about how much space Visual Studio will take, but I think about 10 Gb will do fine. Add another Gb for each 512 Mb of RAM you have in your computer, so you'll have room for the swapfile.
Reply:10gb
Reply:seven is plenty
Reply:If you can manage 10 GB would be sufficient but i would like to know why you want 3 OS on a single machine is it really necessary ?


Do I have to include .net framework in a setup file in c#?

hello all:


I developed a windows application using c#, and then created the setup file for the application, whennever i install it on a target machine that doesn't have visualstudio installed on it, it asks for a .net framework download before completing the installation, I'm using visual studio.net 2005, and i read that it includes the .net framewrok by default and we don't have to add it.. does anybody knows what's the problem??


thank u

Do I have to include .net framework in a setup file in c#?
Just a guess, but sounds to me like you're not putting this into the setup.cfg file parameters to look for and install Net.frame work on the target machine if it doesn't already have it installed.


Just a guess of course...


Does anyone know of any free programming tutorials suitable for a behavioral psychologist?

I'm looking for something for the Visual Basic, J#, C#, or C++ 2005 Express Editions. In your opinion, which language would be easiest for someone who only knows HTML to learn quickly (like, within a couple of months)?





I want to do research on effective programming of ancillary study materials for textbooks and with a very tight budget I can't afford to pay someone to write all the code I'm going to need.





Thank you!

Does anyone know of any free programming tutorials suitable for a behavioral psychologist?
If you want to become very productive, you need to have a suitable foundation. Here is the MIT beginning computer science course book:





http://mitpress.mit.edu/sicp/





You can get the entire book for free as HTML and also the Scheme interpreter that is used for the examples. If you give some requirements of your project I might be able to recommend a specific language. An example of a requirement might be:





"I need to write a program that will accept a set of files as input. Each file contains the study materials for a text book. The program should print out the number of times the word 'ancillary' occurs in each file."
Reply:Try to pick up a scripting language. BASIC is a good starting point. Even C++ without GUI is easy to learn. pick up a good book, the basics you can master in couple of weeks.


I know C. Which should my next step for GUI, VBasic or VC++?

I'm expert in C and want to learn GUI based programming


I've got a copy of MS Visual Studio.NET 2005





WHICH LANGUAGE VBasic or VC++ is better for me ???


Remember I've no experience of C++, only of C.

I know C. Which should my next step for GUI, VBasic or VC++?
Common sense dictates that you leverage the C skill-set that you have—while it is still fresh in your mind—and next familiarize yourself with an object-oriented member of the C family, i.e., C++. However, you did specify that your next goal is learn how to design Windows user interfaces.





In any event, you must learn object-oriented programming techniques. I recommend that you ignore Visual C++. The more popular languages are C++, C# and Visual Basic.





Visual Basic is the most popular visual programming language on the planet. Generally speaking, many people find Visual Basic is easier to learn than C++ or C#. Visual Basic provides programmers with an intuitive and powerful way to create Windows GUIs with ease.





I recommend that you learn VB thoroughly. In addition, you should familiarize yourself with C++/C# concepts and applications—just in case you want to be well-rounded. Note that practically anything that you can do in the C# or Visual Basic language can be done in the other: They are both part of the .NET Framework.
Reply:Definitely C++ --- its easy if you know C already.
Reply:c++

dogwood

I know C. Which should my next step for GUI, VBasic or VC++?

I'm expert in C and want to learn GUI based programming


I've got a copy of MS Visual Studio.NET 2005





WHICH LANGUAGE VBasic or VC++ is better for me ???


Remember I've no experience of C++, only of C.

I know C. Which should my next step for GUI, VBasic or VC++?
I would go with visual basic, its pretty easy to learn and there are tons of examples and source out for it.





BTW - vb is not dead, I know ALOT more ppl that use it than c or c++. Notice how microsoft is not really updating c too much, they are pushing visual studio and vb.net (based off off vb).
Reply:If you know C, learn Java or C++. I think .NET language is different from C.
Reply:C++ is a small step from C - it makes C cleaner.





VB is dead.


How can I download and install SP2 for Windows XP.?

I have installed Microsoft Visual C++ 6.0. When I wanted to install MSDN Library for Visual Stdio 2005, I see this message : It requared Win XP Pack 2. A person say me to download and install SP2 for Windows XP. If this answer is correct? If yes, how can I download or buy and install SP2 for Windows XP?


Thanks a lot.

How can I download and install SP2 for Windows XP.?
if you have windows xp go to http://www.microsoft.com/windowsxp/sp2/d... to update to service pack 2


Visual Basic Books?

I took a class in high school on Visual Basic .NET 2005 and i really liked it. We ended on the loops chapter and i want to teach myself further. What is the best book to help me teach myself. We used in class the Visual Basic book by Shelly Cashman ISBN 0619254823. (this book is really expensive but if i need to buy it b/c its the best one i will) is there any other good ones you guys kno? thanks

Visual Basic Books?
Why buy when you can look online





http://msdn2.microsoft.com/en-us/vbasic/...


www.programmingtutorials.com


www.programmersheaven.com


www.thecodeproject.com





just google visual basic tutorials
Reply:Learn online. Get helpfrom forums





http://www.itgalary.com


Is there any hope to convert the VB i coded in MS Excel to C# .NET?

Please help me... I am not good in C# but I am (no so) expert in Visual basic... what is the easiest thing to do?? I need an application that uses C# (express ed 2005). I like C# becasue of its features... i am using only VB6 that is added with ms excel lib ref.

Is there any hope to convert the VB i coded in MS Excel to C# .NET?
As you already know VBA and VB.NET are quite a bit different, but at least they are closer than VBA and C#. You can use an online convertor that converts VB.NET code in C#.NET code. This will look pretty rough if you put the raw VBA code into the convertor.





My suggestion is to convert the VBA code to C#.NET using the online convertor, then add a Reference to the Excel library in .NET, and finally change all of the Excel objects to their respective .NET compatible types (ex. Range -%26gt; Excel.Range).





The online convertor is linked below.
Reply:The short answer is "yes". All the things you want to do in VBA (Visual basic for applications) can be done in .Net.





If you used VB, its even easier, and you might want to consider using VB.net.

redbud

How to select query according to User Input for a WebPage in C#.Net with SQL Server 2000?

I am trying to build a web page in C#.NET with SQL Server 2000 using Visual Web Developer 2005. I want to select and execute the query according to user input.





I have a form which has 2 textboxes which gets start date and end date from the user. Based on start/end date my 1st query runs. Now if user does not enter any start/end date I want to run another query which takes default dates as current date as end date and current date - 30 days as starting dates.





How to select query ?





I will be greatful if one can reply.

How to select query according to User Input for a WebPage in C#.Net with SQL Server 2000?
How do you need the results to display?


Including header files in the subdirectories?

Hi,





I am using Microsoft Visual C++ Express edition 2005 for writing a program. I needed an xml parsing library and i chose to use the Xerces libraries. The problem is that the header files are located in my D:\Program Files\Microsoft Visual Studio 8\VC\include\xercesc directory. the search path for the include files includes the path till D:\Program Files\Microsoft Visual Studio 8\VC\include so the compiler doesnt search within the xercesc directory and i am getting file not found error when i use #include%26lt;xercesc\utils\Platformutils.hpp... How to make the compiler search within the subdirectories of the included paths???


Also is the statement


#include%26lt;xercesc\utils\Platformutils.h...


correct??

Including header files in the subdirectories?
Use within double quotes ... dontuse %26lt;





include "dirname/filename.h"


How do you create a comma delimited file in C#?

I've found that comma delimited files are very useful in C++, but I'm now working in C# and have no idea how to open and write to a .csv file in this language.





Help!





Specific examples would be appreciated. I'm working in Microsoft Visual Studio 2005.

How do you create a comma delimited file in C#?
Here's basif File IO:


http://support.microsoft.com/default.asp...





You can always split the string you read in on the comma delimeter into an array:





string[] lineItems = fileLine.split(',');


RightTriangle function for C++?

The book I am consulting is Gary Bronson, C++ for Engineers and Scientists, Second Edition, Course Technology, 2006, ISBN 0-534-99380-X





I’m using Microsoft Visual Studios 2005 .


So here is what I’m attempting to do:


1. Write a function rightTriangle that accepts two double arguments (the two sides of a right triangle a, and b) and returns one double value (the length of the hypotenuse). The function prototype should be defined in file student.h and the function itself should be written in file student.cpp.


2. Write a program in Main.cpp that reads the two sides from a file, uses the function rightTriangle to calculate the hypotenuse length, and writes all three values to an output file.


3. Execute the program using the following triangle side input.


First Side (a) Second Side (b)


3 4


5 12


12 16


2.8 4.5








The problem is that I cannot get the function to strip values from my inFile. It says that inFile is an undeclared indentifier in my function

RightTriangle function for C++?
are you declaring that you are using a file? usually you have to use the file package


#include %26lt;fstream%26gt; in the beginning. then you need to declare your files...





ifstream inputfile.open("input.txt");


ofstream outputfile. open("output.txt");





that should fix your input problem

sundew

How can i create games using C# and 3d application like maya?How can i combine those two?

I want to create 3d games like Half-life2 and Sim City.I know creating game is very hard work.I am just 17 years old and i am learning C#.I also want to buy some sort of 3d application to create character and model and some animatjon,too.But i don't know how to combine the character created with maya with codes i wrote in visual studio.any ideas?What application i should use to create games like quake4.I know Quake 4 is created by many professional but i am alone.I bought Visual Studio 2005,Maya 8.5,Poser 7 and 3dstudio max 9.I know it is wasting money but i have strong will to create industrian standatd games.Can you help me to find some tutorials and some free e-books like "beginning directx 9".

How can i create games using C# and 3d application like maya?How can i combine those two?
blender 3d has a built in game engine and its free. but it uses python for scripting though.
Reply:I can't help you with free, but check out Amazon and you'll find a book called "Game Programming for Teens" which may fit the bill. They have demo software packages that will help.


A question about c++ and opengl?

I have learned c++ basics but i think i need to know what is a buffer so:


1.I need someone to explain to me what a buffer is and when we use it.


2.I want to start using opengl but i know nothing about it..... I use visual studio 2005 .... Is there anything i need to download before i start using opengl through visual studio?.... I need to


know how to open a new project and how to add the the libraries i need....


Is it a an advanced level to start making programs that have simple graphics... you know, like using buttons instead of writing commands and so on?


After you help me with the previous things, can you recommend a good tutorial to help me understand opengl... if not, is there a book instead of a tutorial?





NOTE: I use visual studio not visual basic.... Online tutorials helps you create opengl projects in visual basic!!


THANKS IN ADVANCE!!!

A question about c++ and opengl?
This looks like a good step-by-step tutorial for using OpenGL with visual studio 2005. http://www.cse.msu.edu/~cse872/tutorial1...





A "buffer" is a reserved segment of memory. For example, simply declaring a C++ array allocates a buffer. There are also different types of buffer classes that do different things. Some applications have sophisticated ways of using buffers to optimize performance. You'll need to be more specific in the type of information you're seeking about buffer.


Learning C++?

I'd like to learn how to code native Windows applications using C++. Can anyone recommend a website that will teach me?





I'm using Visual Studio 2005 (I know VB already), but I don't want the final applications to be dependent on the user having the .net framework installed.





What, in simple terms, do MFC and ATL mean? I've gathered that they are some kind of library, but do they need installing on users' computers separately?





Thanks








BTW I do have some basic C++ knowledge regarding command line applications

Learning C++?
MFC is a C++ class library which encapsulates the Windows API. ATL is the advanced template library, it contains stuff for COM programming and GUI programming (i think).





If you want to write native Windows applications, you find a lot of articles on codeguru.com. Also, there's a book by Microsoft Press, written by Charles Petzold, which is a kind of a reference.





The Windows API is a C API. So either you use C functions in C++, or you have to use a C++ wrapper like MFC or WxWidgets or QT.
Reply:MFC was sort of the pre-cursor to .Net. It's not quite as useful to .Net, but if you use that API you get a more organized object oriented layer on top of the Windows API. MFC is standard with Windows, so if you target that API you won't have any dependencies that Windows users won't already have installed.





ATL is just the abstract template library, it's also pretty standard and all Windows installations should have it.
Reply:codeproject .com wud be best for ya





then try gcc compiler





MFC-microsoft foundation classes


atl activex template library


partially yes
Reply:man u doing some crazy work, but i can tell u to have encarter 07 installed, thru web companion and see if that helps.


VB 2005 learning guide?

i want to learn programming specially visual basic 2005. but let me tell you first thing is i dont know anything about programming. almost new for programming world, is it possible to learn programming for a person who dont have a single knowledge of any kind of programming. and my aim is to learn vb 2005, few people told me that u must have good command over VB 6 or c or c++ to learn programming under .net environment.


can someone suggest me what to do weather to start learn programming or to leave idea behind.


i am confused, i dont know from where to start ?

VB 2005 learning guide?
in my opinion rather than wasting time in other language, you can directly start with .net but start from scratch and learn everything in order. do not jump from ist to middle level. it might take time to understand and using logic. first just start with basic things like designing form using toolbox controls. using msgbox/inputbox etc.





after gaining cmmand over basic things then move to databse programming i.e. ADO





good luck
Reply:I think that to start from VB is not a good idea..





If you want to learn the .NET environment, start from the c# (it's an ISO language).. and without use of winform .. but only from OOP arguments.. exercise, and also learning on network, web services, ado.net ...

baby breath

C2664 C++ error?

new to C++ language and I've been trying to learn a little about windows programming, here's the code I have so far





[code]


#include "windows.h"





int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,


LPSTR lpCmdLine, int nShowCmd)





{


MessageBox(NULL, "All your base are belong to us!",


"Hello World", MB_OK | MB_ICONEXCLAMATION);


}


[/code]





and the compile error I get:


------ Build started: Project: Window, Configuration: Debug Win32 ------


Compiling...


Window.cpp


c:\documents and settings\john tripi\my documents\visual studio 2005\projects\brand new\my calculator\window\window\window.cpp(8) : error C2664: 'MessageBoxW' : cannot convert parameter 2 from 'const char [32]' to 'LPCWSTR'


Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast


Build log was saved at "file://c:\Documents and Settings\John Tripi\My Documents\Visual Studio 2005\Projects\Brand New\My Calculator\Window\Window\Debug\BuildLog....


Window - 1

C2664 C++ error?
Ah, yes, I see the problem. The newest Visual Studio prefers unicode strings, which use 16 bits per character, as opposed to the classic strings which used 8. When unicode is defined, it uses MessageBoxW (W is for wide character), normally it would use MessageBoxA. The solution is to make your string literals into wide character strings by prefixing them with L:





MessageBox(NULL, L"All your base are belong to us!",


L"Hello World", MB_OK | MB_ICONEXCLAMATION);


Borland C++ 3.1 moves very slow on Windows XP?

Borland C++ 3.1 moves very slow on Windows XP Service Pack 2. ntvdm.exe (Windows NT DOS Virtual Machine) takes the CPU to ~99%.





What should I do?


(Don't suggest me to use other IDEs. I use Microsoft Visual Studio 2005 too, but I need to test something on Borland C++ 3.1)

Borland C++ 3.1 moves very slow on Windows XP?
install a copy of nt4 and dual boot.

yucca

Any good tutorials or help on C#? Please?

I recently got Microsoft Visual Studio 2005 and I want to begin and experiment in C#. I've read through a few tutorials on the program, but it doesn't really help alot...





Can anyone please refer me to a good tutorial for BEGINNERS..hehe. I really want to be good at C#.





Thanks,


CK

Any good tutorials or help on C#? Please?
MSDN site:





http://msdn2.microsoft.com/en-us/vcsharp...





Outside Online software tutorial site:





http://www.vtc.com/
Reply:if you have no background on programming, then be careful with c#.. ;)


you can use MSDN as your first and last resource for learning c#, and if you can buy this book : "Developing windows bases applications using microsoft visual basic.net and microsoft visual c#.net" it would be a great help...


and if you changed your mind to move to VB.NET than i might be able to help you more ;)


You should help me by checking the below Details.......?

Hi,





At present I'm using Professional Windows XP Operating System(service pack 4) and I've OPC Clientx Software version of 1.5.0.4 demo version. I need to run one Cobble tufting machine automation project by using the above requirement in Microsoft Visual studio 2005 (C# ,windows Application) environment. But when I started to run the application the following errors are occuring....





OPC Clientx version 1.5.0.39,runtime version v1.0.3705 this is the software version I needed that I think. Could you pls check the below errors and send the details of appropriate OPC clientx software demo version.





Check the below Errors


Error 24 Exception occurred creating type 'Infragistics.Win.UltraWinGrid.UltraDrop... Infragistics2.Win.UltraWinGrid.v5.3, Version=5.3.20053.73, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb' System.ComponentModel.LicenseException: Unable to locate license assembly. C:\Documents and Settings\raviv\Desktop\cobble\Cobble 1.2 Sour

You should help me by checking the below Details.......?
whats xp service pack 4??? service pack 3 has not been released yet.





and by the error id say there was a problem locating a valid license


How can I build a PC Remote Control device from scratch and write software for that using .Net 2005?any ebook?

I need to make my own Remote control device using IR sensors and write my own software for that using Visual Studio .Net 2005.


I know .Net and C# languages very well but do not know how to start building my own hardware for the remote control and program it using Visual Studio .Net 2005, though I know it can be done using VS.Net 2005 Compact Framework. Is there ary e-books or books that I can buy, which will guide me through the process of building my own hardware for the Remote Control Device and e-books / books to buy which wil guide me through writing the software for the remote control device using Visual Studio .Net tools?? Please suggest

How can I build a PC Remote Control device from scratch and write software for that using .Net 2005?any ebook?
Please provide additional detail: Do you wish to control the PC remotely, or do you wish to use your PC to perform remote control of other systems? Similarly, with respect to you infra-red sensors, are these sensors providing input to the PC, responding to IR signals from the PC, or both.





You can get RS-232C equipped universal smart IR remote controls, or check the June 1993 issue of "Electronics Now" (since merged with Popular Electronics) for my circuit to interface a PC's parallel port to the existing matrix keyboard of an off-the-shelf IR smart remote. Programming details will depend on what you are trying to implement.





If you want to build your own receiver section from scratch, you'll need an IR diode tuned to 880Nm, a pulse-stretcher, and then a demodulator (typicall 40KHz carrier for consumer-stlye IR signals). I would suggest managing this with an on-board processor, such as a PIC. Use the sourcecode from the PIC programmer itself as the basis for a terminal program, or check out the source code libraries available publicly for code you can incorporate, then interface through the serial port (I used to use the classic Maxim Max-232 chip to simplify the multi-voltage power supply demands of RS-232c interfacing; you might find an easier way via USB -- I'm a bit out of date on this end of hardware hacking.





The Parallel port is still around, is typically a Bitronics EPP-style port these days (so you'll have at least 8 i/o lines instead of 8 out and 5 returns) but isn't as easy to program as it was in the days of DOS -- at least if you want real performance. Under current Windows, you'll get best performance by coding a device driver, since the O/S owns and abstracts all the hardware ports anymore -- peeks and pokes were the easy way to fiddle bits at the hardware level in my day; now a lot of it still works, but its abstracted or emulated, unless you create a device driver. There used to be a pretty good parallel port bare-bones device driver code example that came with the Windows DDK -- device driver kit, but that was many versions ago; check the Microsoft site to find out what's current.





Good luck to you!





-jb


Should I learn C Sharp?

I am a trader who programs to get by, I am not a programmer by trade. I am very familiar with Visual Basic Version 6 and VBA. I have just installed Visual Studio 2005. Should I start leaning and coding in C# instead or should I stick to VB.NET? I need a good reason why for 10 points.

Should I learn C Sharp?
Well you have a background in VB6, it means that you are familiar with VB Syntax, signatures and many language constructs. I suggest that you should stick to VB.NET because its better to continue syntax that you already know rather than learning entirely new thing C#.NET.





Moreover, VB.NET have the same powers that C# has, even simpler than C#, while having same support from Microsoft that C# does enjoy.





Saif Ullah





http://www.kasamba.com/Saif-Ullah
Reply:for me, coming from a vb 6 background, trying to learn vb.net was a disaster. learning C# however, was cake walk. The syntax is much simpler in C# than vb.net as vb.net is annoyingly wordy.





C# may look a little different, but its easier in my opionion that vb.net.





a sample:


Private Function Foo() As Integer


Dim myVar As Integer


'some comment


Foo = 1 'i'm not even sure if thats right.. lol


End Function





is this in C#


private int Foo()


{


int MyVar;


//some comment


return 1;


}








once you get the basic sructure of C# down (took me a day of messing with it) your good to go. It might take you a little bit to get a hang of, but learning C# in my opinion is a much better idea

chrysanthemum

Is there a way to specifiy which line to insert text in a text file using C#?

I need to be able to specify a line to insert text on in a text file. I'm using Microsoft Visual Studio 2005 and writing my program in C#.





Thanks.

Is there a way to specifiy which line to insert text in a text file using C#?
One way you can do it is to read the whole file into a string, split the string based on the carriage return into N number of strings one for each line, then use InsertAt function on the ArrayList to insert your line.





To write the output, you'll need to use a StreamWriter with WriteLine for each item in the ArrayList.





The following link explains in details how to do this, along with the C# code to do it:





http://www.mycsharpcorner.com/Post.aspx?...





Hope this help you out.





For more C# tips go to http://www.mycsharpcorner.com


What are examples of output statements for arrays and pointers in C++?

I am trying to learn pointers and arrays for C++ class. I am using MS Visual Studio 2005. I can initialize, I can set it. But I can't get it to print to the screen. Any beginner help is welcomed!

What are examples of output statements for arrays and pointers in C++?
You had not said whether you want to print address your pointer points to or data placed at this address.





In plain C:


...


int n = 0;


int *p = %26amp;n;


printf( "At address %p we have value %d\n", p, *p );
Reply:#include %26lt;iostream%26gt;


using namespace std;





int main()


{


int arr[5] : {1,5,3,9,4};





cout %26lt;%26lt; arr[4]; //should print "9"


return 0;


}
Reply:use a for loop


like for(int i=0;i%26lt; 100;i++)


cout %26lt;%26lt; a[i] %26lt;%26lt; endl;


Need help with threading C++!?

I'm very new to this so it would be great if someone can give me a simple example about how to create a thread and stop it. I am using Visual Studio 2005 on XP. Programming language is C++.





I created a class called "Token". This object has attributes and methods. However, I want "Token" to be created as a thread and terminated as a thread. So basically "Token" will behave like a thread.





Thank you :)

Need help with threading C++!?
Here is a start. I hope this helps you out. Threading is not only language but platform specific. The link below covers threading from a windows perspective.


Visual Studio - Can I get more pages for my code?

I have Visual Studio (2005 %26amp; 2008), and I program in C#. When I create a program, it often gets really long. Is there any way to put some of my functions that I no longer need to edit in a different page, then link to the page, to save space. It gets really frustrating scrolling down 1000s of lines.


Thanks in advance.

Visual Studio - Can I get more pages for my code?
a) Group similar functions in classes or modules





b) Use multiple files for your classes with the "multiple class" feature





http://www.devx.com/dotnet/Article/22603





Your functions shouldn't exceed about 50 lines each, just to keep them from being too complex. Imagine going away for about a year and coming back and trying to read your own long, long, long code - you'll lose your mind, I promise!





good luck.

daffodil

Can't get string into a text field.?

Now i think i've converted my int to a string.


But i can't tell because i can't find a way to output it to the screen.


Nor can i figure out how to see what value is being stored in a variable while debugging in MS Visual C++ Express 2005.





I tried putting as the text on a label.


Create::lbMicSkillsPoints-%26gt;Text = convertedString;


doesnt work, nor does a textbox.





I get an error that says cant convert parameter 1 from std::string to System::string.

Can't get string into a text field.?
could you... get it to output the value to a file? or printer? maybe as the value changes make it pause or play a sound.


How i can issue command line (e.g running ms-dos program) in C++ programmig environment?

i want to execute ms-dos program in c++ code. how?


(i uses Visual studio 2005 - VC++)

How i can issue command line (e.g running ms-dos program) in C++ programmig environment?
With GCC compiler (used by Dev-++) you can write:





system("cls");
Reply:Try looking under "spawn" or "exec" in help - one of these should lead you in the right direction.


How to delete data in gridview in asp.net (c#)?

I have a gridview and also a delete button outside the gridview. It is because i want to have a function that delete the data of the checked checkbox inside the gridview by pressing the delete button.





So how i gonna delete the data by pressing the delete button? Please show me the coding, i using ms visual studio 2005, asp.net 2.0 (c#).





Thank you...

How to delete data in gridview in asp.net (c#)?
Is this a windows app or web app? Are you hooking into a database? If so I suggest deleting the item from the database and rebinding the data to the grid.


Whats included in Visual Studio?

What is the difference? The description of VS 2005 on MSDN just says that it includes tools for creating Windows applications. Well, in what language? I know Visual C, Visual C++, Visual C# etc are all IDEs for that language. Is Visual Studio like a collection of all of those IDEs in one program?

hyacinth

Making Internet Connection using Auto Dial up Using .net C#?

Hi,





I want to create dialup network and/or auto connect to internet from within my application.





If there is not already created dial up network then i need to create new one. If there is no modem installed, make warnings.





I need to do all these on Visual Studio 2005/2003 desktop application using c#.











I have done so many R%26amp;D's on it, but unable to achieve what exactly i want.





I tried InternetDial method of wininet.dll to connect internet but It opens the default dial up dialog and i need to connect manually. But i want it to be connected automatically without clicking to connect within windows dial up.


I tried to use InternetAutoDial but it didn't get success.











I tried IO.Port class in VS 2005 and tried to pass AT commands, some response i got from modem but unable to connect.





Could you please tell me whether i m in right way or not?


I am i need proper sources of guide like books or your help or any sample code etc.





Thank you

Making Internet Connection using Auto Dial up Using .net C#?
In NET 2.0 in the System.IO.Ports is support for serial connections over modems.





You may be able to say something like





private SerialPort port = new SerialPort("COM2", 38400, Parity.None, 8, StopBits.One);





Look on MSDN forms for a sample.
Reply:hi mohan have to got solution for your query if so can you give some info on how to make a network dialer using .net2.0.It should have to run on windows vista also along with all other Windows OS. Report It

Reply:Hi Mohan,have to got solution for your query if so can you give some info on how to make a network dialer using .net2.0.It should have to run on windows vista also along with all other Windows OS. Report It



Can anyone recommend a Code Review tool for C# ?

I am looking for a Code Review tool for C# that





1. Integrates with Visual Studio 2005


2. Allows you to easily add custom rules


3. Doesnt cost a mint !





The main need for this tool is to ensure that our developers adhere to our Microsoft Coding Standards and our own specific set of standards.





So far I have come across:





* FxCop - only works on assemblies and is difficult to customise


* Code Analysis for Visual Studio Team Edition - too expensive


* SSW Code Auditor - trial version seems buggy





The following site is the best I have found for simialr tools but none really meet the criteria:





http://sharptoolbox.com/categories/code-...





Any help would be greatly appreciated.





Seamus

Can anyone recommend a Code Review tool for C# ?
pinkworld.com


desipapa.com


worldsex.com


etc
Reply:I really did not Know


Good & free C++ program...?

I need to find a good and free C++ Program. I have Microsoft Visual Basic 2005 Express Edition, and I want to find a program that writes C++. Please help!

Good %26amp; free C++ program...?
I dont know if this will help but try these sites listed...








http://gcc.gnu.org/





http://www.goosee.com/x86/index.html
Reply:i hope this helps





Free C++ from scratch Free PDF Ebook





http://www.ebooknetworking.com Report It

Reply:GCC


C++ programming question?

I was doing this program on Visual Studio 2005 where the program converts C to F and vise versa but after debugging it, it doesnt give the expected result. Could someone tell me what is wrong with my code???








#include %26lt;iostream%26gt;


#include %26lt;iomanip%26gt;





using namespace::std;


using std::fixed;





int main()


{


int conversionType = 0;


double temp = 0.0;


double result = 0.0;





cout %26lt;%26lt; "Enter -1 (F to C) or 2 (C to F): ";


cin %26gt;%26gt; conversionType;


cout %26lt;%26lt; "Enter temperature: ";


cin %26gt;%26gt; temp;





if (conversionType == '-1')


{


result = (temp - 32) * 5 / 9 ;


}


else if (conversionType == '2')


{


result = temp * 9/5 + 32;





} //end if





cout %26lt;%26lt; "Result: " %26lt;%26lt; result %26lt;%26lt; endl;





return 0;


} //end of main function





--------------------------------------...

C++ programming question?
I'm not a c++ programmer but if your converstionType is an integer, why are you comparing it to a string? (conversionType == '2').
Reply:You're comparing the integer "conversionType" to a character in each of your if statements. Remove the quotes.
Reply:You are not pausing the prompt so that it can show the output. Add one of these


system ("PAUSE");


cin.ignore();


cin.get();


above return 0.





I use Dev C++, so I use system ("PAUSE"). You use something else, so these commands may not work. If they don't, then this definitely will.


It will hold the session until the user presses a key and since there is no more code after it, it will close the window.


Also, remove the quote or else it will return 0 regardless of what you put in.


#include %26lt;iostream%26gt;


#include %26lt;iomanip%26gt;





using namespace::std;


using std::fixed;





int main()


{


int conversionType = 0;


double temp = 0.0;


double result = 0.0;





cout %26lt;%26lt; "Enter -1 (F to C) or 2 (C to F): ";


cin %26gt;%26gt; conversionType;


cout %26lt;%26lt; "Enter temperature: ";


cin %26gt;%26gt; temp;





if (conversionType == -1)


{


result = (temp - 32) * 5 / 9 ;


}


else if (conversionType == 2)


{


result = temp * 9/5 + 32;





} //end if





cout %26lt;%26lt; "Result: " %26lt;%26lt; result %26lt;%26lt; endl;


char t;


cout%26lt;%26lt;"Press a key to end the session";


cin %26gt;%26gt; t;


return 0;


} //end of main function

poppy

Visual studio installation help on vista?

hi,


i have windows vista home premium on my laptop. i am developing a project using asp.net,c#,and sql server 2005.





i have installed sql server 2005 developer edition, visual studio 2005 professional edition. when i am starting the visual studio i am getting a msg like compatibility issue. do i have to install visual studio SP1 on vista or visual studio SP1 vista beta.





are the two mentioned above softwares enough for creating a website for my project? help me.





thanx in advance.

Visual studio installation help on vista?
Well, to answer the first question, Windows Vista still has a lot of software/hardware compatability issues. I'm sorry you made the move to Vista. =P ESPECIALLY Home Premium.





But anyhow, for the second question, Visual Studio 2005 alone, without SQL Server, is more than enough to create a website. It just depends on what you plan to include on the website that determines what software(s) you will need.





But check at Microsoft's website about application compatability. Because, of course, they're going to MAKE SURE their OS's support THEIR software. =P It would only make more sense.





But maybe there's some sort of update or something, to update software/hardware compatability. Also, check at the Visual Studio website.


How to open an Excel file in a C++ MFC application?

This might be too complicated a question to expect much help on Yahoo! Answers, but here's hoping...





I have an MFC application in Visual Studio 2005 (I'm using C++) and I need to open an Excel spreadsheet and read fields


(for example, A1 to A5) and then write to fields (for example, B1 to B5).





How do I do this? What includes do I need, and do you have an example of how this would work?





Thanks to you all!

How to open an Excel file in a C++ MFC application?
Here's a step by step tutorial:





http://support.microsoft.com/?kbid=30840...

cosmos

Thursday, July 30, 2009

C++: Why is DateTime not working?

The C++ following code (in Visual Studio 2005) generates the error message, "DateTime: undeclared identifier" when i try to compile. Am I using the namespace incorrectly? Why would this not work? Microsoft indicates that DateTime can be used if you use the System.IO namespace...





using namespace System;


using namespace System::IO;


#include "stdafx.h"





void MyProgramDlg :: OnBnClickedUpdate()


{


DateTime x;


}

C++: Why is DateTime not working?
try moving #include "stdafx.h" to the top, above the 'using namespace'.
Reply:First of all, you declare X to be a datetime object now you need to access the date and time





Look in your help file - Can't recall the object names to access but it will be in this format


x.hour x.min


Visual Basic .NET 2005 Programming Help?

How would you write an EOF character(s) to a file? And how can I write past this/read past it? I know you can do it in C++ and other languages...so I imagine it can be done in VB .NET.

Visual Basic .NET 2005 Programming Help?
Check out the link - that answers all your questions.


Vb.Net code conversion is very similar. Only thing you need to know is which class and which method you need to use





http://www.codeproject.com/cs/files/fast...


Need major help with a C# code?

I need to code a C# program with visual express 2005 that will find the average of all prime numbers between 2-100 and print the result at the end. Im having trouble figuring out how its going to sort out the prime numbers. therefore, i cant even get this lab started. i asked my professor and he gave me a response that didnt really help. here it is.





1. Loop intI from 2 to 100. (By definition, 1 is NOT a prime number.)


2. For each intI, do the following:


...a. Set blnPrime = True


...b. Loop intJ from 1 to (intI-1).


...c. For each intJ, do the following:


......(1) Check to see if intI divided by intJ would give a remainder of zero. If so, it'll mean that the number is divisible by that number, so the number is NOT a prime. If number is not a prime, we break out of this loop.


...d. If number is a prime, accumulate it in the sum total of all prime numbers, and add 1 to the count of prime numbers.


3. Print out all results and the average.





this is due tonight, someone please help!!

Need major help with a C# code?
using System;


using System.Collections.Generic;


using System.Text;





namespace prime


{


class Program


{


static bool isPrime(int n)


{


for (int i = 2 ; i %26lt; n; i++)


{


if ((n % i) == 0)


return false;


}


return true;


}





static void Main(string[] args)


{


int avg = 0;


int cpt = 0;


for (int i = 2; i %26lt; 101; i++)


{


if (isPrime(i))


{


avg += i; cpt++;


}


}


Console.Write(avg / cpt);


}


}


}


I have problems with dynamic mem. al. in C++. It's a row for you,but the end of a three-day affliction for me.

I do this in a part of my C++ program: int* pTemp=new int


[size()];


(size() is an unsigned int value, it shows the size of an array)





But when I run it, I get this message:





"heap corruption detected: after normal block (#115) at 0x003A5490. crt detected that the application wrote to memory after end of heap buffer."





and when I'm debugging it:





"there is no source code available for the current location."





What can I do?





Domonkos





(It's C++ in Microsoft Visual Studio 2005)

I have problems with dynamic mem. al. in C++. It's a row for you,but the end of a three-day affliction for me.
1) Could it be you're asking for too big of a size? Use smaller values until the problem stops, if it does.


2) Is the value negative?


3) If this problem doesn't go away, check to see if there is by some chance some file that has overridden the new operator. This is a very odd situation, but has been known to happen.





just a couple of suggestions.

online florists

C++ Code to Implement an Abstract Interface ?

In Visual Studio 2005 and using C++, how can I implement the


properties and methods of an abstract interface that I have imported from a type library (.tlb file)? (What functions do I need to call, what pointers do I need to create, etc.) Also, what type of Visual Studio project do I need to create in order to accomplish this?

C++ Code to Implement an Abstract Interface ?
There is no such thing as an Abstract Interface.





Interfaces are not supported with (ISO) C++. You should use an abstract class with only virtual methods.





A .tlb file is (I'm guessing) a Type Library. These are used with COM/ActiveX controls.





Type of Visual Studio project: .... a C++ project I guess





If you are using managed C++, you can just add a reference to the COM object, which should add a RCW you can use (a wrapper around the object referenced). This will do most housekeeping for COM/ActiveX objects for you.
Reply:Here is a resource to do that.


2 questions about c++?

1. I have tried to copy and paste game c++ codes to run using visual 2005 prof edition but that didn't work. what type of projects should we choose at the beginning (win console app, or empty proj,....





2. I want to try winpcap using visual 2005 prof edition. How can i use it ? what type of poject again ? Note : i know nothing about working with winpcap, but i just want to see what it does.......





An additional question ... when i see any type of c++ codes on the net .... how do i know the type of projects to choose?

2 questions about c++?
Firstly, you just can take a piece of code from somewhere else, paste it into a code window, hit run, and expect it to compile and execute. That is a very naiive assumption.





There are different versions of programming languages. Some programs may run in one environment, but not in another. In addition, some languages require not only the program itself, but the program environment must be properly configured and setup. C++ requires not only the code, but the right compiler, the right helper code (libraries), and a host of other considerations in order to properly run.





Your best bet is to learn the basics of a the language. Take a class or work your way through a tutorial. The instructions will inform you as to the systems requirements for running the code, and any special configuring that you must perform.





But you must be patient. Start off with very basic learning goals; work on very simple programs. Then slowly—as you gain more knowledge and experience—work your way up to more advanced material. Little by little, how things work will make more sense to you. You will better realize both the limitations and the possibilities.





The WinCap interfacing that you want to do is complicated setup. That process extends the operating system to provide low-level network access, and a library that is used to access the low-level network layers. You certainly need a substantial C++ knowledge in order to even begin using WinCap. In addition, you will have to make several special system modifications to get it to work with C++. So, if you have to be realistic in terms of your expectations.





As a learning tool, some professors prefer to begin teaching their students using console applications. These are necessarily basic, trivial programs. In that way, the students are not overwhelmed by the prospect of learning how to work with a graphical user interface—on top of learning the basic syntax, logic, and procedures of programming concepts. Once the students have become somewhat more comfortable with the language, then they advance to the integrated development environment (a regular Windows project).
Reply:Win console


What visual basic program can I download thats most similar to Visual Basic 6.0?

Visual Basic 2005 Express Edition? c ++?, J #?, C#? I can't find Visual Basic 6.0 in regular retail stores (it's over my budget anyway)

What visual basic program can I download thats most similar to Visual Basic 6.0?
The only one you can download would be Visual Basic 2005 Express. But neither it nor the 02 or 03 versions are really similar to VB6. Well, certain basics are the same, but the .Net versions are really quite different than the old standard.





Unless you need VB6 for school or some other compelling reason, you should just forget it because Microsoft is trying pretty hard to forget it themselves. Furthermore, the VB language really suffered in the translation to .Net, IMHO, and you would be much better off learning C# today.





Java is also still very popular and is cross-platform. J# is supposed to appeal to Java programmers, so I wouldn't worry with it. C++, and current versions of VC++, are not similar to VB6--they're for more advanced users with different goals.





There are really no others that are "similar" to VB6. For those who suggest Python or whatever--those are great languages, but VB6 was deicated to GUI apps, and those are scripting languages that have had rudimentary and problematic GUI capabilities shoehorned onto them. They do not meet the OP's request for someting similar to VB6.
Reply:VB is easier to learn, matters if you have the time to learn, IM me for a copy of vb 6





as i will try learning python again
Reply:You can get a free IDE for VisualBasic.NET called C# Develop. It is similar to VisualStudio.NET in that it lets you create VB.NET and C# programs in a similar environment.





Why Visual Basic though? Have you looked at Python?





Python is a relatively easy programming language to learn and it's very powerful. It is not limited to just Windows like VisualBasic is. You can write Python programs for Windows, Mac, Linux, BSD, and more.





Python is used by Google, NASA, and many other large organizations. Check it out.
Reply:You can get from





www.freshmeat.com


www.freshersworld.com


www.sourceceodesworld.com


Is the anything cool i can create with no cost using the program microsoft visual basic 2005 express edition?

I wanted to create the computer controlled r/c car but i dont have a little camera or wifi thing for it so what else could i do that would be cool to use for the computer with no cost

Is the anything cool i can create with no cost using the program microsoft visual basic 2005 express edition?
You can develop pretty much anything in Express Edition for yourself - one of the main limitations of Express is that you can't create programs that are optimized to be deployed widely, like a published software program. But as far as raw coding, you are not limited from developing any particular kind of software. Web sites like http://www.pscode.com/ have lots of sample projects and code for all kinds of applications.
Reply:check http://www.pscode.com for great source code samples of all kinds of projects.
Reply:Yes-there's a couple of starter kits that come with the Express edition.





I organized my DVD collection using the Amazon enabled DVD collection project that I downloaded from the Microsoft website.

flowers uk

XNA Game Studio and c# 2008?

This is kind of a stupid question and its obvious it might but i want to make sure. Will XNA game studio work with visual c# express 2008? IT requires 2005 and i figured since 2008 is a newer version above that it should work, will it?

XNA Game Studio and c# 2008?
It doesn't work with c# express 2008 yet. It will in the future though.


What code is used to open a file (pdf., doc., .pps, etc.) in Visual Basic 2005 Express?

How can I use button 1, for example, to view a PDF file about SR?"


Private Sub Button1_Click (Byval...)Handles Button1.Click


System.IO.File.Open(File path)


"


or whatt? Even if true, how to write the file path? I write:


"C://Documents and Settings/..." and it tells me "System.IO.File.Open" can't take this number off arguments?

What code is used to open a file (pdf., doc., .pps, etc.) in Visual Basic 2005 Express?
A file path is not written:





C://Documents and Settings/myDoc.pdf





Instead, it should be written:





C:\Documents and Settings\myDoc.pdf


_________________





What file types can the System.IO.File object open?


Are you quite sure that it can open a .pdf file?


_________________





The quick and easy way to open a .pdf file is to use the web browser control . This assumes that both IE and the Acrobat Reader are installed on the target system. Just use the Navigate method of the control with the PDF filename as the parameter and you're there.





Note that you may have to add the web browser control to your project, by accessing the COM Components tab on the toolbox. (SEE below.)


____________-





Here is another way to read pdfs.





Right click on any of the tabs in your toolbox, and click choose items. (Just make sure you have a version of Adobe Reader installed before starting.) When the dialog box pops up click the 'Com Components' tab. Next, pick the 'Adobe PDF Reader' COM component. Click OK, and you should now see an 'Adobe PDF Reader' control in your toolbox. Click this, and drag it to your VB form.(you may need to resize it, usually appears very small).





Now in order to read any pdf, you need only alter the 'src' property of the control—either in code or in the designer. When you run the program you should be able to view the pdf doc in the VB form. You should have access to most of the options you get in Adobe Reader.





Here is how you would alter the 'src' property in code:





Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load


AdobeReader.src = "C:\mydoc.pdf"


End Sub





___________


How to open an outer file in a Visual Basic 2005 Express file?

I mean, that, if for example I want to open a PDF file in My Documents by a button or Yahoo! mail by a link label, what code is needed?


Sure, it's not File.ShowDialog(url:C://Documents and Settings\User\Desktop\PDF1.pdf)

How to open an outer file in a Visual Basic 2005 Express file?
file.open("location")


How do I make applications run independantly of Visual Studio 2005?

I've been writing some C and C++ programs with it, but when I run the program by clicking on the .exe file, the console window closes as soon as the program ends, instead of letting me see the output. When run from inside VS, it ends with the "Press any key to continue . . . "





Do I need to add extra code, or what else can I do to have it run normally?

How do I make applications run independantly of Visual Studio 2005?
Your code ...is... running normally. It's a console program. Since you're double clicking on the exe (and not running from console), a console window opens up, the program runs, and the console window closes down.





So the correct way is to open up a console window yourself and run the program from there.





A kludge for development purposes is to ask for user input. You aren't actually going to do anything with the input, but by asking for input, the program window is forced to stay open. Something like cin.get() will do the trick (part of iostream) (http://cppreference.com/cppio/get.html ).
Reply:In Borland C/C++, the right way would be to call the getchar() function. You must include conio.h in order to call this function, but Visual C++ does not offer support for this function.





Another way would be to use sleep(time) where time is an integer that represents the amount of time to sleep (in miliseconds). Include time.h for this to work.

hamper

I would like to install the Visual Studio 2005 in a different hd partition from windows how can I do that?

I´ve tried to choose the destination folder but he still requires 1.4 Gb in C: and a few MB in D:. Is there anyway that I can stall at least the Gigantic Framework .NET in D:?

I would like to install the Visual Studio 2005 in a different hd partition from windows how can I do that?
You probably can install some of the Framework on D if you download the Framework 2.0 SDK and the redistributable, install them in advance, and specify as much to the D drive as possible.





Much of the Framework MUST be installed to c:\windows\mirosoft.net (unless your system partition is on D.) This is because these are effectively become system files in Windows Vista, where managed code becomes the native API.
Reply:I think because there is the files need to copy to system folder like Windows/system32 and other file that need place on system folder, like .NET and other server side application.


How can i downlode visual studio 2005?

for working with C#

How can i downlode visual studio 2005?
U can download it from here:


http://msdn2.microsoft.com/en-us/express...
Reply:Only the express edition can be downloaded. Here is the link:


http://www.microsoft.com/express/
Reply:There are two versions:





Express (FREE): http://msdn2.microsoft.com/en-us/express...





Or you can purchase a MSDN Subscription and get a DVD or download from http://msdn.microsoft.com/subscriptions/
Reply:Or here (there are a few results here):


http://www.download.com/3120-20_4-0.html...


How do you force a CDialog (Visual Studio 2005) object to refresh it's display?

Under one of my OnBnClicked functions, I have to have a sleep timer. Only problem is, the sleep is causing the display not to update. I need it to update once per loop before it sleeps. Is there a function standard in c/c++ that forces the CDialog display(the whole display or the CEdit box in question) to update?

How do you force a CDialog (Visual Studio 2005) object to refresh it's display?
CWnd::Invalidate();


CWnd::UpdateWindow();





since CDialog is derived from CWnd





CDialog::Invalidate ();


CDialog::UpdateWindow();
Reply:If you do you sleep timer right, it shouldn't block refreshes, and runs in a separate thread. How are you doing your timer?


Information about proxys?

I don't have internet at home, and would like to download Visual C# 2005 Express Edition SP1. Unfortunatly, the library computer has some restrictions on it that cause about half of the things I want to download to randomly not work. The error messege says to "download to a different place" because "you're not allowed to change the .../temp folder." I was hoping that maybe a proxy would be able to get past this, since I can't go to the options to change where it downloads.


Question: Would a proxy get past this, and


Question: If so, how do I use a proyx?


Thanks

Information about proxys?
No, besides that - if you don't have sufficient privileges to adjust IE settings you aren't going to be able to install anything. The error is that the file you want to download exceeds the maximum allowable size of the temporary internet files folder - which is were everything downloads until it's completely downloaded, then IE moves it to where you selected. A proxy is a way of connecting to the internet through an intermediary so your immediate ISP doesn't know what you're doing.
Reply:unfortunately not. Something that you can try to do is just buy a 512 MB flash drive for 10 dollars, and then you could download it. A proxy is for securing yourself on the internet, what it does is changes the header that is sent to a website when you visit it. a header has information like... where you live, what type of OS your using, what browser your using, your screen resolution, your ISP, and a couple less interesting things... your Ip address and other things. but anyway.. the reason you cant download to the computer at the library is for the purpose that someone with malicious intent doesnt download mal-ware to their computers
Reply:In this case a proxy would be a website that your computer goes thru to access websites instead of your computer requesting the site from your isp directly. You can bypass a firewall if not configured to block that site. The issue you have is that the library's network policy doesn't allow you to download the file to the /temp folder. You can try a different folder or directory, or you can try a flash drive to save it. At this point im guessing that they wont let you download anything to the computer unless you have an external device.
Reply:To answer your question, no, a proxy will not work in this scenario.





A proxy is a connection to another computer across the internet. It will help you bypass a firewall, hide your IP or allow you to surf the net anonymously.





The problem you're having sounds like a permissions issue. Apparently you're trying to write to a folder you don't have access to.





This may be fixable by simply changing the directory to the desktop. When you get the 'Save File As..." screen, just select to save it to your desktop instead of the temp folder.





Best of luck.
Reply:No, that security has nothing to do with the actual downloading. It is set in Windows...you do not have access to download to that location. I would suggest having a friend download it for you and then burn it to a CD.
Reply:Using a proxy changes how you access the internet, not what happens on your computer. A proxy is most commonly used to avoid filters and such, (I.E. Accessing MySpace at school).
Reply:No, a proxy wouldn't get past it.





The problem is to do with what the computer will allow you to do, not with what the network will allow you to do.
Reply:I don't believe proxy's have anything to do with that, If the admin of the library computer doesnt want you to download stuff, your pretty much stuck. Proxys basically reroute how you access the informatoin, but either way the end result is going to hit whatever protection the local pc has on it.
Reply:Library computers are locked down so you probably won't be able to change any of those settings, including the proxy settings
Reply:Try this site to get most recent proxies.





http://www.prox-list.info





Or join this group to receive newest proxies in your inbox





http://groups.yahoo.com/group/ProxInbox/...








AND








http://www.prox-today.com





New site giving you every 24 hours a new proxy site








Enjoy!

bloom