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