|
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.
|
|
|
|
|
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]
|
|
|
|