|
Iain Clarke wrote: the only problem with it is that so much software is written arrogantly, assuming it has the right to piddle all over my machine
Couldn't agree more - that's why I've always (since we started using Windows 2000) been an advocate of doing all development work (or testing, at very least) as a non-privileged user, rather than as admin. That's the only way I can be reasonably sure that I've implemented solutions that are appropriate for the environment in which they're to be deployed - or alternatively be able to identify exactly where you have to step outside the security limitations.
|
|
|
|
|
I do test under a limited user, but I don't develop that way - too much of a pain. But if my code breaks my machine, at least it's my own fault...
Quite a lot of my work is interfacing with other peoples hardware libraries, so opening up the odd security hole for them can be a bit painful for my principles.
Iain.
|
|
|
|
|
Iain Clarke wrote: [rant]
You (not necessary Mr Dootson) have sold me a game. What possible justification can you give to get me to give you admin rights? It's handy for you? Tough, write better code.
[/rant]
[counter-rant]
You have bought, if have you (not necessary Mr Clarke ), the game. Now, how can that game meet all your expectations about its performances without hacking your machine? So, please, first make it admin and then bomb Los Angeles!
[/counter-rant]
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: So, please, first make it admin and then bomb Los Angeles!
While I do have a powerful machine at home, I have yet to connect my USB powered stealth bomber... (cordless, of course...)
Would a USB xmas tree do the job? Or nerf missiles? I can borrow then...
Iain.
|
|
|
|
|
Iain Clarke wrote: Would a USB xmas tree do the job? Or nerf missiles? I can borrow then...
Have you a USB xmas tree ?
I shoud know you have it: UK is far more advanced than Italy ...
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]
|
|
|
|
|
|
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.
|
|
|
|