Click here to Skip to main content
16,004,452 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Writing contacts into outlook Pin
Kushagra Tiwari23-Oct-09 0:37
Kushagra Tiwari23-Oct-09 0:37 
Questionfind angle Pin
ankit_akku22-Oct-09 21:48
ankit_akku22-Oct-09 21:48 
AnswerRe: find angle Pin
Iain Clarke, Warrior Programmer22-Oct-09 22:20
Iain Clarke, Warrior Programmer22-Oct-09 22:20 
AnswerRe: find angle Pin
theCPkid22-Oct-09 22:46
theCPkid22-Oct-09 22:46 
JokeRe: find angle Pin
Cedric Moonen22-Oct-09 22:56
Cedric Moonen22-Oct-09 22:56 
JokeRe: find angle Pin
CPallini22-Oct-09 23:15
mveCPallini22-Oct-09 23:15 
AnswerRe: find angle Pin
Chris Losinger23-Oct-09 4:41
professionalChris Losinger23-Oct-09 4:41 
Questionfatal error LNK1120: 1 unresolved externals [modified] Pin
NarVish22-Oct-09 21:29
NarVish22-Oct-09 21:29 
After adding the below line,
HRESULT hr = AccessibleObjectFromWindow(hwnd, OBJID_NATIVEOM, __uuidof(Excel::Window), (void**)
getting compiler error: "fatal error LNK1120: 1 unresolved externals"
Complete code is given below.

#include "stdafx.h"
#include "stdio.h"
#include "windows.h"
#include "tchar.h"
#include "psapi.h"
#include "oleacc.h"
#include "iostream"
#include "string"
#include "sstream"
using namespace std;
 
#import "libid:00020813-0000-0000-C000-000000000046" auto_search no_dual_interfaces \
	rename("DialogBox", "excelDialogBox") \
	rename("RGB", "excelRGB") \
	rename("DocumentProperties", "excelDocumentProperties") \
	rename("SearchPath", "excelSearchPath") \
	rename("CopyFile", "excelCopyFile") \
	rename("ReplaceText", "excelReplaceText")

int _tmain(int argc, _TCHAR* argv[])
{
    DWORD aProcesses[1024], cbNeeded, cProcesses;
    unsigned int i;

    if ( !EnumProcesses( aProcesses, sizeof(aProcesses), &cbNeeded ) )
        return 1;

    // Calculate how many process identifiers were returned.
    cProcesses = cbNeeded / sizeof(DWORD);
    for ( i = 0; i < cProcesses; i++ )
    {
        if( aProcesses[i] != 0 )
	{
	    TCHAR szProcessName[MAX_PATH] = _T("<unknown>");
	    HWND hwnd;
	    // Get a handle to the process.
	    HANDLE hProcess = OpenProcess( PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, FALSE, aProcesses[i] );
	    // Get the process name.
	    if (NULL != hProcess )
	    {
		HMODULE hMod;
		DWORD cbNeeded;
	        if ( EnumProcessModules( hProcess, &hMod, sizeof(hMod), &cbNeeded) )
		{
		       GetModuleBaseName( hProcess, hMod, szProcessName, sizeof(szProcessName)/sizeof(TCHAR) );
  		       if(_wcsicmp(szProcessName,L"EXCEL.EXE") == 0)		 
		       Excel::Window* pWindow = NULL;
		       HRESULT hr = AccessibleObjectFromWindow(hwnd, OBJID_NATIVEOM, __uuidof(Excel::Window), (void**)&pWindow);
		}
	     }
	}
	CloseHandle( hProcess );
      }
   } 
   return 0;
}


modified on Friday, October 23, 2009 6:35 AM

AnswerRe: fatal error LNK1120: 1 unresolved externals Pin
theCPkid22-Oct-09 21:46
theCPkid22-Oct-09 21:46 
QuestionRe: fatal error LNK1120: 1 unresolved externals Pin
Nuri Ismail22-Oct-09 21:48
Nuri Ismail22-Oct-09 21:48 
AnswerRe: fatal error LNK1120: 1 unresolved externals Pin
NarVish22-Oct-09 22:00
NarVish22-Oct-09 22:00 
AnswerRe: fatal error LNK1120: 1 unresolved externals Pin
NarVish23-Oct-09 1:41
NarVish23-Oct-09 1:41 
GeneralRe: fatal error LNK1120: 1 unresolved externals Pin
Hans Dietrich23-Oct-09 3:03
mentorHans Dietrich23-Oct-09 3:03 
QuestionHow to i send files to a network printer without opening the files. Pin
yoga_s22-Oct-09 19:27
yoga_s22-Oct-09 19:27 
AnswerRe: How to i send files to a network printer without opening the files. Pin
David Crow23-Oct-09 3:05
David Crow23-Oct-09 3:05 
QuestionHiding the edit control box in MFC Pin
DevelopmentNoob22-Oct-09 17:53
DevelopmentNoob22-Oct-09 17:53 
AnswerRe: Hiding the edit control box in MFC Pin
Adam Roderick J22-Oct-09 18:01
Adam Roderick J22-Oct-09 18:01 
AnswerRe: Hiding the edit control box in MFC Pin
Randor 22-Oct-09 18:03
professional Randor 22-Oct-09 18:03 
GeneralRe: Hiding the edit control box in MFC Pin
DevelopmentNoob22-Oct-09 19:02
DevelopmentNoob22-Oct-09 19:02 
GeneralRe: Hiding the edit control box in MFC Pin
Rajesh R Subramanian22-Oct-09 20:58
professionalRajesh R Subramanian22-Oct-09 20:58 
GeneralRe: Hiding the edit control box in MFC Pin
CPallini22-Oct-09 21:08
mveCPallini22-Oct-09 21:08 
GeneralRe: Hiding the edit control box in MFC Pin
Randor 22-Oct-09 21:12
professional Randor 22-Oct-09 21:12 
QuestionHow do I write a program that "talks" to a webcam and tells it when to take a photo? Pin
justabeagle22-Oct-09 17:44
justabeagle22-Oct-09 17:44 
AnswerRe: How do I write a program that "talks" to a webcam and tells it when to take a photo? Pin
Rajesh R Subramanian22-Oct-09 21:02
professionalRajesh R Subramanian22-Oct-09 21:02 
QuestionDisplaying a chart in a CScrollView report. Pin
Sternocera22-Oct-09 8:22
Sternocera22-Oct-09 8:22 

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.