|
Hmm, I somehow can't get it working... Do you have a sample source snippet?
Thanks
-Dominik
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
|
|
|
|
|
The frame control is drawn now (the background isn't erased correctly, so if you have a source snippet send it to me, I am not that GUI expert ), but the background of the frame control is always the standard gray. The problem is now that my application uses a custom background color...
I tried to change the background color for the frame control using dc.SetBkColor and/or dc.SetBkMode(TRANSPARENT), but nothing worked, the gray background is drawn independently of what I set as DC background...
How can I make the frame control background drawn as the same as my main dialog background color?
PS: Going to now, so thanks in advance
-Dominik
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
|
|
|
|
|
You can't. But, I have a hint for if you want to draw your own gripper - the gripper glyphs are found in the Marlett font.
"Blessed are the peacemakers, for they shall be called sons of God." - Jesus
"You must be the change you wish to see in the world." - Mahatma Gandhi
|
|
|
|
|
Hmm, I found the font and the symbols, but when I draw them they are only black lines instead of the 3D look. It seems I have to combine symbol 'o' (=white) and symbol 'p' (=dark gray) to make the 3D look
I've done it another way now: I've created an icon that looks like the 3D gripper Much easier
Anyway, thanks for your help
-Dominik
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
|
|
|
|
|
When I create a status bar those lines are there by default
|
|
|
|
|
My dialog-based app doesn't have a status bar
-Dominik
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
|
|
|
|
|
Hi!
I wrote an application where I draw an additional button to the caption of a dialog. This works perfectly for all versions of windows, even for XP when the "classic style" is used. But, if I select an XP theme, I run into a problem: When I handle the WM_NCPAINT message, the caption of the dialog (and also the frame) is not drawn using the corresponding visual style, it is drawn in "classic style"! This looks really ugly.
My SDK is up to date. I tried it with and without a manifest file, it makes no difference. I develop the code under win2k, using vc6. Maybe this is the problem: does anybody know, if this works correctly with vc7?
If anybody has an idea how to solve this problem, please help. I've been trying it for two weeks now any I'm out of ideas...
Thanks in advance,
Marcus.
|
|
|
|
|
AFAICT this is By Design(tm). Since themes change the look of the non-client area, when an app handles WM_NCPAINT (also to change the look of the non-client area), XP turns off the theme so the app's own painting takes precedence. Look at RealPlayer 8 for another example.
--Mike--
"Big handwavy generalizations made from a position of deep ignorance is one of the biggest wastes of time on the net today.
-- Joel Spolsky
Ericahist | Homepage | RightClick-Encrypt | 1ClickPicGrabber
|
|
|
|
|
Thank you for the answer, Mike.
Is it possible, to draw the nonclient area by hand using the correct theme? I know that I can use GetSystemMetrics() to get all dimensions I need. I also know that I can load the theme elements from the uxtheme.dll. But, I'm not sure how to apply them to the window. Do you know how to do that? Any code fragments, links to descriptions or articles would help, too.
Thanks again,
Marcus.
|
|
|
|
|
Hi,
I need to create about three to four modal dialog boxes such that when a button is pressed in the first one it leads to the next and again when a button is pressed in this it leads to the next one and so on..I am a novice in this field and I need some help in this. I tried this:
void CNewoneDlg::OnOK()
{
CDialog aboutDlg(IDD_DIALOG1);
INT_PTR pRet=-1;
aboutDlg.DoModal();
//CDialog::OnOK(); (I tried taking this off...but didnt work either)
}
This works..it leads to the next dialog box on pressing ok..
but..
void CDialog1Dlg::OnOK()
{
CDialog aboutDlg(IDD_DIALOG2);
INT_PTR pRet=-1;
aboutDlg.DoModal();
//CDialog::OnOK();
}
This doesnt lead to the next dialog box on pressing ok..I am confused, since I have used the method in the earlier function..when that can work, why cant (isnt) this?
I desperately need a help..
THANKS
Deepak Samuel
|
|
|
|
|
how do i cast a cstring to bstr?
and from a bstr to cstring..
thanks
|
|
|
|
|
Make BSTR from CString:
Use either CString member function BSTR AllocSysString ( ) const; or BSTR SetSysString( BSTR* pbstr ) const; .
And the other way, I don't really know, but perhaps a simple '=' is enough?
CString strBla = bstrString; ?
-Dominik
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
|
|
|
|
|
|
Thanks people...you are great people to have around..
it worked!
kindest regards
|
|
|
|
|
Well, there are no casting routines.
But you can use these conversion methods of CString:
CString to BSTR: AllocSysString
BSTR to CString : SetSysString
Or you use the _bstr_t class declared in <comdef.h> ,
which is very comfortable.
Jens
|
|
|
|
|
Hi,
I use vector of pointers to my class to store data. I insert them using push_back(). Here is my function for inserting data into vector:
[code]
UINT CVirtualLWItemManager::insertItem(LS_item* pNewItem)
{
// check if current capacity is enough
if (m_vecItems.size() > m_vecItems.capacity())
{
AfxMessageBox("m_vecItems.size() > m_vecItems.capacity()");
return 0;
}
if (m_vecItems.size() == m_vecItems.capacity())
{
// enlarge array
m_vecItems.reserve(m_vecItems.capacity() + 128);
// try again
return insertItem(pNewItem);
}
m_vecItems.push_back(pNewItem);
return 1;
}
[/code]
Here is my function that launches std::sort():
[code]
void CVirtualLWItemManager::sortItems(INT (*sort_cb)(LS_item*, LS_item*))
{
std::sort(m_vecItems.begin(), m_vecItems.end(), sort_cb);
}
[/code]
And here is my static sorting callback function:
[code]
INT CMyFileView::sortCallback(LS_item* pDataFirst, LS_item* pDataSecond)
{
ITEM_DESC* param1 = NULL;
ITEM_DESC* param2 = NULL;
param1 = (ITEM_DESC*) pDataFirst->lParam;
param2 = (ITEM_DESC*) pDataSecond->lParam;
INT iSortColumn = 0;
if (getDoc()->iViewToSort == 1)
iSortColumn = getDoc()->SortingColumnLeft;
else
iSortColumn = getDoc()->SortingColumnRight;
// Nejdrive (..), pak adresar, dale soubor
if (param1->folder > param2->folder)
return -1;
else if (param1->folder < param2->folder)
return 1;
// Trizeni podle zvoleneho sloupce
switch (iSortColumn)
{
// ASCENDING
case 0: // Podle nazvu souboru a adresaru
return param1->name.CompareNoCase((LPCTSTR) param2->name);
case 1: // Podle velikosti
if(param1->size < param2->size)
return -1;
if(param1->size > param2->size)
return 1;
break;
case 2: // Podle data
if (param1->date < param2->date)
return -1;
if (param1->date > param2->date)
return 1;
break;
// DESCENDING
case 3: // Podle nazvu souboru a adresaru
return (param1->name.CompareNoCase((LPCTSTR) param2->name)) * -1;
case 4: // Podle velikosti
if (param1->size < param2->size)
return 1;
if (param1->size > param2->size)
return -1;
break;
case 5: // Podle data
if (param1->date < param2->date)
return 1;
if (param1->date > param2->date)
return -1;
break;
}
return 0;
}
[/code]
The problem is, sometimes pDataSecond parameter passed to this function has invalid parameter, eg. 0xfdfdfdfd.
How is it possible?
Objects that are inserted to the vector are created on the heap.
Thank you a lot for any suggestion.
|
|
|
|
|
At first sight, there're two problems with your code. The first one is not critical, but anyway: The comparison
if (m_vecItems.size() > m_vecItems.capacity()) is always false , so there's no point in checking it. By definition, the size of a vector canot be larger than its capacity. As for
if (m_vecItems.size() == m_vecItems.capacity()) it is not really necessary (vectors grow as necessary automatically), but it can improve performance, so no problem about it.
The real problem (I guess) is that sort expects a comparison predicate that has less-than semantics, i.e. it expects it to return true is the first argument if less than the second, and false otherwise. Your sortCallback has (<0,0,>0) semantics: change it to what I've indicated and things will probably start to work OK. Good luck.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
It works! I just changed return value of the sorting callback from INT to bool, and replaced 1, -1, 0 with true and false and it's ok now.
Thank you Joaquín, you helped me very much!
|
|
|
|
|
How to detect that your PC system has USB version 1.1 or 2.0 using Visual C++? Thank you very much
|
|
|
|
|
Did you know that the standards committee wants to allow makers of USB 1.1 products to rename their product to be USB 2.0 without adding support for the faster speeds? I am not sure how this will affect your results but I wanted to inform you of this. I'll try to find the links..
Here is part of the article on the register (www.register.com):
The trade group responsible for marketing the USB peripheral interface has the older given 1.1 specification a speed-boost -simply by changing its name.
Of course 1.1, superseded by the much speedier 2.0 specification, hasn't really got any faster. But the USB Implementors Forum (USB-IF) has decided that vendors can describe USB 1.1 ports as USB 2.0 ports.
Now they can describe the old specification as "Full Speed" and the newer, 2.0 specification as "High Speed." The Bangkok Post notes that this puts vendors in breach of EU trades description legislations. Whoops.
USB 2.0 was never intended to be branded with a version number. Instead, the USB-IF dubbed it 'Hi-speed USB'. USB 1.1 was to be known as plain old 'USB'. Manufacturers have nevertheless insisted on sticking with the version numbers, which is what seems to have cause all the trouble.
Apparently consumers were shunning older models.
"I now understand the new full-speed and high-speed naming, but what is going to happen when USB 3.0 is released? Is it going to be 'Really High Speed'?," asks an editorial in GeekNews
It's not the first bit of semantic ethnic cleansing we've seen this year. A handful of vendors have hijacked the 4G bandwagon, hoping that this will put them in the driving seat when the real 4G specification is passed.
Here is the link:
http://www.theregister.co.uk/content/54/31349.html[^]
John
|
|
|
|
|
You can use ::GetTopWindow(NULL) to get the HWND of the top window in the Z-order.
Niall
|
|
|
|
|
hi all
does ne1 know if you can write to the
HKEY_LOCAL_MACHINE
i can do it for HKEY_CURRENT_USER, but i cant seem to find
anything on writing to the local_machine
does ne1 know where i can locate some docs on it ?
im using visul studio .net
thanks
si
|
|
|
|
|
It is no different from HKEY_CURRENT_USER just open the root inside of HKEY_LOCAL_MACHINE.
John
|
|
|
|
|
If you can write to CurrentUser, you can also write to LocalMachine. Just use HKEY_LOCAL_MACHINE instead of HKEY_CURRENT_USER...
Accessing LocalMachine is exactly the same as CurrentUser.....
-Dominik
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
|
|
|
|
|
Assuming you have the according security rights to write to the registry,
maybe check the return values of the Reg...-functions.
jens
|
|
|
|