Click here to Skip to main content
15,922,419 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Where to put delete[] to prevent memory leaks? Pin
CPallini23-Nov-07 2:18
mveCPallini23-Nov-07 2:18 
GeneralRe: Where to put delete[] to prevent memory leaks? Pin
Nelek23-Nov-07 4:20
protectorNelek23-Nov-07 4:20 
GeneralRe: Where to put delete[] to prevent memory leaks? Pin
CPallini23-Nov-07 5:28
mveCPallini23-Nov-07 5:28 
GeneralRe: Where to put delete[] to prevent memory leaks? Pin
Nelek25-Nov-07 21:22
protectorNelek25-Nov-07 21:22 
GeneralRe: Where to put delete[] to prevent memory leaks? Pin
CPallini25-Nov-07 21:41
mveCPallini25-Nov-07 21:41 
GeneralRe: Where to put delete[] to prevent memory leaks? Pin
Priya_Sundar25-Nov-07 22:34
Priya_Sundar25-Nov-07 22:34 
GeneralRe: Where to put delete[] to prevent memory leaks? Pin
Priya_Sundar23-Nov-07 0:41
Priya_Sundar23-Nov-07 0:41 
AnswerYou don't need such a mess Pin
CPallini23-Nov-07 0:09
mveCPallini23-Nov-07 0:09 
GeneralRe: You don't need such a mess Pin
Priya_Sundar23-Nov-07 0:39
Priya_Sundar23-Nov-07 0:39 
GeneralRe: You don't need such a mess Pin
CPallini23-Nov-07 0:52
mveCPallini23-Nov-07 0:52 
GeneralRe: You don't need such a mess Pin
Priya_Sundar23-Nov-07 1:03
Priya_Sundar23-Nov-07 1:03 
GeneralRe: You don't need such a mess Pin
CPallini23-Nov-07 2:34
mveCPallini23-Nov-07 2:34 
GeneralRe: You don't need such a mess Pin
Priya_Sundar25-Nov-07 22:29
Priya_Sundar25-Nov-07 22:29 
QuestionVC++ 6 debugging problem Pin
shine joseph22-Nov-07 22:42
shine joseph22-Nov-07 22:42 
AnswerRe: VC++ 6 debugging problem Pin
KarstenK22-Nov-07 23:23
mveKarstenK22-Nov-07 23:23 
GeneralRe: VC++ 6 debugging problem Pin
shine joseph27-Nov-07 1:07
shine joseph27-Nov-07 1:07 
Questionhow to print the value from registry Pin
dadacncn22-Nov-07 22:40
dadacncn22-Nov-07 22:40 
AnswerRe: how to print the value from registry Pin
CPallini22-Nov-07 22:57
mveCPallini22-Nov-07 22:57 
GeneralRe: how to print the value from registry Pin
dadacncn23-Nov-07 1:16
dadacncn23-Nov-07 1:16 
GeneralYou are welcome Pin
CPallini23-Nov-07 2:30
mveCPallini23-Nov-07 2:30 
GeneralRe: how to print the value from registry Pin
ThatsAlok23-Nov-07 18:58
ThatsAlok23-Nov-07 18:58 
AnswerRe: how to print the value from registry Pin
Hamid_RT23-Nov-07 19:49
Hamid_RT23-Nov-07 19:49 
QuestionOLE And Powerpoint Using Non MFC Pin
Soumyadipta22-Nov-07 22:33
Soumyadipta22-Nov-07 22:33 
I have created a project using visual studio 2005 ,the details are given below.

I want to open power point slide and want to navigate this slides.Cry | :((


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;
}
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////



AnswerRe: OLE And Powerpoint Using Non MFC Pin
Jhony george22-Nov-07 23:26
Jhony george22-Nov-07 23:26 
GeneralRe: OLE And Powerpoint Using Non MFC Pin
Soumyadipta26-Nov-07 0:44
Soumyadipta26-Nov-07 0:44 

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.