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 Chriss Miller 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. MSamoila

    MS Word Automation

    Hi! First time when you save a document you should use SaveAs method instead of Save: oDocs.SaveAs("C:\\MyDoc\\File1.doc"); First argument is the pathname for new document. All other arguments are optional. To shut down MS Word you should use Quit method of Application object after...
  2. MSamoila

    Crystal report and visual c

    Hi! I've worked with Crystal Reports in the past. I cannot remember source code which I wrote but I can give you the guide lines: 1. You should use COM to manipulate Crystal Reports. 2. Go in Crystal Reports folders and search all files with .TLB or .OCX extension and with Ole Object Viewer...
  3. MSamoila

    Struct member alignment

    By default the MS Visual C++ does the 8 bytes struct alignment (when no compilation flag is used). To change the default alignment you may use the /Zp or /pack flag (are the same). You also may use #pragma pack directive to override the project aligmnent rule for all struct declarations below...
  4. MSamoila

    Using VARIANT !!!

    In my opinion the above code unfortunately contains a subtile error and an inexact statement. 1. The BOOL type for VARIANT follows the VB conventions: 0 for false and -1 for true. For our convenience in VC++ there are two macros: #define VARIANT_TRUE -1 #define VARIANT_FALSE 0 This type is a...
  5. MSamoila

    Createdispatch problem (PLEASE help)

    The most common problem is that you didn't initiate the COM apartment by calling CoInitialize(NULL). The DLL works into the COM apartment of the EXE file. Test this: run the Debug version of DLL form Visual Studio environment in order to catch all TRACE messages. If CoCreateInstance() function...
  6. MSamoila

    CHeaderCtrl

    I assume you use MFC. Derive a class from CWnd which processes WM_ERASEBKGND message: class CHdrWnd : public CWnd { public: protected: afx_msg BOOL OnEraseBkgnd( CDC* pDC ); DECLARE_MESSAGE_MAP() } BOOL CHdrWnd::OnEraseBkgnd( CDC* pDC ) { pDC->FillSolidRect(RGB(255, 0...
  7. MSamoila

    Color for Edit Box

    Here is the SDK code for a dialog box which has a read only edit box with ID IDC_EDIT1: // Mesage handler for the dialog box. LRESULT CALLBACK DialogProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) { static HWND hWndEdit; switch (message) { case WM_INITDIALOG: hWndEdit =...
  8. MSamoila

    Pointer to a generic class

    Let's suppose you declare the CFileUpdate class in FileUpdate.h file and implement it into FileUpdate.cpp file. Let's also suppose you want to declare a pointer to a CFileUpdate object into another class, CMyClass. Its header file MyClass.h should contains only a forward declaration of...
  9. MSamoila

    RICH EDIT BOXES

    There are several versions of Rich Edit Controls. You can find documantation in MSDN Help on path: /PlatformSDK/User Interface Services/Windows User Interface/Rich Edit Controls In order to use them you must load the appropiate library: HMODULE hRich =...
  10. MSamoila

    Properties of AVI file

    For .AVI files there is msvfw32.dll file. You can use its exported functions in VisualC++ by including the Vfw.h header file and using Vfw32.lib in your Project/Settings... Almost all functions that works with AVI have the name beginning with AVI... Before using any of these functions you...
  11. MSamoila

    Properties of AVI file

    For .AVI files there is msvfw32.dll file. You can use its exported functions in VisualC++ by including the Vfw.h header file and using Vfw32.lib in your Project/Settings... Almost all functions that works with AVI have the name beginning with AVI... Before using any of these functions you...
  12. MSamoila

    ASSERT_VALID?

    In MFC you ussualy use classes derived from CObject. When you have a pointer to an object of such kind of class you want to be sure that this pointer is valid. This works only in DEBUG version. E.g.: void function(CWnd* pWnd) { ASSERT_VALID(pWnd); } The CWnd class is derived from CObject...
  13. MSamoila

    LNK2001 Error

    The linker generate the error: Error LNK2001: '_WinMain@16': Unresolved External Symbol CAUSE MFC UNICODE applications use wWinMainCRTStartup as the entry point. RESOLUTION In the Output category of the Link tab in the Project Settings dialog box, set the Entry Point Symbol to...
  14. MSamoila

    Why the linker does not find "_WinMain@16 symbol, when you build an MFC application with UNICODE ?

    The linker generate the error: Error LNK2001: '_WinMain@16': Unresolved External Symbol ID: Q125750 CAUSE MFC UNICODE applications use wWinMainCRTStartup as the entry point. RESOLUTION In the Output category of the Link tab in the Project Settings dialog box, set the Entry Point...
  15. MSamoila

    Bitmaps in Buttons

    To use a bitmap for a push-button first step is to set the "Bitmap property" in resource editor (set the BS_BITMAP style). You already did it. The second step is to make an association between that button and a bitmap from resource. This is done with C++ code before displaying the...

Part and Inventory Search

Back
Top