|
theCPkid wrote: to add to warrior panda's reply
Hey, don't insult him, he is a viking, not a panda. Carefull or you'll end up with an axe in your head...
|
|
|
|
|
Cedric Moonen wrote: Hey, don't insult him, he is a viking, not a panda
Yes, but he looks like a Valkyrie...
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
1. get the coordinates of the two points on the 'top' edge. (this assumes one of them is the anchor point of the rotation)
2. find the change in x and change in y (dx and dy)
3. use atan(dy/dx) (or atan2(dy/dx)) to find the angle in radians of the line that connects them
watch out for div by 0
|
|
|
|
|
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;
cProcesses = cbNeeded / sizeof(DWORD);
for ( i = 0; i < cProcesses; i++ )
{
if( aProcesses[i] != 0 )
{
TCHAR szProcessName[MAX_PATH] = _T("<unknown>");
HWND hwnd;
HANDLE hProcess = OpenProcess( PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, FALSE, aProcesses[i] );
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
|
|
|
|
|
Try putting this line at top of file.
#pragma comment(lib, "Oleacc.lib")
|
|
|
|
|
Did you link your project with Oleacc library, because AccessibleObjectFromWindow()[^] needs this library.
North 2009 wrote: HRESULT hr = AccessibleObjectFromWindow(hwnd, OBJID_NATIVEOM, __uuidof(Excel::Window), (void**)
Also this line contains syntactic errors.
Nuri Ismail
|
|
|
|
|
|
In the above code, I'm getting HRESULT hr ="E_FAIL".
main objective is to get value in pWindow. I might have missed some link.
Any suggestions? Thanks in advance.
|
|
|
|
|
You never set hwnd to a valid window handle.
In general, if you get an error return, you can use GetLastError() to find out why.
|
|
|
|
|
How to i send files to a network printer without opening the files.
I need to do it programmatically without too much fuss
I don't really want to use a purchased third party component - though I'd be happy to look at free or open source ones if people know of any.
I hav tried sending it to local printer with success, but i need to send it to a network printer.
|
|
|
|
|
If they have an associated application (e.g., Notepad, Word, Adobe), you may can use ShellExecute() with the print verb.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Hi,
I wonder can hide the edit control box in MFC? Is there any tutorial to do it?
Thx. I'm waiting here for your reply. 
|
|
|
|
|
Use m_edit.ShowWindow( SW_HIDE ) to hide to Edit control. Just have look on various member of CEdit [^]
Величие не Бога может быть недооценена.
|
|
|
|
|
You can use the ShowWindow Function[^]
If you have a member variable:
m_YourCombo.ShowWindow(SW_HIDE);
If you do not use a member variable:
CWnd *pWnd = GetDlgItem(IDC_YOURCOMBOID);
if(NULL != pWnd)
pWnd->ShowWindow(SW_HIDE);
Best Wishes,
-David Delaune
|
|
|
|
|
got it!.Thank you 
|
|
|
|
|
Please mark his answer as "Good Answer" and close your thread. I've done it for you now.
“Follow your bliss.” – Joseph Campbell
|
|
|
|
|
Rajesh R Subramanian wrote: I've done it for you now.
Me too: Randor for president.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
CPallini wrote: Me too: Randor for president.
But I want to be King Randor[^]
Best Wishes,
-David Delaune
|
|
|
|
|
I need to write a program in C (on Linux) that tells a webcam when to take a photo. Can anyone give me some resources or tips for how to get started with this? I don't really know how to go about doing this.
I am using a Logitech webcam, so I looked at their website, and they suggest I use DirectShow, but that seems to be available only for Windows. Like I said, a few nudges in the right direction would be greatly appreciated.
|
|
|
|
|
Hi,
wxCam[^] might be of your interest.
From the project page:
wxCam is a webcam application for linux. It supports video recording (in an avi uncompressed and Xvid format), snapshot taking, ...
“Follow your bliss.” – Joseph Campbell
|
|
|
|
|
Hello,
I'm maintaining an application that has a number of fairly simple reports displayed in a CScrollView, that use MFC's print/ print preview facilities, writing to a CDC (device context). I'd like to add some bar charts to the reports, to graph information (generally, how much of something occurred in a specified time period). It would be particularly useful if I could use "stacked" barcharts, where the bar is comprised of more than one type of record, grouped together.
I've had excellent results with Cedric Moonen's high speed charting control when I needed this sort of functionality in dialogs (without the "stacked" charts, though). However, even after searching codeproject I'm not aware of any free or commercially available licence that is suitable for the task I've described. It wouldn't have to be explicitly an MFC library, just something that will get the job done.
Regards,
Sternocera
|
|
|
|
|
Sternocera wrote: It would be particularly useful if I could use "stacked" barcharts, where the bar is comprised of more than one type of record, grouped together.
I'm not very familiar with stacked bars but if you wish, we can discuss that over mail and see if this is feasible to implement them in the charting control. If I have time and if it is not too long I can add that functionality, otherwise I could still guide you a bit on how to implement them.
I plan to add some features to the control, so this could be a nice improvement.
|
|
|
|
|
Hi Cédric,
Great work with the charting control.
The idea of a "stacked" bar (which is a name I just made up - there may be a better one) is that you can breakdown a bar into multiple sub-bars.
Take a look at this image, generated with crystal reports:
http://imagebin.ca/view/v2bIgfH5.html
Can you think of a way of using you charting control within a CScrollView, writing to a device context?
Regards,
Sternocera
modified on Friday, October 23, 2009 8:50 AM
|
|
|
|
|
Hello,
I have a very simple application for testing purposes with a dialog and an Edit field, this Edit field has Customers Info, Like Address.. How can I display the text enetered in the edit field in chinese language assuming I have the translated Text.
I know how to use a a Satellite DLL, but I was wondering if it is possible to just change the text without going thru all the resources.
|
|
|
|
|
Is your application built with Unicode support? If yes, just use something like SetWindowText to set the text you want. If not, you'll need to use the rich edit control instead.
|
|
|
|
|