Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. programsecrets

    C and C++

    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)...
  2. programsecrets

    microsoft visual c++ r6025 error can anyone help

    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...
  3. programsecrets

    Fixed window size?

    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
  4. programsecrets

    how to keep a button down

    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...
  5. programsecrets

    Convert int to string

    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)...
  6. programsecrets

    classwizard error concerning "duplicate insert blocks"

    "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...
  7. programsecrets

    C and C++

    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...
  8. programsecrets

    How to reference a struct inside a struct?

    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...
  9. programsecrets

    Compiling w/ library header files

    I believe it doesn't recognize &quot;map&quot; 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...
  10. programsecrets

    static classes exported from dll

    Wait... doesn't a DLL get imported into the application process' memory space?
  11. programsecrets

    Dll allocations and crashes

    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...
  12. programsecrets

    How to test an unknown function DLL file

    The &quot;Depends&quot; 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.
  13. programsecrets

    Compiling w/ library header files

    If your header file(s) mentions any &quot;user-defined&quot; classes which are not defined or #include'd in that header file, then you need to &quot;forward reference&quot; them (without the definition or body) prior to the reference, something like this: // this is what's needed in the header...
  14. programsecrets

    how do you repeat a character

    How about using the mouse's &quot;left button down&quot; 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...
  15. programsecrets

    My First Post: Executing out of Visual C++

    Try opening a DOS window first, then navigate to the correct directory (using &quot;cd <directoryname>&quot;, 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...
  16. programsecrets

    Problems with search and replace

    Do something like this to go through the string looking for the character you want to replace: char sString[512]; strcpy(sString, &quot;hello out there&quot;); printf(&quot;%s\n\n&quot;, sString); for (int i = 0; i < strlen(sString); i++) { if (sString[i] == 'h') { sString[i] = 'H'...
  17. programsecrets

    A simple question

    A similar &quot;problem&quot; 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...
  18. programsecrets

    Some questions on CTreeCtrl

    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...
  19. programsecrets

    Problem with toupper()

    ... or for your example, use: _getche() // again, with the preceding underbar character
  20. programsecrets

    Problem with toupper()

    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...

Part and Inventory Search

Back
Top