|
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.
|
|
|
|
|
I am not using Unicode. How can I read and write Chinese strings, say I had to read chinese strings from a file and display them on a dialog, will I be able to do that in a non-Unicode MFC application?
Switching to Unicode would be the last thing I want to do since I link to non-unicode Libraries.
|
|
|
|
|
On what platform is the program going to be run?
|
|
|
|
|
|
|
Chinese text encoded with GB 2312 (CP936, Simplified Chinese) or Big-5 (CP950, Traditional Chinese) can be displayed in static or edit controls in MBCS apps if you adjust the font and it's properties.
For Simplified Chinese for example (m_font is CFont member of your dialog class):
LOGFONT lf;
memset(&lf, 0, sizeof(LOGFONT));
lf.lfCharSet = GB2312_CHARSET;
strcpy(lf.lfFaceName, "System");
lf.lfHeight = 17;
m_font.CreateFontIndirect(&lf);
GetDlgItem(IDC_EDIT)->SetFont(&m_font);
You'll have to run this on a Chinese system or at least set your system locale to Chinese.
The same goes for Korean and Japanese.
modified on Friday, October 23, 2009 4:00 AM
|
|
|
|
|
I have solved this in non-wizard generated applications by creating a virtual window in CMAinWin::CMainWin just after Create() is called using CDC and CBitmap. I use CClientDC to dreate the device context. However when I try to add this code to the wizard generated code in what I think is the same part of the code it compiles and links fine but I an assertion error at run-time. I hope this makes sense, I have been pounding my head for 3 days now. I could just settle for what I have but I would really like to use the new stuff. this is in MFC single document.
Is CClientDC the proper class to use for getting the device context for the main window?
If so, where in the new project do I create my virtual window?
I've tried every where I could think of with the same results.
Thanks for any help
Terry S.
SimpleCodr
modified on Thursday, October 22, 2009 2:05 PM
|
|
|
|
|
SimplCodr wrote: I have solved this in non-wizard generated applications by creating a virtual window in CMAinWin::CMainWin just after Create() is called using CDC and CBitmap.
What? What problem? Virtual Window?!
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]
|
|
|
|
|
If I was an expert I would not need the help. Thanks for giving it your best shot though.
|
|
|
|
|
If I had superpowers then I would guess what your problem was...Unfortunately I need a bit more info in order to help you in any way.
Your question isn't clear at all, for instance, what have you solved? Could you please include more context info? Could you please elaborate a bit? May I ask you politely to report the relevant code and the compiler error message?
As for my best shot, you're completely wrong: it is by no mean reserved to you.
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]
|
|
|
|
|
I hope this clarifies a bit, if not I am too stupid to ask a question so I'll give up.
The following code works great to redraw (i think that's right) the screen anytime it is resized, minimized or covered by another window as long as the application uses the method below for creating a window.
The problem I am having is when I add the CClientDC dc(this); to a wizard generated Single or multiple document MFC application my application crashes at run-time with a debug assertion error.
How can achieve the same results in a single or multiple document MFC application created in VS2005 using the wizard?
CMainWin::CMainWin()
{
RECT r;
r.top = 200;
r.left = 300;
r.bottom = 500;
r.right = 700;
Create(NULL, "COM View", WS_OVERLAPPEDWINDOW, r,
NULL, "TextMenu");
if(!LoadAccelTable("TextMenu"))
MessageBox("Cannot load accelerator table.", "Error");
m_X = m_Y = 0;
maxX = GetSystemMetrics(SM_CXSCREEN);
maxY = GetSystemMetrics(SM_CYSCREEN);
CClientDC dc(this);
m_memDC.CreateCompatibleDC(&dc);
m_bmp.CreateCompatibleBitmap(&dc, maxX, maxY - 10);
m_memDC.SelectObject(&m_bmp);
m_bkbrush.CreateStockObject(WHITE_BRUSH);
m_memDC.SelectObject(&m_bkbrush);
m_memDC.PatBlt(0, 0, maxX, maxY, PATCOPY);
m_AnsiVarFont.CreateStockObject(ANSI_VAR_FONT);
m_SystemFont.CreateStockObject(SYSTEM_FONT);
}
afx_msg void CMainWin::OnPaint()
{
CPaintDC dc(this);
dc.BitBlt(0, 0, maxX, maxY, &m_memDC, 0, 0, SRCCOPY);
}
void CMainWin::OnLButtonDblClk(UINT nFlags, CPoint point)
{
strcpy_s(str, "Hello World");
m_memDC.TextOutA(point.x, point.y, str, strlen(str));
InvalidateRect(NULL);
OnPaint();
CFrameWnd::OnLButtonDblClk(nFlags, point);
}
Header File Stuff
class CMainWin : public CFrameWnd
{
public:
int m_X, m_Y;
char m_str[255];
DCB dcb;
CDC m_memDC;
CBitmap m_bmp;
CBrush m_bkbrush;
CFont m_SystemFont, m_AnsiVarFont;
HANDLE Ser1;
CMainWin();
afx_msg void OnPaint();
afx_msg void OnExit();
DECLARE_MESSAGE_MAP()
public:
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
public:
afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point);
private:
CToolBar m_wndToolBar;
CStatusBar m_wndStatusBar;
};
I hope someone help, thanks again.
|
|
|
|
|
Why didn't you check the Create return value?
What assertion is failing? Have you looked at call-stack debug window?
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]
|
|
|
|
|
Create(), CreateEx() are not used in the Wizard generated MFC document applications at least not as far as I can tell. That is the problem... The Wizard generated application uses a method for creating the window that I cant really nail down. Many files are created myappView, myDoc, mainFrm header files and source files not including the stdafx files. I have tried to implement the virtual window code in the Wizard generated applications and cant get beyond the CClientDC issue. If I cant get a pointer to the current views DC I cant create the virtual window for storing text etc..
How can I create a pointer to the device context of the current view in VS2005 created MFC single document application?
I am not fimiliar with the call-stack debug window I will look into that.
|
|
|
|
|
SimplCodr wrote: How can I create a pointer to the device context of the current view in VS2005 created MFC single document application?
You may create it, for instance, inside the OnCreate message handler of the view. That wouldn't crash your application, anyway you probably won't get what your want.
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]
|
|
|
|
|
Is there a better method for repainting the screen when it is sized or minimized so the text is not lost? If so could you point me in the general direction.
|
|
|
|
|