Traditionally, (at least at the time of "Borland C++") the differences were in the libraries that were provided by each vendor to make windows programming easier.
For example, Microsoft included the MFC (Microsoft Foundation Class) library and Borland included the OWL (Object Windows)...
Here's the documentation on this error from MSDN:
C Run-Time Error R6025
pure virtual function call
No object has been instantiated to handle the pure virtual function call.
This error is caused by calling a virtual function in an abstract base class through a pointer which is created by a...
Set the correct window size in the OnSize() method... and refer to this link from MSDN magazine archives for how to prevent users from resizing your window:
http://www.msdn.microsoft.com/msdnmag/issues/01/02/c/c0102.asp
Either create the button with the BS_PUSHBUTTON style:
CButton myButton;
myButton.Create(_T("My button"), WS_CHILD|WS_VISIBLE|BS_PUSHBUTTON,
CRect(10,10,100,30), pParentWnd, 1);
Or add the BS_PUSHBUTTON style to an existing button:
myButton.SetButtonStyle(BS_PUSHBUTTON);
You...
Either use itoa() to convert the integer to text on the fly:
AfxMessageBox("Value of GetValue is " + itoa(nMyDimes));
or use sprintf() to pre-format the entire string before displaying it:
char sMessage[100];
sprintf(sMessage, "Value of GetValue is %i", nMyDimes)...
"Insert blocks" are macros such as this:
//{{AFX_MSG_MAP(CEditCellNote)
//}}AFX_MSG_MAP
Visual C++ automatically inserts code between these lines. If one of these macros was duplicated somewhere (perhaps you copied and pasted some code), the wizard won't be able to tell exactly...
Much of the syntax and keywords are common to both. However, C++ has some additional keywords and adds the object-oriented concepts of classes, polymorphism, etc. C++ requires a different way of thinking and of structuring your programs, just as programming DOS applications is different than...
tchouch is right. You need to provide an index into your array. Here's a more complete example:
int iMAXHANDS = 40;
int x = 0;
for (int iIndex = 0; iIndex < iMAXHANDS; iIndex++)
{
x = iIndex ~ 4;
one.hand[iIndex].suit = x;
}
tchouch, use:
[ CODE]
[ /CODE]
(without the space) to...
I believe it doesn't recognize "map" in the following line:
static map<char*, char*> getMappedDrives(void);
Try adding the following #include near the top of your header file:
#include <map>
From MSDN:
Include the STL standard header <map> to define the container template classes...
Check the order of deallocation. If any objects are deallocated, but then referenced, it will cause a crash. For example, deallocating a parent object, then attempting to deallocate the child objects using the parent pointer will cause nasty results.
Also, this next part may sound simplistic...
The "Depends" application is a Microsoft Visual Studio tool. Here's where it's likely located on the Windows Start Menu:
Programs/Microsoft Visual Studio 6.0/Tools/Depends
If it's installed, you can also use it from the command line.
If your header file(s) mentions any "user-defined" classes which are not defined or #include'd in that header file, then you need to "forward reference" them (without the definition or body) prior to the reference, something like this:
// this is what's needed in the header...
How about using the mouse's "left button down" event and checking if the window that has focus is the button? The example uses a variable attached to the button:
// inside the left-button down event
if (FromHandle(m_MyButton.m_hWnd) == GetFocus())
{
// add your character with some...
Try opening a DOS window first, then navigate to the correct directory (using "cd <directoryname>", etc.) and then execute the program. The DOS window should stay open so that you can read whatever error message(s) the program is returning.
Some potential reasons for the DOS window...
Do something like this to go through the string looking for the character you want to replace:
char sString[512];
strcpy(sString, "hello out there");
printf("%s\n\n", sString);
for (int i = 0; i < strlen(sString); i++)
{
if (sString[i] == 'h')
{
sString[i] = 'H'...
A similar "problem" occurs when there are a number of related (i.e. library) projects sharing a single workspace.
While working on one project, it's easy to be looking at files in one of the other projects. But, VC++ usually doesn't know how to cross-reference between files in...
Your first question:
Use the tree control's SetItemData() and GetItemData() member functions to store and retrieve each node's type (i.e. Band = 1, Album = 2, Song = 3).
Then in your Right-Click handler, you can retrieve the type for the currently selected node, store the type in a member...
I believe you actually *are* having a problem with getche(). If you're using Microsoft Visual C++, you need to use this function instead:
_getch() // with the preceding underbar character
Here's the MSDN example:
#include <conio.h>
#include <ctype.h>
void main( void )
{
int ch...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.