Click here to Skip to main content
15,895,011 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionRe: OLE controll for Powerpoint Pin
David Crow20-Nov-07 2:46
David Crow20-Nov-07 2:46 
AnswerRe: OLE controll for Powerpoint Pin
Soumyadipta20-Nov-07 3:09
Soumyadipta20-Nov-07 3:09 
GeneralRe: OLE controll for Powerpoint Pin
David Crow20-Nov-07 3:25
David Crow20-Nov-07 3:25 
GeneralRe: OLE controll for Powerpoint Pin
Soumyadipta20-Nov-07 3:29
Soumyadipta20-Nov-07 3:29 
GeneralRe: OLE controll for Powerpoint Pin
David Crow20-Nov-07 3:45
David Crow20-Nov-07 3:45 
GeneralRe: OLE controll for Powerpoint Pin
Soumyadipta20-Nov-07 17:54
Soumyadipta20-Nov-07 17:54 
GeneralRe: OLE controll for Powerpoint Pin
David Crow21-Nov-07 3:13
David Crow21-Nov-07 3:13 
GeneralRe: OLE controll for Powerpoint Pin
Soumyadipta22-Nov-07 22:27
Soumyadipta22-Nov-07 22:27 
Here is the details
------------------------------



I am using Visual Studio 2005 (8.0)


File ->New -> Project
Visual C++ Project ->Win32 -> Win32 Project
Name=Oletest ,Saved to Desktop
Application Settings -> Windows Application -> Finish

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

// Oletest.cpp : Defines the entry point for the application.
//

#include "stdafx.h"
#include "Oletest.h"
#define MAX_LOADSTRING 100

// Global Variables:
HINSTANCE hInst; // current instance
TCHAR szTitle[MAX_LOADSTRING]; // The title bar text
TCHAR szWindowClass[MAX_LOADSTRING]; // the main window class name

// Forward declarations of functions included in this code module:
ATOM MyRegisterClass(HINSTANCE hInstance);
BOOL InitInstance(HINSTANCE, int);
LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
LRESULT CALLBACK About(HWND, UINT, WPARAM, LPARAM);

int APIENTRY _tWinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPTSTR lpCmdLine,
int nCmdShow)
{
// TODO: Place code here.
MSG msg;
HACCEL hAccelTable;

// Initialize global strings
LoadString(hInstance, IDS_APP_TITLE, szTitle, MAX_LOADSTRING);
LoadString(hInstance, IDC_OLETEST, szWindowClass, MAX_LOADSTRING);
MyRegisterClass(hInstance);

// Perform application initialization:
if (!InitInstance (hInstance, nCmdShow))
{
return FALSE;
}

hAccelTable = LoadAccelerators(hInstance, (LPCTSTR)IDC_OLETEST);

// Main message loop:
while (GetMessage(&msg, NULL, 0, 0))
{
if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}

return (int) msg.wParam;
}



//
// FUNCTION: MyRegisterClass()
//
// PURPOSE: Registers the window class.
//
// COMMENTS:
//
// This function and its usage are only necessary if you want this code
// to be compatible with Win32 systems prior to the 'RegisterClassEx'
// function that was added to Windows 95. It is important to call this function
// so that the application will get 'well formed' small icons associated
// with it.
//
ATOM MyRegisterClass(HINSTANCE hInstance)
{
WNDCLASSEX wcex;

wcex.cbSize = sizeof(WNDCLASSEX);

wcex.style = CS_HREDRAW | CS_VREDRAW;
wcex.lpfnWndProc = (WNDPROC)WndProc;
wcex.cbClsExtra = 0;
wcex.cbWndExtra = 0;
wcex.hInstance = hInstance;
wcex.hIcon = LoadIcon(hInstance, (LPCTSTR)IDI_OLETEST);
wcex.hCursor = LoadCursor(NULL, IDC_ARROW);
wcex.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);
wcex.lpszMenuName = (LPCTSTR)IDC_OLETEST;
wcex.lpszClassName = szWindowClass;
wcex.hIconSm = LoadIcon(wcex.hInstance, (LPCTSTR)IDI_SMALL);

return RegisterClassEx(&wcex);
}

