|
i am trying to make the application frame
just looks like photoshop in windows 2000.
Right now i am having problem to make 4
modeless dialog boxes active (title bars
are all blue) as well as mdi document view
simultaneously. does anyone have solution
to this.
Thanks in advance.
Shinya
|
|
|
|
|
|
I use PostMessage method to update a dialog box through a thread outside of my dialog box class like this:
<br />
CMyThread::update()<br />
{<br />
m_pDlg->PostMessage(UM_UPDATEDIALOG);<br />
}<br />
this code works properly in debug version but in release there is an exception in PostMessage function.
How can I solve this problem.
|
|
|
|
|
I think using PostThreadMessage would be better. Also check how the message queue is handled in your target thread.
~RaGE();
|
|
|
|
|
What is the cause of the exception. I would assume m_pDlg isn't valid at the time it is used.
Neville Franks, Author of ED for Windows. Free Trial at www.getsoft.com
|
|
|
|
|
CWnd* objects are not thread safe, give the thread a copy of the HWND and send a message to that.
Roger Allen
Sonork 100.10016
Were you different as a kid? Did you ever say "Ooohhh, shiny red" even once? - Paul Watson 11-February-2003
|
|
|
|
|
What does UM_UPDATEDIALOG equate to? How does the dialog class respond to the posted message? Maybe the pointer is invalid.
|
|
|
|
|
hi all:
can i add a string table entry in source file.
If yes how to do?
gucy
|
|
|
|
|
IN ResourceView you can find the string table ,double click the blank and enter your string
|
|
|
|
|
I think, some years have 52 weeks while some have 53. Is there a way of using CTime/SPan classes to compute this
|
|
|
|
|
How about do it like that :
COleDateTime ct = COleDateTime( 2003, 12, 31, 23, 59, 59 );
int iNumWeeks = atoi( ct.Format( "%U" ) );
|
|
|
|
|
Hi !
please use the <pre> HTML tags (see Formatting bar under your sig when writing a message) to format your code instead of bold. It is far more readable.
~RaGE();
|
|
|
|
|
I am building a project.I want to write something to registry to save some informatiom.
|
|
|
|
|
Who can give me a sample or a demo?
|
|
|
|
|
Use RegOpenKey, RegQueryValue, RegCloseKey.
You can look for sample code in MSDN, or you can search Google for a whole lot of sample code
You might also find some code on CP
"It was when I found out I could make mistakes that I knew I was on to something."
-Ornette Coleman
|
|
|
|
|
Here are some code snippets, which you may use :
//////////////////////////////////////////////////////
CString GetFromRegistry( CString csRegKeyString, CString csRegKeyField, CString csDefault )
{
CString csResult = csDefault;
CRegKey* pRK = new CRegKey();
LONG lRegOpen = pRK->Open(HKEY_LOCAL_MACHINE, csRegKeyString);
if(lRegOpen == ERROR_SUCCESS)
{
char cValue[1000];
memset( cValue, 0, sizeof( cValue ) );
DWORD dwSize = sizeof( cValue );
LONG lRegQuery = pRK->QueryValue( &(cValue[0]), csRegKeyField, &dwSize );
if(lRegQuery == ERROR_SUCCESS) csResult = cValue;
}
delete pRK;
pRK = NULL;
return( csResult );
}
//////////////////////////////////////////////////////
BOOL SetInRegistry( CString csRegKeyString, CString csRegKeyField, CString csValue )
{
BOOL bResult = FALSE;
CRegKey* pRK = new CRegKey();
LONG lRegSetValue = pRK->SetValue( HKEY_LOCAL_MACHINE, csRegKeyString, csValue, csRegKeyField );
if(lRegSetValue == ERROR_SUCCESS) bResult = TRUE;
delete pRK;
pRK = NULL;
return( bResult );
}
I think there are a lot of complete classes here at codeguru. Use the code above only as an example how you may do it.
Best regards
|
|
|
|
|
|
csc wrote:
I think there are a lot of complete classes here at codeguru.
Codeguru? Don't you mean CodeProject?
|
|
|
|
|
Hi
Anyone can tell me how to lock CD-rom drive
Give some code as eg.
GO ON KIDDING
|
|
|
|
|
In MSDN,KB138434,there's some code to demo this.
|
|
|
|
|
Who can tell me how to change the height of CComBox.
the function CComboBox::Create(..rect.) only modify the size when the
control is dropped down.
gucy
|
|
|
|
|
|
Dave:
First thands a lot,SetItemHeight works very well.
But another question is that how can i change the font size of the ccombobox,i created the control in source file instead of in source view control.i put the control on the toolbar instead of on dialog box.
Can you help me further?
gucy
|
|
|
|
|
Something like:
CFont* pOldFont = m_combo.GetFont();
LOGFONT lf;
memset( &lf, 0, sizeof(LOGFONT) );
pOldFont->GetLogFont( &lf );
CClientDC dc( m_combo );
lf.lfHeight = -MulDiv( PointSize, dc.GetDeviceCaps( LOGPIXELSY ), 72 );
CFont* pNewFont = new CFont();
pNewFont->CreateFontIndirect( &lf );
m_combo->SetFont( pNewFont );
Dave
http://www.cloudsofheaven.org
|
|
|
|
|
Is it Ok (good practice) to include headers within other header files ?
I have a CTimer Class declared in TimerClass.h and implemented within TimerClass.cpp.
I have a CAnimatedSprite class declared in AnimatedSprite.h and implemented within AnimatedSprite.cpp.
Is it alright for the AnimatedSprite.h to #include "TimerClass.h" and for the AnimatedSprite.h to have as a class member CTimer AnimationTimer; ?
Is there a requirement for the CTimer to be a friend of CAnimatedSprite ?
Responses much appreciated,
Wodger
|
|
|
|