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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Recent content by sflam

  1. sflam

    How to get Document pointer to use by modal dialog

    To get the active document: CFrameWnd *pMainFrame = DYNAMIC_DOWNCAST(CFrameWnd, AfxGetMainWnd()); CFrameWnd *pActiveFrame = pMainFrame->GetActiveFrame(); if (pActiveFrame == NULL) return NULL; return pActiveFrame->GetActiveDocument(); HTH Shyan
  2. sflam

    Where to get retail headers for WINVER 0x0500?

    The SPs does not update the headers, and you will need the newer header from MS. Go to MSDN and download the latest Platform SDK. In the IDE, select Tools -> Options, slect Directories tab, add the entry of the SDK include directory to the "Include files" category. HTH Shyan
  3. sflam

    Preventing a new document opening on start up of exe

    In your CWinApp derived class, locate the InitInstance() function definitions. Within the function, look for the lines: CCommandLineInfo cmdInfo; ParseCommandLine(cmdInfo); Change it to: CCommandLineInfo cmdInfo; cmdInfo.m_nShellCommand = CCommandLineInfo::FileNothing...
  4. sflam

    sending keys from dialog box

    Use GetDlgItem() to get the HWND of the control: HWND hEditUID = GetDlgItem(hDlg, ID_EDIT_UID); HTH Shyan
  5. sflam

    destruction before return

    Hi, You have a pointer to some allocated memory in your class. This almost always means you need to provide: 1. A copy constructor, 2. An assignment operator Because the default copy-constructor and assignment operator only do shallow copy - they copy the pointer, but not the content the...
  6. sflam

    Need help operator overloading returning char pointer

    You're right that you cannot return a local static array because it is lost upon return. You can add a static array to your class as data member but you risk expose the internal of your class, and synchronization and maintaining the integrity of the two data members becomes an issue. Of...
  7. sflam

    Problem with __declspec(align)

    Something is not right here...Don't reinstall your installation yet. __declspec() do not support align() in VC6. It only works on VC.NET. in VC6, you have to use #pragma pack(16), or its variations: // Save current alignment setting to interanl compiler stack and // set alignment setting to...
  8. sflam

    problem with console window and win32 app

    How do you launch your console program? Did you use CreateProcess()? Shyan
  9. sflam

    problem with console window and win32 app

    Are you saying that you have a Win32 GUI application, and within that application, you launch a Win32 console program? If this is the case, run your console program using the CreateProcess() API. One of its arguments is an address of a STARTUPINFO structure. In this structure, you can...
  10. sflam

    button group

    If the IDs of the groups of radio button is consecutive, you can use: int iCheckedID = GetCheckRadioButton(ID_FIRST_RADIO, ID_LAST_RADIO); int iCheckedIndex = iCheckedID - ID_FIRST_RADIO; If the IDs are not consecutive, you have to construct the index using multiple...
  11. sflam

    C-Question - memory addresses pos or neg?

    AFAIK, addresses are unsigned values starting from 0. However, not all programming languages support unsigned type. For those languages, some addresses appears to be negative when view as a signed number. Shyan
  12. sflam

    A simple question

    The easiest is to rename your function implementation file from .c to .cpp. If this is not feasible, try enclose the function defintion with: extern "C" { /* put function defintion here */ ... } HTH Shyan
  13. sflam

    Problem with __declspec(align)

    I don't have problem with the code fragment of yours. What kind of project are you trying to build? The doc for C1600 said it could due to "imcomplete installation". May be you should reinstall VC.NET. Sorry if this is not helpful. Shyan
  14. sflam

    Problems with the CFileDialog Class

    OPENFILENAME::nMaxFile specify the buffer size of OPNEFILENAME::lpstrFile. Make sure lpstrFile also has sufficient space. [code] const int MAX_FILE = 1024; TCHAR tchFile[MAX_FILE]; m_ldFile.m_ofn.nMaxFile = MAX_FILE; m_ldFile.m_ofn.lpstrFile = tchFile; ... [\code] HTH Shyan
  15. sflam

    Problem with __declspec(align)

    Can you show your code? Shyan

Part and Inventory Search

Back
Top