|
C++ is the pure standard language... (in theory).
now, each compiler can implement all (or more or less) of the grammar of the C++. that is the case of microsoft with its Visual suite.
Visual C++ that is compiled by the microsoft compiler contains specifics, that is why we commonly use this name to difference it from the others...
is that clear now ?
TOXCCT >>> GEII power
|
|
|
|
|
Have you learn c#? I`m thinking of learning it.
<italic>Work hard and a bit of luck is the key to success. You don`t need to be genius, to be rich.
|
|
|
|
|
nop, and i don't want to... i love tyoo much my c++ to learn for a "Microsoft extension of .NET object language"... you well understand, i don't like C#... (shame on me maybe, but the few i already read about it didn't interrest me).
TOXCCT >>> GEII power
|
|
|
|
|
At first, I didn`t like it, but now i kinda like it.
<italic>Work hard and a bit of luck is the key to success. You don`t need to be genius, to be rich.
|
|
|
|
|
C++ is a programming language, Visual C++ is a Microsoft integrated development environment (IDE) for C++ programming.
|
|
|
|
|
So is the board managed c++ the c++ language and not visual C++
|
|
|
|
|
"Managed C++" is Microsoft's non-standard extension of the C++ language for the .NET platform. The latest versions of Visual C++ can be used to create Managed C++ programs.
|
|
|
|
|
A part of my program use rich edit control,now I want to set a bitmap as the background of richedit control,how to implemente it?
hiall
|
|
|
|
|
implement in rich edit control's perant message - WM_CTRLCOLOR... CWnd::OnCtrlColor this func returns HBRUSH parameturs ... One from parameters of OnCtrlColor is nCtrlColor when it is equal to COLOR_EDIT and COLOR_MSG you must creat your own brush (which must not be local varible) and in this new brush draw the image (CDC::bitblt(...)) ... in the end return this burash as a result from CWnd::OnCtrlColor.
For value diffirent from COLOR_EDIT and COLOR_MSG return the result from OnCtrlColor from base class.
|
|
|
|
|
Can i please get help in this topic of c++ programming, the problem is it's my first time in programing i don't know where to begin
|
|
|
|
|
Sweetlady wrote:
i don't know where to begin
I presume you know what Mortgage Amortization means. And I presume you can do the calculations with a pen and paper (with help from a calculator).
So, do a calculation on paper, taking note of all the steps you need to take in order to do it. Take note of all the information you need to do the calculation also.
Now, you know what information you need and what to do with it. You can start working out what commands you need to give C++ in order to get the information, process the information and finally produce the result.
If you have a specific problem you can ask back - but general queries like the one above (especially ones that look like homework questions) require too much work to answer fully. You really need to demonstrate that you have made an attempt to do the work yourself first, and have then got stuck on some particular part of it.
Do you want to know more?
Vogon Building and Loan advise that your planet is at risk if you do not keep up repayments on any mortgage secured upon it. Please remember that the force of gravity can go up as well as down.
|
|
|
|
|
print "hello world".
There is no spoon.
mail
|
|
|
|
|
Need help on sorting a CArray of structs by 2 values. An example of a similar struct is below, say I wanted to sort by name & then age. I have a quick sort function that can sort one a single value, by I am clueless as in how to do two. Any help would be greatly appreciated.
Kurt
struct Person
{
CString name;
int age;
};
|
|
|
|
|
It's actually quite easy. I assume you're using a comparison method like the one used by qsort() . The function returns +ve if the first argument belongs before the second, -ve if the second belongs before the first, and 0 if the two are considered equal:
int comparePersons(void *arg1, void *arg2)
{
Person *person1 = (Person*)arg1;
Person *person2 = (Person*)arg2;
if (person1->name < person2->name)
return 1;
else if (person1->name > person2->name)
return -1;
else
{
if (person1->age < person2->age)
return 1;
else if (person1->age > person2->age)
return -1;
else
return 0;
}
} Of course, you can change the < and > around to reverse the sort order if you need to.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Try this...
#include <afxtempl.h>
#include <iostream>
#include <algorithm>
#include <functional>
using namespace std;
struct Person
{
Person(const CString& n = "", int a = 0) : name(n), age(a) {}
CString name;
int age;
};
class ComparePerson : public binary_function<Person, Person, bool>
{
public:
// Sort by name and then age
bool operator()(const Person& first, const Person& second) const
{ return first.name < second.name || (first.name == second.name && first.age < second.age); }
};
void SortTest()
{
CArray<Person, Person> person;
person.Add(Person("Kevin", 30));
person.Add(Person("Gary", 24));
person.Add(Person("Peter", 36));
person.Add(Person("Peter", 16));
person.Add(Person("Richard", 19));
person.Add(Person("Joanne", 40));
int count = person.GetSize();
afxDump << "Initial contents\n";
for (int i = 0; i < count; i++)
{
afxDump << "name = " << person[i].name << ", " << "age = " << person[i].age << "\n";
}
// Last Person
Person* begin = person.GetData();
Person* end = begin + count;
afxDump << "Last Person \n";
Person* last = max_element(begin, end, ComparePerson());
afxDump << "Last Person: " << "name = " << last->name << ", " << "age = " << last->age << "\n";
afxDump << "\n";
// Sort
sort(begin, end, ComparePerson());
afxDump << "Sorted persons\n";
for (i = 0; i < count; i++)
{
afxDump << "name = " << person[i].name << ", " << "age = " << person[i].age << "\n";
}
}
Output
Sorted persons
name = Gary, age = 24
name = Joanne, age = 40
name = Kevin, age = 30
name = Peter, age = 16
name = Peter, age = 36
name = Richard, age = 19
Is this what you want?
Kevin
|
|
|
|
|
I'm trying to find some code that will work for multinode b-tree. All of my searches yeilded broken code or class syllabus.
Does anyone have one that works for VC++ 6.0
Thanks in advance,
Nordyck
|
|
|
|
|
Hi,
It seems possible to connect 2 programs
when both are behind firewalls.
It seems that a "torrent tracker"
listens for clients, and when 2
firewalled clients wants to
connect one to the other, the tracker
establish the connection between them
and then leave?
How is the tracker able to do this?
Thanks for a great site.
Fabio, boicotinho@[hotmail.com]
|
|
|
|
|
Hi all. I'm trying to create a linked list of driver names. The following code snippet creates a 3 objects, the 1st outputs some text, the 2nd creates a details object and the 3rd creates a driver_list object which is a container class for a list of details objects.
The problem I'm having is that I don't know what to pass to "list.add_driver()", it expects a details object to be passed to it. I've tried passing a details object but I just get errors thrown up.
Can anyone give me any pointers? ( pardon the pun )
//////////////////////////////////////////////////////////////////
int main(){
clsoutput output;
output.GetDriverName();
details driver;
driver_list list;
for(int i=0;i<=2;i++){
driver.enter_driver_name();
output.DisplayDriverName(driver.get_name());
list.add_driver( // what goes here? ) // problem line
}
return 0;
}
//////////////////////////////////////////////////////////////////
add_driver method which is called when "list.add_driver()" is invoked
//////////////////////////////////////////////////////////////////
void driver_list::add_driver(details* pDetails)
{
package* pPackage = new package(pDetails);
if(pHead)
pTail->setNext(pPackage);
else
pHead = pPackage;
pTail = pPackage;
}
//////////////////////////////////////////////////////////////////
|
|
|
|
|
Seems like you have to pass a pointer to a details object:
list.add_driver(&driver); Am I missing something?
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
Want a Boost forum in Code Project? Vote here[^]!
|
|
|
|
|
Joaquín, nice one, that works a treat. You're not missing a thing, its that simple. I've not touched C++ in ages and even then I didn't know it well so I'm quite rusty.
It compiles fine so it might not be safe to assume that the linked list works I'll need to iterate over the list to find out.
Thank you very much.
Graeme
|
|
|
|
|
I am having a problem in passing an integer as an agrument to a thread of the format:
UINT threadname (LPVOID);
I am passing 4 distinct values to 4 distinct threads using the same function as the thread operation. Whenever i typecast the address of the interger to LPVOID type, pass it an argument to CreateThread() & then re-typecast it to an integer in the thread function, i either get runtime errors or i get junk values. but never the original value of the integer that i wanted.
Is there any special way of typecasting pointers in vc++.net??
I also tried out using the reinterpret_cast operator and also replacing the CreateThread() function by AfxBeginThread(). Although i dont get any runtime errors now, but the same value is passed to 2 threads occasionaly (Rememeber i want 4 distinct values to be passed to 4 distinct threads) & sometimes a completely strange no is passed. The value is repeated for only 1 thread, the others are ok.
Plz help if any1 knows a workaround or solution to this.
--
Nikhil
|
|
|
|
|
Whenever i typecast the address of the interger to LPVOID type...
Here's the problem, I guess. You are passing the address of an int declared on the stack. As soon as you exit the function from where you're calling CreateThread , that int gets destroyed, so that when the thread tries to recover it it is likely garbage that's being retrieved instead.
As an int and LPVOID have the same size (in Win32), you can just reinterpret_cast the int (not its address!) to a LPVOID , and you should be done.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
Want a Boost forum in Code Project? Vote here[^]!
|
|
|
|
|
Yes it is bad problem... but try this ... instead pass iteager value as address pass a pointer to integer valeu... once i have similar problem .... i pass adress of varible with 3 distinct values to 3 ditinct threads but only first value is passed to all 3 distinct threads (no debug errors, no runtimes errors, no linking errors). Also in debbug mode it worked proparly but in release it didn't work proparly. The solution was to pass pointer to my varible instead as regular parameter. Some thing like that:
int *p = new int;
*p = 5;
CreateThread(..., p, ...);
|
|
|
|
|
OS: win 2000
Is it possible to write to the .ini file from a .bat file?
Here's what I'm trying to do:
I have .bat that is supposed to make the user's life easy by installing our software using a base directory that the user specifies. So the user would execute "installProd.bat C:\user_area" (or Whatever Disk>:\where ever). The .bat creates the directory specifed (as well as others below it) places our C++ executables and our supporting files (like any input data files or help files, etc) into the dirs.
Now I'm hoping to write to the .ini file from within the .bat so I can put the user defined base directory into the .ini. Then when the C++ executables run, the executables can access the .ini file for the base directory path (using GetPrivateProfileSettings or GetProfileString etc).
Is it possible? Or am I going down the wrong path for this? ANy suggestions and guidance is much appreciated!
Thanks,
blueSprite
|
|
|
|
|
You can use echo .For instance, the following commands
echo>parms.ini [general]
echo>>parms.ini key=value create an .INI file like this
[general]
key=value Note that a single > means "create new file" and >> means "append". Hope this helps.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
Want a Boost forum in Code Project? Vote here[^]!
|
|
|
|