//
// FUNCTION: InitInstance(HANDLE, int)
//
// PURPOSE: Saves instance handle and creates main window
//
// COMMENTS:
//
// In this function, we save the instance handle in a global variable and
// create and display the main program window.
//
BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
{
HWND hWnd;

hInst = hInstance; // Store instance handle in our global variable

hWnd = CreateWindow(szWindowClass, szTitle, WS_OVERLAPPEDWINDOW,
CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, NULL, NULL, hInstance, NULL);

if (!hWnd)
{
return FALSE;
}

ShowWindow(hWnd, nCmdShow);
UpdateWindow(hWnd);

return TRUE;
}

//
// FUNCTION: WndProc(HWND, unsigned, WORD, LONG)
//
// PURPOSE: Processes messages for the main window.
//
// WM_COMMAND - process the application menu
// WM_PAINT - Paint the main window
// WM_DESTROY - post a quit message and return
//
//
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
int wmId, wmEvent;
PAINTSTRUCT ps;
HDC hdc;

switch (message)
{
case WM_COMMAND:
wmId = LOWORD(wParam);
wmEvent = HIWORD(wParam);
// Parse the menu selections:
switch (wmId)
{
case IDM_ABOUT:
DialogBox(hInst, (LPCTSTR)IDD_ABOUTBOX, hWnd, (DLGPROC)About);
break;
case IDM_EXIT:
DestroyWindow(hWnd);
break;
default:
return DefWindowProc(hWnd, message, wParam, lParam);
}
break;
case WM_PAINT:
hdc = BeginPaint(hWnd, &ps);
// TODO: Add any drawing code here...
EndPaint(hWnd, &ps);
break;
case WM_DESTROY:
PostQuitMessage(0);
break;
default:
return DefWindowProc(hWnd, message, wParam, lParam);
}
return 0;
}

// Message handler for about box.
LRESULT CALLBACK About(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
{
switch (message)
{
case WM_INITDIALOG:
return TRUE;

case WM_COMMAND:
if (LOWORD(wParam) == IDOK || LOWORD(wParam) == IDCANCEL)
{
EndDialog(hDlg, LOWORD(wParam));
return TRUE;
}
break;
}
return FALSE;
}
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////



GeneralRe: OLE controll for Powerpoint Pin
David Crow24-Nov-07 16:54
David Crow24-Nov-07 16:54 
QuestionHow to use SetBkColor in ListCtrl Pin
Max++20-Nov-07 2:26
Max++20-Nov-07 2:26 
AnswerRe: How to use SetBkColor in ListCtrl Pin
David Crow20-Nov-07 2:30
David Crow20-Nov-07 2:30 
AnswerRe: How to use SetBkColor in ListCtrl Pin
Gofur Halmurat20-Nov-07 10:55
Gofur Halmurat20-Nov-07 10:55 
Questionpop up menu Pin
anithavikram(manisha)20-Nov-07 1:52
anithavikram(manisha)20-Nov-07 1:52 
AnswerRe: pop up menu Pin
David Crow20-Nov-07 2:32
David Crow20-Nov-07 2:32 
GeneralRe: pop up menu Pin
jhwurmbach20-Nov-07 5:16
jhwurmbach20-Nov-07 5:16 
GeneralRe: pop up menu Pin
David Crow20-Nov-07 5:21
David Crow20-Nov-07 5:21 
GeneralRe: pop up menu Pin
anithavikram(manisha)20-Nov-07 18:04
anithavikram(manisha)20-Nov-07 18:04 
GeneralRe: pop up menu Pin
David Crow21-Nov-07 3:12
David Crow21-Nov-07 3:12 
AnswerRe: pop up menu Pin
jhwurmbach20-Nov-07 5:18
jhwurmbach20-Nov-07 5:18 
QuestionHow to not draw items as they are being added Pin
bender8120-Nov-07 1:29
bender8120-Nov-07 1:29 
AnswerRe: How to not draw items as they are being added Pin
David Crow20-Nov-07 2:35
David Crow20-Nov-07 2:35 
GeneralRe: How to not draw items as they are being added Pin
bender8120-Nov-07 3:30
bender8120-Nov-07 3:30 
Questionquery on object assignment Pin
KASR120-Nov-07 1:28
KASR120-Nov-07 1:28 
AnswerRe: query on object assignment Pin
Nibu babu thomas20-Nov-07 2:02
Nibu babu thomas20-Nov-07 2:02 
QuestionRe: query on object assignment Pin
David Crow20-Nov-07 2:37
David Crow20-Nov-07 2:37 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.