Forum: C++ 3 Days Ago |
| Replies: 4 Views: 241 I think you are not understanding the following
Sizes of integral types
The values given below shall be replaced by constant expressions suitable for use in #if preprocessing directives. Their... |
Forum: C++ 9 Days Ago |
| Replies: 1 Views: 220 If you need to resolve the path and file name of a .lnk file (i.e. a shortcut) that's dropped on the Audacity project, you'll need to use the IShellLink interface. Read about Shell Links... |
Forum: C Mar 31st, 2009 |
| Replies: 10 Views: 713 There is an initialization failure ...
for( i = 0; i < n; i++ ) numberlist[i] == rand() % n ; |
Forum: C++ Mar 31st, 2009 |
| Replies: 3 Views: 463 I think the two friend declarations need template <class T>
template <class T>
class Tree
{
...
template <class T> friend void buildExprTree(Tree<T> & expr);
template <class T> friend int... |
Forum: C++ Mar 28th, 2009 |
| Replies: 11 Views: 595 You can use const_cast, i.e.
Node * temp = const_cast<Node*>(this);
Maybe you could revise the 'constness' of the code (I did not look too closely). Perhaps read about Const correctness... |
Forum: C++ Mar 18th, 2009 |
| Replies: 9 Views: 551 There is a contradiction, in your first post you say that "Each file has: #include "include.h"". If enum.cpp actually includes include.h, that results in the error you described.
Assuming... |
Forum: C++ Mar 18th, 2009 |
| Replies: 23 Views: 1,067 Now remember the second parameter to write(), that specifies how many bytes are written.
PS. Maybe you could try to re-post your code |
Forum: C++ Mar 16th, 2009 |
| Replies: 23 Views: 1,067 It seems that you are desperately trying various ways to write the file.
Maybe relax and try to master e.g. a binary .pnm file of a very small size, say 2x2 pixels hence being easily viewed in... |
Forum: C++ Mar 10th, 2009 |
| Replies: 4 Views: 595 Read about When should my destructor be virtual? (http://www.parashift.com/c++-faq-lite/virtual-functions.html#faq-20.7) |
Forum: C++ Mar 10th, 2009 |
| Replies: 7 Views: 1,078 The function prototype for ON_MESSAGE() is
afx_msg LRESULT memberFxn( WPARAM, LPARAM );
Ctry_ENTERDlg::OnBnClickedButton1 does not match, so you might add a new member function which handles... |
Forum: C++ Mar 8th, 2009 |
| Replies: 6 Views: 596 If the stream object is in error state, then you also need to call clear() in order to make the object functional again. Could that be the reason in this case? |
Forum: C++ Mar 8th, 2009 |
| Replies: 3 Views: 557 As soon as the map goes out of scope, its destructor takes care of destructing all the vectors, whose destructors in turn destruct all the strings. So it all happens automagically (as long as you are... |
Forum: C++ Mar 6th, 2009 |
| Replies: 8 Views: 1,159 resource.h is not the place to define _WIN32_IE. Do it instead above the #includes, i.e.
#define _WIN32_IE 0x0301
#include <windows.h>
#include <commctrl.h>
Or alternatively in the... |
Forum: C++ Mar 6th, 2009 |
| Replies: 8 Views: 1,159 In your project, #define _WIN32_IE to at least 0x0300.
InitCommonControlsEx() takes a pointer to a INITCOMMONCONTROLSEX struct. You are not using the function correctly ... |
Forum: C++ Mar 6th, 2009 |
| Replies: 2 Views: 239 A typo has slipped in ... it should be localVariable. |
Forum: C++ Mar 6th, 2009 |
| Replies: 7 Views: 1,078 Seems that I misunderstood the problem. Anyhow, the CMyEdit class' code that you have should capture the Enter key.
Maybe you don't have the following in the dialog class implementation
... |
Forum: C++ Mar 6th, 2009 |
| Replies: 7 Views: 1,078 That functionality can be achieved by simply making sure that:
the first button (only) has the 'default button' -option checked
the first edit box does not have the 'want return' -option... |
Forum: C++ Mar 4th, 2009 |
| Replies: 3 Views: 572 See GetExitCodeThread() (http://msdn.microsoft.com/en-us/library/ms683190(VS.85).aspx) |
Forum: C++ Mar 3rd, 2009 |
| Replies: 2 Views: 772 Don't allocate using the operator new, use _aligned_malloc() instead to have the data properly aligned. |
Forum: C Mar 3rd, 2009 |
| Replies: 6 Views: 459 Try going through the py2exe tutorial (http://www.py2exe.org/index.cgi/Tutorial).
If you'll use py2exe to assemble all the files your python prog needs, you can skip the idea of coding anykind... |
Forum: C++ Mar 3rd, 2009 |
| Replies: 5 Views: 453 One approach would be to
generate a default MFC-based add-in
study it so that you understand how things work
strip off all MFC/AFX -based stuff, converting the add-in to a standard DLL... |
Forum: C++ Feb 27th, 2009 |
| Replies: 4 Views: 706 To get 'non-destructive writes', open the file specifying also the ios::in mode. |
Forum: C++ Dec 5th, 2008 |
| Replies: 6 Views: 492 It appears as if you might have stumbled upon the virtualization feature of Windows Vista. Try looking it up on the MSDN. |
Forum: C++ Nov 28th, 2008 |
| Replies: 5 Views: 1,270 You can circumvent that by ...
int main()
{
...
switch(option)
{
case 'h':
case 'H':
{ // new scope begins here ... |
Forum: C++ Nov 23rd, 2008 |
| Replies: 10 Views: 1,973 Wouldn't it be easiest to add 'standard' ON_UPDATE_COMMAND_UI handlers for those two sub-menus, i.e. you'd have something along the lines of:
ON_UPDATE_COMMAND_UI(IDM_SUBMENU1, OnUpdateSubmenu1)... |
Forum: C++ Nov 20th, 2008 |
| Replies: 12 Views: 1,011 Hmm, you have to understand that char editControl_Content[2]; allocates space for two chars.
The array indexes start from zero, meaning that the only indexes you are allowed to access in this case... |
Forum: C++ Nov 20th, 2008 |
| Replies: 12 Views: 1,011 You are not getting the window text properly, it should be
char editControl_Content[2];
// the following gets one char into editControl_Content[0] and sets
// editControl_Content[1] to '\0'... |
Forum: C++ Nov 7th, 2008 |
| Replies: 12 Views: 1,374 Well, by doing the following ...
...
background = load_image("background.bmp");
if(background == NULL)
{
// load_image() failed ...
cout << "load_image() failed, error: " <<... |
Forum: C++ Nov 6th, 2008 |
| Replies: 12 Views: 1,374 Assuming that SDL is unable to load the image, you might place a call to SDL_GetError() (http://sdl.beuc.net/sdl.wiki/SDL_GetError) immediately after the line:
background =... |
Forum: C++ Oct 27th, 2008 |
| Replies: 2 Views: 408 Try with these changes
//CUSTOMERDLL.H
#ifndef DllH
#define DllH
#include "customerForm.h"
extern TCustomerF* DllCustomer;... |
Forum: C++ Oct 21st, 2008 |
| Replies: 3 Views: 439 I think you are using a 32-bit toolset (VS Express) and trying to link with the 64-bit version of libmysql.lib.
The 32-bit version of libmysql.lib comes with those missing symbols, what you have is... |
Forum: C++ Oct 16th, 2008 |
| Replies: 6 Views: 489 Perhaps your intention was to replace also a '\v' with a space but you forgot to do it? |
Forum: C++ Oct 1st, 2008 |
| Replies: 11 Views: 1,128 Which compiler/OS are you using?
The (modified) code worked for me (Visual Studio 2005), but NOT with GCC 3.4.2. |
Forum: C++ Oct 1st, 2008 |
| Replies: 11 Views: 1,128 A couple of things
1) When opening the file, in addition to the ios::out|ios::in flags, specify one of: app, ate or trunc (http://www.cplusplus.com/reference/iostream/fstream/open.html) flag.
... |
Forum: C++ Oct 1st, 2008 |
| Replies: 11 Views: 1,128 One fix to the reading problem is to re-open the file, or alternatively you might implement
something similar to seekg() (http://www.cplusplus.com/reference/iostream/istream/seekg.html) to set... |
Forum: C++ Sep 30th, 2008 |
| Replies: 19 Views: 2,104 I think you are after ...
typedef List<String^> Vec1;
typedef List<Vec1^> Vec2;
Vec2 List1;
for( int j = 0; j < 1000; j++ )
{
List1.Add(gcnew Vec1()); |
Forum: C++ Sep 27th, 2008 |
| Replies: 26 Views: 3,088 Use #include <time.h>, and use clock_t and clock() instead of std::clock_t and std::clock(). |
Forum: C++ Sep 4th, 2008 |
| Replies: 13 Views: 1,109 Hmm, just a thought .. how about changing one line of the signature to:
cout << "Hi there!" << "I'm a non-standard-compliant C++ coder!";
;) |
Forum: C++ Sep 3rd, 2008 |
| Replies: 5 Views: 439 It appears as if you might find already deleted students, because of the ...
for (int n = 0; n < MAX_STUDENTS; n++)
{
if (strcmp(delStudent, students[n].ID) == 0)
{ |
Forum: C++ Sep 3rd, 2008 |
| Replies: 5 Views: 521 I think you'd want to have the string and the newline the other way around, i.e.
text += Dummy2 + System::Environment::NewLine; |