|
Why dont you use CWnd::SetFont() for this purpose? Instead of above code.
|
|
|
|
|
Hi,
instead: pWnd->SetFont (&LabelFont, TRUE);
use: pDC->SelectObject( LabelFont );
and don't forget about delete font object
LabelFont->DeleteObject();
Works pretty good
-----------
Mila
|
|
|
|
|
Mila025 wrote: use: pDC->SelectObject( LabelFont );
Why?
SetFont can be called from OnInitDialog . As it needs to be set once. Why you want to set it again and again.(it will be called each time window is painted).
|
|
|
|
|
OK, that sounds good just setting it once.
But how do I select the control I want to change the Font in OnInitDialog?
I was selecting the ones in the OnCtlColor procedure.
Andy.
|
|
|
|
|
Hi,
GetDlgItem( IDC_STATIC_COMMAND )->SetFont( &LabelFont, TRUE );
-----------
Mila
|
|
|
|
|
Andy202 wrote: But how do I select the control I want to change the Font in OnInitDialog?
CWnd *pWnd=GetDlgItem(IDC_STATIC);
pWnd->SetFont();
|
|
|
|
|
Thanks Prasad, all working as required.
Using this I can make my Dialogs a bit more interesting.
est wishes,
Andy.
|
|
|
|
|
|
Hi,
Yes you're right, it can be used with CWnd::SetFont.
I wrote only a little correction to Andy202s code
-----------
Mila
|
|
|
|
|
If you have a variable for their you can use of m_Static.SetFont(GetFont());
|
|
|
|
|
See the Extras section of this article.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
The situation is :
-launch of release application using my COm object => memory leaks when I use Function to get data with an SafeArray.
- launch of release application in VC++ 6.0 with debug => no memory leak.
What is the difference, what are dll that are used? Have someone an explication?
Thank you for a response and help
LOUIS Christian
|
|
|
|
|
Post code, that giving this problem.
|
|
|
|
|
|
Hi,
For some odd reason, I am not able to Register the COleDropTarget.
I have been working with my project for a while, so I suspect it is
something within my project.
I do have the member variable COleDropTarget m_dropTarget in the header.
Then, in the OnInitialUpdate, I call m_dropTarget.Register(this).
// register drop target
BOOL b = m_dropTarget.Register(this);
It keeps failing at the if(CoLockObjectExternal()) shown below.
Does anybody know what CoLockObjectExternal means?
BOOL COleDropTarget::Register(CWnd* pWnd)
{
ASSERT_VALID(this);
ASSERT(m_hWnd == NULL);
ASSERT_VALID(pWnd);
LPUNKNOWN lpUnknown = (LPUNKNOWN)GetInterface(&IID_IUnknown);
ASSERT(lpUnknown != NULL);
if (CoLockObjectExternal(lpUnknown, TRUE, FALSE) != S_OK)
return FALSE;
|
|
|
|
|
Hi,
I write a dll which will be loaded by different application. Currently, I need to share some data between the same dlls loaded in different processes. How can I do? Is there a simple way?
I consider to use a file to stored the data shared. But I must write/read the data frequently. So I think use file is not a good way.
|
|
|
|
|
|
You can place the data into a shared data segment.
Be sure to protect access to it with some sort of thread-safe synchronization mechanism.
Any sufficiently gross incompetence is nearly indistinguishable from malice.
|
|
|
|
|
Good day everyone,
I'm doing a project with Vc++6.0 database MS Access
I'm struggling with the connection and coding with database.
Does anyone know where I can get a tutorial of how to connect to database and manipulate with data?
Thanks for your help in advance.
|
|
|
|
|
abrakadbra wrote: Does anyone know where I can get a tutorial of how to connect to database and manipulate with data?
Here[^]
|
|
|
|
|
See Microsoft Access in this[^] link
|
|
|
|
|
abrakadbra wrote: Does anyone know where I can get a tutorial of how to connect to database and manipulate with data?
I show how to do that here.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
I keep getting this error from the compiler which I'm trying to decipher (if it even is an error), that pops up and misteriously disappears with no realation to the changes I've made to the code.
ReflectRefract virtual void * __thiscall std::length_error::`vector deleting destructor'(unsigned int)" (??_Elength_error@std@@UAEPAXI@Z) from CChildWndArranger.obj
Replaced symbol(s):
"public: virtual void * __thiscall std::logic_error::`scalar deleting destructor'(unsigned int)" (??_Glogic_error@std@@UAEPAXI@Z) from CChildWnd.obj
"public: virtual void * __thiscall std::out_of_range::`scalar deleting destructor'(unsigned int)" (??_Gout_of_range@std@@UAEPAXI@Z) from CChildWnd.obj
and this other error
ReflectRefract virtual __thiscall std::length_error::~length_error(void)" (??1length_error@std@@UAE@XZ) from CChildWndArranger.obj
Replaced symbol(s):
"public: virtual __thiscall std::logic_error::~logic_error(void)" (??1logic_error@std@@UAE@XZ) from CChildWnd.obj
"public: virtual __thiscall std::out_of_range::~out_of_range(void)" (??1out_of_range@std@@UAE@XZ) from CChildWnd.obj
I'm using VS .NET 2002 sp1. Help would be greatly appreciated.
|
|
|
|
|
Can you show code, probably causing this error?
|
|
|
|
|
I am working on an MFC application (Visual Studio/C++) that has to grab a screen shot from a frame grabber and send it to the default printer with landscape orientation. This has to be done with no operator intervention other than clicking on a "Print" button in the main dialog - no preview or print dialog. I'm able to grab the frame, but I'm having no success with the printing.
Any help would be greatly appreciated.
Bob.
|
|
|
|