Forum: C++ Oct 12th, 2009 |
| Replies: 3 Views: 228 Maybe a file2.clear() would be helpful because upon completion of the first loop the eof bit remains set. |
Forum: C++ Aug 25th, 2009 |
| Replies: 4 Views: 287 Move this
int sum1 = numX - numZ;
int sum2 = numX - numY + numZ;
int sum3 = numX + numY;
int sum4 = numX + numY + numZ;
int sum5 = numX;
int sum6 = numX - numY... |
Forum: C++ Aug 21st, 2009 |
| Replies: 6 Views: 692 Then mark this thread as solved, please |
Forum: C++ Aug 21st, 2009 |
| Replies: 6 Views: 692 If the COM1 port is in use by an other process, this resource is locked by the OS and subsequent tries to open the COM1 port will fail. |
Forum: C++ Jul 23rd, 2009 |
| Replies: 13 Views: 542 This code works (cut 'n paste it and try it on www.codepad.org):
#include <iostream>
using namespace std;
int dayNumber(int year, int month, int day)
{
int... |
Forum: C++ Jul 22nd, 2009 |
| Replies: 4 Views: 288 Did you try to debug step by step? |
Forum: C++ Jul 21st, 2009 |
| Replies: 3 Views: 348 COrder() {::memset(this,0,sizeof(*this));}
I really hope that you know what you are doing here.... |
Forum: C++ Jul 20th, 2009 |
| Replies: 7 Views: 308 ... and not to forget: http://www.daniweb.com/forums/thread78223.html |
Forum: C++ Jul 15th, 2009 |
| Replies: 4 Views: 394 Why is compareId() a member of B
This does work:
#include <string>
#include <list>
using namespace std;
struct A |
Forum: C++ Jul 14th, 2009 |
| Replies: 15 Views: 746 Your OnSim should look like:
void YourFirstDialog::OnSim()
{
CSimConFig dlg;
dlg.DoModal();
} |
Forum: C++ Jul 14th, 2009 |
| Replies: 8 Views: 341 ..but without the () behind flush! |
Forum: C++ Jul 14th, 2009 |
| Replies: 6 Views: 295 Warning! This line
surname=aSurname;
just copies the pointer not the content!!! |
Forum: C++ Jul 14th, 2009 |
| Replies: 3 Views: 292 OMG, can't even believe that so many people are unable to search the internet....
google("CScrollView show bitmap");
select2nd("topic"); |
Forum: C++ Jul 14th, 2009 |
| Replies: 15 Views: 746 Have a look at the MESSAGE_MAP of your main dialog (that 's what is between the BEGIN_MESSAGE_MAP and the END_MESSAGE_MAP lines). Is there a line
ON_BN_CLICKED(
followed by the IDC_... of your... |
Forum: C++ Jul 14th, 2009 |
| Replies: 2 Views: 337 I think that C++ uses the same VCL as Delphi, so look for SelectDirectory() |
Forum: C++ Jul 10th, 2009 |
| Replies: 4 Views: 490 http://www.codeproject.com/KB/cross-platform/sln2mak.aspx |
Forum: C++ Jul 9th, 2009 |
| Replies: 15 Views: 746 with VC6:
1. double click on the button in the ressource editor and provide a name for the button handler in the "add member function" window which appears or
2. right click on the button in the... |
Forum: C++ Jul 9th, 2009 |
| Replies: 15 Views: 746 Open your main dialog in Resource Editor. Double click the button and a button handler is created in your main dialog .cpp file. Place your two lines of code
CSecondDialog dlg;
dlg.DoModal();
... |
Forum: C++ Jul 8th, 2009 |
| Replies: 7 Views: 281 For (some) standard types you can get the epsilon from <limits>
see also http://www.cplusplus.com/reference/std/limits/numeric_limits/ |
Forum: C++ Jul 3rd, 2009 |
| Replies: 7 Views: 416 http://msdn.microsoft.com/en-us/library/f35t8fts.aspx |
Forum: C++ Jun 26th, 2009 |
| Replies: 5 Views: 534 It's only a hint that the compiler generated code which can be executed parallely, IIRC. |
Forum: C++ Jun 25th, 2009 |
| Replies: 8 Views: 572 Rubbish! string s; calls the standard ctor for variable s, which in turn provides the correct initialization. |
Forum: C++ Jun 22nd, 2009 |
| Replies: 2 Views: 351 wchar_t means wide character. You can't convert a wchar_t to a char by "brute force casting" it. You have to call an appropriate function to convert it. Take a look at wcstombs_s(), additionally... |
Forum: C++ Jun 18th, 2009 |
| Replies: 4 Views: 268 And you should think about overloading operator << for CandyBar to allow stream output:
ostream& operator << (ostream& os, const CandyBar& bar)
{
os << bar.brandName << " " << bar.weight <<... |
Forum: C++ Jun 15th, 2009 |
| Replies: 6 Views: 897 http://developer.amd.com/cpu/CodeAnalyst/codeanalystwindows/Pages/default.aspx (works with Intel CPUs too!) |
Forum: C++ Jun 15th, 2009 |
| Replies: 8 Views: 402 After inspecting airports.cpp of your source code I recommend that you read a good C++ book. A std::vector of objects member variable doesn't need any initialization in the ctor and no destruction in... |
Forum: C++ Jun 3rd, 2009 |
| Replies: 4 Views: 251 1.
int a = ((int-1) * x; // this does not compile!!!!
2.
assert(a == -5); // Assert fails!!!!!
Does assert(b == -5); work?? |
Forum: C++ May 26th, 2009 |
| Replies: 3 Views: 203 http://www.cplusplus.com/reference/string/string/substr/
1. Use sunbstr to recognize if left part of cmd1 equals "playlist"
2. If yes, separate number from cmd1 (i.e. by tokenizing)
3. pass... |
Forum: C++ May 26th, 2009 |
| Replies: 3 Views: 203 http://www.daniweb.com/forums/thread27905.html |
Forum: C++ May 15th, 2009 |
| Replies: 11 Views: 449 Correction:
struct hasName : public std::unary_function<string, bool> // allows std::not1 etc
{
hasName(std::string const &name) : m_name(name) {} // ctor
bool operator () (Foo... |
Forum: C++ May 15th, 2009 |
| Replies: 11 Views: 449 The vector contains Foos and not strings. The standard solution for this is to use a so called functor:
struct hasName : public std::unary_function<string, bool> // allows std::not1 etc
{
... |
Forum: C++ May 14th, 2009 |
| Replies: 4 Views: 309 Try 'std::stack' instead of 'stackType' |
Forum: C++ May 14th, 2009 |
| Replies: 4 Views: 309 The compiler does not know a
template <class Type>
class stackType
{
...
}; |
Forum: C++ May 13th, 2009 |
| Replies: 7 Views: 1,101 Give us a little chance and tell us what GUI you are using? |
Forum: C++ May 8th, 2009 |
| Replies: 3 Views: 1,047 I marked another problem with a comment!!! |
Forum: C++ Apr 28th, 2009 |
| Replies: 2 Views: 1,140 http://msdn.microsoft.com/de-de/library/87zae4a3(VS.80).aspx |
Forum: C++ Apr 16th, 2009 |
| Replies: 7 Views: 431 Either the Client ctor lacks the initialization of order or Menu lacks an appropriate ctor |
Forum: C++ Mar 31st, 2009 |
| Replies: 2 Views: 265 |
Forum: C++ Mar 31st, 2009 |
| Replies: 3 Views: 435 Near miss.......
template <class T>
class Tree
{
...
template <typename T> friend void buildExprTree(Tree<T> & expr);
template <typename T> friend int eval(Tree<T> & expr);
... |
Forum: C++ Mar 30th, 2009 |
| Replies: 4 Views: 425 Please show us this SortedType stuff. And btw:
while(!inFile.eof()){
inFile >> num;
intList.InsertItem(num);
}
is a potential endless loop. Try to figure out what happens if... |