|
My point is, if you're not using .NET, you're in the wrong forum. Your question is not a beginner question. Buy a book on C++ and work through it before you start choosing arbitrary tasks to achieve.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hi
I have just done a calculator program by c
it includes: arbitrary equation; quadric equation; linear equation; cubic equation, a set of equations, complex mode ..etc.(using graphics)
if you want source code, send me your mail.
ubri
|
|
|
|
|
uri_130688@yahoo.com
ubri
|
|
|
|
|
please can i have the source code?
Thank you
|
|
|
|
|
I think i need your email to send you my code
ubri
|
|
|
|
|
urbdoz@yahoo.com
Please can u codes run in C++?
Thanks
|
|
|
|
|
Would u plz help me to do this assembly language question?
Write a program that diaplay a volcabulary at 100 random screen lpcations with differnt colors,using a tining delay of 100-milliseconds.The colors are numbered from 0 to 15,so you can use a loop to generate differnt colors.
*Use the GetMaxYY procedure to determine the current size of console window.
1.Ask the user to input their name.
2.Calculate the time they use to input into milliseconds.Then,multiply this time by 100 to get a bigger number.Save and name this number as MyIntervalTime.
3.Declare 100 vocabularies for display.
4.The Interval time between each volcabulary is MyIntervalTime.
5.Randomly get one volcabulary from database above.
6.Display them one-by-one until we have 10 vocabularies in the same screen.Do not forget to change colors for each vocabulary.
7.When we have 10 vocabularies,clear screen.Then,start from displaying only one vocabulary.
Thx u so much for do this question
|
|
|
|
|
Would u plz help me to do this assembly language question?
Write a program that diaplay a volcabulary at 100 random screen lpcations with differnt colors,using a tining delay of 100-milliseconds.The colors are numbered from 0 to 15,so you can use a loop to generate differnt colors.
*Use the GetMaxYY procedure to determine the current size of console window.
1.Ask the user to input their name.
2.Calculate the time they use to input into milliseconds.Then,multiply this time by 100 to get a bigger number.Save and name this number as MyIntervalTime.
3.Declare 100 vocabularies for display.
4.The Interval time between each volcabulary is MyIntervalTime.
5.Randomly get one volcabulary from database above.
6.Display them one-by-one until we have 10 vocabularies in the same screen.Do not forget to change colors for each vocabulary.
7.When we have 10 vocabularies,clear screen.Then,start from displaying only one vocabulary.
Thx u so much for do this question
|
|
|
|
|
1 - don't double post
2 - don't post off topic questions - this is the forum for C++ with .NET, assembly is definately off topic
3 - don't ask us to do your homework for you
Surely anyone who is being given an assembly language project for homework would be able to at least attempt it before asking for help ?
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
I'm encountering some strange behavior in a C++/CLI app I'm writing. I'm wondering if anyone has seen anything like this before:
The app interface uses the .NET designer, but the key data structures are all in native C++. Specifically, I use unmanaged array of a data class. All of my data loading and saving is binary. It all works fine except for one odd behavior: If the saved binary file is created when running the app through the IDE, trying to use the file when running the app directly produces an AccessViolationException. If the saved binary file is created when running the app directly, trying to use the file when running the app through the IDE produces the same AccessViolationException. Note I get no such exceptions if I stick to one environment or the other.
When I say "use the file", I mean load it and try to do further processing. Through the debugger I've been able to determine the file loads fine. The exception occurs when I try to do anything with it. For example, in a button click event on the managed form, I call something like MyUnmanagedDataPointerArray[Index]->DoSomething(). The exception occurs when the DoSomething() method is invoked. Remember, this does NOT happen if I run strictly in IDE or strictly direct. Knowing this seems to rule out any instructions in DoSomething() as being the problem.
So to boil it all down, is anyone aware of anything that could cause BinaryReader and BinaryWriter to behave differently in the IDE versus running the application directly? Why would a binary file, created when running in the IDE and re-usable when running in the IDE, not be re-usable when running the EXE directly????
FYI, I'm using Win XP Pro SP2, VS 2005 SP 1.
|
|
|
|
|
A little update on this....
I used the step-trace to try and get a little more information. It's like the compiler messes up the method memory addresses. The problem only occurs when trying to invoke the DoSomething() method. I can invoke DoSomething2() just fine. But when I try to invoke DoSomething(), instead of the step trace moving into MyClass::DoSomething(), it moves into the system file "towupper.c" and tries to call extern "C" wint_t __cdecl towupper (wint_t c).
How can my class method address get crossed with a system function -- especially when DoSomething() is purely a mathematical routine?
|
|
|
|
|
Could you please help me to understand what ( str_time.substr(11,2) != "00" ) would do
in this code. And what normalise does in this code?
unsigned long normalise(unsigned long input_time)
{
bool finished;
// This produces a formatted time string like:
// Thu_Nov_24_18:22:48_1986
string str_time = format_time( input_time );
while( str_time.substr(1,3) != "Sun")
{
input_time -= 24*60*60;
str_time = format_time( input_time );
}
while( str_time.substr(11,2) != "00" )
{
input_time -= 60*60;
str_time = format_time( input_time );
}
while( str_time.substr(14,2) != "00")
{
str_time = format_time( input_time );
input_time -= 60;
}
while( str_time.substr(17,2) != "00")
{
input_time -= 1;
str_time = format_time( input_time );
}
return input_time;
}
Thank you.
Thank you
|
|
|
|
|
Hi,
Substring is explained in the .NET reference manual (use MSDN or Google).
this strange piece of code takes a datetime number and tries to find the previous
sunday midnight, using lots of strings: it repeatedly converts to string, then
checks for "Sun" in it, takes away 24 hours, etc; then forces the hour to "00", etc.
Obviously all the while loops are redundant: if the hour is 23, then subtracting 23*60*60
could happen straight away; etc.
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/...
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
Hello,
I wish it would sound so easy and for me. Have I understood right that this code will be searching for the previous Sunday midnight and it will return formatted Suday’s date, before Thu_Nov_24_18:22:48_1986, if it was inputted.
Kristina
Thank you
|
|
|
|
|
as you can see it returns an unsigned long (representing seconds since some reference point),
i.e. the input parameter with some days/hours/minute/seconds subtracted.
It is a terrible piece of code, with the .NET Framework one should use the DateTime class
to do the same in a much cleaner way. So that will be your home work for today.
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/...
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
Luc Pattyn wrote: It is a terrible piece of code
Nah. It's a decent piece of code for the daily WTF
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
If it is decent, could you help me to understand, where is one bug? I found one in this statement while( str_time.substr(14,2) != "00")
{
str_time = format_time( input_time );
input_time -= 60; those two statements are all mixed up.
}
And also, could you suggest how would you handle, if the input_time would be "Thu Jan 1 00:00:00 1970" . What do you think about this code’s decency now?
Thank you
|
|
|
|
|
653057337 wrote: What do you think about this code’s decency now?
It has not improved yet.
You asked what it meant, you got that answered. Do you plan on doing anything yourself ?
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/...
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
Well, perhaps I was a bit harsh about the decency of the code. If it works, I guess nothing's wrong
with it.
653057337 wrote: ould you suggest how would you handle, if the input_time would be "Thu Jan 1 00:00:00 1970"
I guess to fit the method shown, you'd have to check for "year-wrap" and subtract a year's worth
of seconds if necessary.
I personally prefer to work with the COleDateTime class and its companion, COleDateTimeSpan.
COleDateTime handles date/time from Jan 1, 100 to Dec 31, 9999.
With COleDateTime, to find the date/time for the nearest previous Sunday at midnight,
you could
1) find the day of the week for a given COleDateTime (COleDateTime::GetDayOfWeek())
2) Calculate how many days past Sunday it is (COleDateTime::GetDayOfWeek() - 1)
3) Create a COleDateTimeSpan representing the number of days from Sunday and the
hours, mins, and seconds from midnight. (value from step 2 with COleDateTime::GetHour(),
COleDateTime::GetMinute(), and COleDateTime::GetSecond())
4) Subtract the COleDateTimeSpan from the original COleDateTime (COleDateTime::operator -=)
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Thank you,
Also I have to think how to answer this question what would be a better implementation of this function, If the input_time represents an integer value in seconds since the epoch – and has the value 0 at precisely "Thu Jan 1 00:00:00 1970". I am totally tired to study this topic; I never studied about this and did not have an opportunity to use practically. I am having headache. I will take a little break for few hours and come back to this later.
Thank you,
Appreciate your help
Thank you
|
|
|
|
|
hi all
I should use from GIF format file for load its in to DOS
but I don't know how I use from LZW code for decode data of image and draw image in consul
plz help me
thanks alot
bye
|
|
|
|
|
Please don't cross-post.
This forum is for Managed C++/CLI.
Regular C++ questions should be posted on the Visual C++/MFC[^] board,
where you also posted this question.
Thanks for your cooperation
Cheers,
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi all.
Here are the two classes one base and other Derived ( virtually inherited from Base)
Class Base
{
Public:
Virtual void FunB(){}
};
Class Derived: virtual public Base
{
Public:
Virtual void FunD(){}
};
When I derived class Derived virtually from Base, and when I saw the memory layout of objects of Derived in debug window; I saw two separate vfptrs; one for Base and one for Derived.
But if I do not derive class Derived virtually from Base, then there is only single vfptr in object of Derived class?
Why an extra vfptr is added/required in case of virtual inheritance?
Sameer Thakur
|
|
|
|
|
Sameer_Thakur wrote: Why an extra vfptr is added/required in case of virtual inheritance?
No, I could not see, if it is added ? Which version of VS you are using ?
P.s. Ask this question in VC++ forum, where it is suited.
Prasad
MS MVP - VC++
|
|
|
|
|
Hi, I am using Visual Studio 2005 C++/CLI. My application has a lot of functions that are used to display information on a Form. Visual Studio starts with a default form called Form1. Because my display depends on what is and is not checked in the Form1->ToolStripMenuItems I placed all of the display code in the Form1 class. What I would like to do is strip all of the display code out of the Form1 class and put it into a class of its own. I can do this but then when my display functions try to access a value in Form1 it cannot. There are no friend classes. Is there a way to allow my new Display class to access whether or not Form1->ToolStripMenuItems have been checked? I tried to pass Form1 to my Display class as an argument but I couldn't get that to work. What is the right approach to do this?
Thanks
Buck
|
|
|
|