|
|
Actually food stereotypes are pretty true for my family.
Iain Clarke wrote: [*] Why doesn't my supermarket stock the extra slutty kind...
We've the real thing, my father-in-law makes it.
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]
|
|
|
|
|
Sir,
I have a MS Access 2003 database which have a data field(a column) with ASCII font.Now,I need the database to be supported by unicode 5.1 norms.Do conversion from mdb to SQLite3 will meet the requirement?Do I have to convert the entire data to a new unicode 5.1 enabled font?.Please help me.
|
|
|
|
|
There is a general database forum where you might get help.
I certainly have no clue about your problem... And as I am the bestest ever expert at C++, noone else will.
(Ok, they might...)
Iain.
|
|
|
|
|
OK. This time you've hit the target [^].
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: This time you've hit the target
Iain, The Masterful Visionary Potentate.
|
|
|
|
|
A database column with a font?
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Mark Salsbery wrote: A database column with a font?
The last resort to evangelize software developers.
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]
|
|
|
|
|
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
I am using the picture control as horizontal line in my dialog with height 2 pixel.
How to change its color?
Advance thanks for help!!
|
|
|
|
|
Handle the WM_CTLCOLORSTATIC message and return the required brush.
« Superman »
|
|
|
|
|
The color is changed only after I changed Picture control type to image.
Thanks
|
|
|
|
|
I think it desont work if you change type of static control to horizontal.
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
Hai All
Crash occured while displaying Color Chooser Dialog form a Property Sheet
CHOOSECOLOR* pstChooseColor = new CHOOSECOLOR;
ZeroMemory( pstChooseColor, sizeof( CHOOSECOLOR ));
pstChooseColor->Flags = CC_RGBINIT;
pstChooseColor->lStructSize = sizeof( CHOOSECOLOR );
pstChooseColor->hwndOwner = m_hWnd;
pstChooseColor->rgbResult = ConfigMgr::Instance().GetBkColor();
ChooseColor( pstChooseColor );
called from the DialogProc of PropertyPage
case WM_COMMAND:
{
int nCtrlCode = LOWORD( wParam_i );
if( IDC_BTN_CHANGE_COLORS == nCtrlCode )
{
pDisplaySettingsPage->OnChangeColor();
}
}
break;
Please help
|
|
|
|
|
Use your debugger to track the problem more in detail. Where does the crash occur exactly ? What does the call stack look like ?
|
|
|
|
|
COMDLG32! 763bdbd2()
COMDLG32! 763bdf24()
USER32! 77d48709()
USER32! 77d551cd()
USER32! 77d54af2()
USER32! 77d54d1c()
USER32! 77d48709()
USER32! 77d487eb()
USER32! 77d4b743()
USER32! 77d558ef()
USER32! 77d56877()
USER32! 77d568cc()
COMDLG32! 763bedf2()
COMDLG32! 763bf019()
DisplaySettingsPage::OnChangeColor() line 91 + 12 bytes
DisplaySettingsPage::DisplaySettingsPageDlgProc(HWND__ *
May be useful
|
|
|
|
|
Radhakrishnan G. wrote: May be useful
Not really for us. In fact for these kind of problems, you'll have to find the root cause yourself and fix it. There's no magic way of solving the problem. Use the call stack to locate the problem in your code, put breakpoints before the crash occur and inspect the different variables.
The exception means that you are trying to access an invalid memory region (e.g reading or writing to a NULL pointer, ...)
|
|
|
|
|
Radhakrishnan G. wrote: pDisplaySettingsPage->OnChangeColor();
I saw the callstack and could you please check whether pDisplaySettingsPage a valid pointer when the function is being called?
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
Here is the code of Dialog Proc
INT_PTR CALLBACK DisplaySettingsPage::DisplaySettingsPageDlgProc( HWND hWnd_i,
UINT uMessage_i,
WPARAM wParam_i,
LPARAM lParam_i )
{
DisplaySettingsPage* pDisplaySettingsPage = reinterpret_cast<displaysettingspage*>( GetWindowLong( hWnd_i, GWL_USERDATA ));
switch (uMessage_i)
{
case WM_INITDIALOG:
{
pDisplaySettingsPage = reinterpret_cast<displaysettingspage*>( lParam_i );
if( 0 != pDisplaySettingsPage )
{
SetWindowLong( hWnd_i, GWL_USERDATA, lParam_i );
pDisplaySettingsPage->m_hWnd = hWnd_i;
pDisplaySettingsPage->OnInitDialog();
}
return TRUE;
}
break;
case WM_CTLCOLORSTATIC:
{
if( IDC_STATIC_BKCOLOR == GetDlgCtrlID( (HWND)lParam_i ))
{
RECT stRect;
GetClientRect( (HWND)lParam_i, &stRect );
FillRect( (HDC)wParam_i, &stRect, pDisplaySettingsPage->m_hBkBrush);
return (BOOL)GetStockObject(NULL_BRUSH);
}
}
break;
case WM_NOTIFY:
{
NMHDR* pstNMHDR = reinterpret_cast< NMHDR*>( lParam_i );
if( PSN_APPLY == pstNMHDR->code )
{
}
}
break;
case WM_COMMAND:
{
int nCtrlCode = LOWORD( wParam_i );
if( IDC_BTN_CHANGE_COLORS == nCtrlCode )
{
pDisplaySettingsPage->OnChangeColor();
}
}
break;
}
return DefWindowProc( hWnd_i, uMessage_i, wParam_i, lParam_i );
}
Here is the Display setting page class
class DisplaySettingsPage
{
public:
DisplaySettingsPage();
~DisplaySettingsPage();
operator LPPROPSHEETPAGE();
static INT_PTR CALLBACK DisplaySettingsPageDlgProc( HWND hWnd_i, UINT uMessage_i,
WPARAM wParam_i, LPARAM lParam_i );
void OnInitDialog();
void OnChangeColor();
private:
HWND m_hWnd;
HBRUSH m_hBkBrush;
PROPSHEETPAGE m_stPropertyPage;
};
Initializing Property page information in constructor
DisplaySettingsPage::DisplaySettingsPage() : m_hWnd( 0 ),
m_hBkBrush( 0 )
{
ZeroMemory( &m_stPropertyPage, sizeof( PROPSHEETPAGE ));
m_stPropertyPage.dwSize = sizeof( PROPSHEETPAGE );
m_stPropertyPage.dwFlags = PSP_DEFAULT;
m_stPropertyPage.pszTemplate = MAKEINTRESOURCE( IDD_DISPLAY_SETTINGS_PAGE );
m_stPropertyPage.lParam = reinterpret_cast<lparam>( this );
m_stPropertyPage.hInstance = GetModuleHandle( 0 );
m_stPropertyPage.pfnDlgProc = DisplaySettingsPageDlgProc;
}</lparam>
modified on Tuesday, January 6, 2009 5:55 AM
|
|
|
|
|
Radhakrishnan G. wrote: DisplaySettingsPage* pDisplaySettingsPage = reinterpret_cast<displaysettingspage*>( GetWindowLong( hWnd_i, GWL_USERDATA ));
is there two different classes - DisplaySettingsPage & displaysettingspage? Or is it a typo while pasting the source code?
Whether DisplaySettingsPage::m_hWnd holds valid handle? Please check by using debugger. If that one doesn't give you any hint, please post code snippet for OnChangeColor() .
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
The crash occurs because you haven't set value of lpCustColors in the code.
COLORREF clrCust[16] = {0};
pstChooseColor->lpCustColors = clrCust;
ChooseColor( pstChooseColor );
Radhakrishnan G. wrote: Crash occured while displaying Color Chooser Dialog form a Property Sheet
1. Why did you say the crash is from property sheet?I think the crash should occur in all cases, not only when called from property sheet
|
|
|
|
|
Got the solution
code is updated with
CHOOSECOLOR* pstChooseColor = new CHOOSECOLOR;
COLORREF crCustomColorArray[ 16 ];
ZeroMemory( pstChooseColor, sizeof( CHOOSECOLOR ));
pstChooseColor->Flags = CC_RGBINIT;
pstChooseColor->lStructSize = sizeof( CHOOSECOLOR );
pstChooseColor->hwndOwner = m_hWnd;
pstChooseColor->lpCustColors = crCustomColorArray;
pstChooseColor->rgbResult = ConfigMgr::Instance().GetBkColor();
if( FALSE != ChooseColor( pstChooseColor ))
{
ConfigMgr::Instance().SetBkColor( *pstChooseColor->lpCustColors );
}
delete pstChooseColor;
pstChooseColor = 0;
Thanks
|
|
|
|
|
I know you've fixed your problem - just a comment on style. Why not use a locally declared CHOOSECOLOR rather than one on the heap? That way, you don't need to remember to delete it.
Your (fixed) code would look like this:
CHOOSECOLOR stChooseColor = { 0 };
COLORREF crCustomColorArray[ 16 ] = { 0 };
stChooseColor.Flags = CC_RGBINIT;
stChooseColor.lStructSize = sizeof( CHOOSECOLOR );
stChooseColor.hwndOwner = m_hWnd;
stChooseColor.lpCustColors = crCustomColorArray;
if( FALSE != ChooseColor( &stChooseColor ))
{
ConfigMgr::Instance().SetBkColor( *stChooseColor.lpCustColors );
}
I know it's not a big change, but using the stack for variable storage when possible makes memory management so much easier
One other thing - doesn't ChooseColor pass back the user's selected color in the rgbResult member, rather than in lpCustColors[0] , as you've used? That's what the documentation[^] says, anyway.
|
|
|
|
|
Yes thats was the Mistake in the code
I already corrected that..
Thanks.
|
|
|
|
|
Hey everybody!
I got a weird problem...
I wrote a service that in startup run CreateService to get handle to another service (which is a file system driver...).
For some weird reason the call halts for 2.5 minutes and continues successfully after that.
Does anyone have any idea what might be the problem?
THANKS!!!
|
|
|
|