|
I have a generic View-Class, called UniView. All my views are derived from UniView.
In UniView i color for example the background in light-blue;
If i resize the frame, the frame-border is displayed totally correctly.
The view is also displayed correctly ( the new created space is also light-blue )
I resize the TabWnd and OutlookBar via MoveWindow.
if i size the frame for example for 50pixel larger in a normal sizing speed.
The TabWnd (which takes 3/4 of all the space of the view, the OutlookBar 1/4) sizes in
spaces. F.ex. alyways after 5pixels. Thats the delay
I removed the some controls/views and all slides correctly.
Propably i have an performance leak in a specific view or all operations together are taking
too long time.
Big thanks nevertheless
|
|
|
|
|
I do all the MoveWindow() calls in response to WM_SIZE in the parent windows.
Your outer frame window's OnSize() handler should call MoveWindow() for the Tab window.
The tab window's OnSize() handler should resize the control and reposition the active view.
I personally use ::BeginDeferWindowPos()/::DeferWindowPos()/::EndDeferWindowPos() to do the two
movewindows simultaneously. It performs well.
The tab view window's OnSize() handler should call MoveWindow() for all the controls that need to
be repositioned.
And so on...
I would take a look at how you are resizing your tab window. I bet the problem is there
In my code, the tab controls are attached to the frame window in an OnCreateClient() override
so MFC handles repositioning the tab control to fit the window.
In the tab control's OnSize() handler (I had to derive from the CTabCtrl class to do this) I
do the two window resizes I mentioned above. The code is like this:
void CMainFrameTabCtrl::OnSize(UINT nType, int cx, int cy)
{
CTabCtrl::OnSize(nType, cx, cy);
if (pMainFrame && ::IsWindow(*pMainFrame))
pMainFrame->TabWindowResize();
}
...
...
void CMainFrame::TabWindowResize()
{
if (pTabs && (pTabs->m_hWnd != 0))
{
CRect CliRect;
pTabs->GetWindowRect(&CliRect);
::MapWindowPoints(0, *pTabs, (LPPOINT)&CliRect, 2);
TabClientRect = CliRect;
pTabs->AdjustRect(false, &TabClientRect);
::MapWindowPoints(*pTabs, *this, (LPPOINT)&TabClientRect, 2);
int i = pTabs->GetCurSel();
if (i >= 0 && TabClients[i] && TabClients[i]->m_hWnd)
{
HDWP hDwp;
if ((hDwp = ::BeginDeferWindowPos(2)) != 0)
{
hDwp = ::DeferWindowPos(hDwp,*pTabs,0,0,0,
CliRect.Width(),CliRect.Height(),
SWP_NOMOVE | SWP_NOZORDER);
hDwp = ::DeferWindowPos(hDwp,*TabClients[i], HWND_TOP,
TabClientRect.left,TabClientRect.top,
TabClientRect.Width(),TabClientRect.Height(), 0);
::EndDeferWindowPos(hDwp);
}
}
}
}
I hope that helps a bit!
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
Hi all,
I'm trying the following:
token = strtok( buffer, seps );
while( token != NULL )
{
updbuff[x] = token;
_splitpath(updbuff[x],drive, dir, fname, ext);
sprintf((char*)updpathbuff, "%s.%s",fname, ext);
h_updPathbuff[x] = updpathbuff;
token = strtok( NULL, seps );
x++;
}
But with every loop occurrence, I overwrite the pointer h_updPathbuff .
I know what the problem is, but I don't know how to fix it
Can someone please help.
Thanks in advance.
Regards,
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
My Blog: ^_^
|
|
|
|
|
Instead of copying the pointer, you should copy the contents of the pointer. updpathbuff will always point at the same memory location, so if you store this pointer in an array and then you write something else in it, the contents of the pointer in the array will also change (because both pointers point at the same memory location). So, what you should do is use strcpy to copy the contents in a new pointer. But you should be carefull doing this: the pointer where you copy the data should be valid and the allocated memory should be big enough to accept the data.
I highly suggest that you copy the content in a std::string instead, so you'll get rid of all the problems of memory management.
|
|
|
|
|
|
Hi
All
I create owner drawn menu in VC++6.0 and now i want to create my own font and set it to menu and its items so that menu will display in desired font.So please give some hint that where i write code for creating font.
Regards
Atool
|
|
|
|
|
|
|
See WM_CTLCOLORBTN for button and WM_CTLCOLOREDIT for edit constols
|
|
|
|
|
|
MSDN has examples but see here[^]
|
|
|
|
|
|
Also note that it won't work for buttons unless they are owner-draw buttons.
WM_CTLCOLOR works on edit controls fine.
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
When I try to compile my old code in Visual C++ 2005, I get the error message
error C2990: 'Cg2HashTable' : non-class template has already been declared as a class template
with the code
<br />
<br />
template <class lType><br />
class Cg2FixedList;<br />
<br />
template <class keyType, class dataType><br />
class Cg2HashTable;<br />
<br />
template <class KEY, class DATA><br />
class Cg2SortedList;<br />
<br />
<br />
class Cg2DataHandle {<br />
<br />
private:<br />
friend class Cg2FixedList;<br />
friend class Cg2HashTable;<br />
friend class Cg2SortedList;<br />
...............<br />
<br />
How can I fix this? Thanks!
Nacho
|
|
|
|
|
Hello,
I am trying to convert my project to use Visual C++ 2005. However, when I compile my project, I get a lot of warning message like this,
c:\dxsdk\include\d3d9types.h(1385) : warning C4819: The file contains a character that cannot be represented in the current code page (950). Save the file in Unicode format to prevent data loss
How can I fix this? Thanks!
Nacho
|
|
|
|
|
Save the file d3d9types.h in unicode encoding.
Nobody can give you wiser advice than yourself. - Cicero
|
|
|
|
|
Is this the only way, since I have a lot of other files have similar problems, is it means that I need to re-save all those files? Thanks!
Nacho
|
|
|
|
|
Nacho Chip wrote: is it means that I need to re-save all those files?
Yes. Save all such files in unicode encoding. You must have entered unicode characters into those files and so you will need to save it in unicode encoding to avoid data loss.
Nobody can give you wiser advice than yourself. - Cicero
|
|
|
|
|
|
Hi,
I am having a Help -->"Help on XXX" in my MMC, I am not sure how this menu Item is created.
When I click on this menu Item, the HLP file is not opening.
Please let me know how to open the HLP file?
Thanks,
Nagarjuna
Nagarjuna
|
|
|
|
|
Hi All,
I want to change settings of Internet Explorer programatically:
Select Tools->Internet options->Security tab
Click on customlevel button
UserAuthentication
Logon
Anonymous logon Radio button must be checked
This must be done programatically.
How do i do that?
|
|
|
|
|
For changer settings of internet explorer you can refer to this address on the registry
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings
|
|
|
|
|
Which API to use so that i can change this settings.Particularly the parameters that i have to pass.
Thank u.Your response helped me know few things which i was unaware about.
|
|
|
|
|
|
I had read an article in MSDN for changing the proxy setting of options dialog.
It used :
INTERNET_PER_CONN_OPTION_LIST List;
INTERNET_PER_CONN_OPTION Option[1];
unsigned long nSize = sizeof(INTERNET_PER_CONN_OPTION_LIST);
Option[0].dwOption = INTERNET_PER_CONN_PROXY_SERVER;
Option[0].Value.pszValue = "http://myproxy:8080";
List.dwSize = sizeof(INTERNET_PER_CONN_OPTION_LIST);
List.pszConnection = NULL;
List.dwOptionCount = 1;
List.pOptions = Option;
if(!InternetSetOption(NULL, INTERNET_OPTION_PER_CONNECTION_OPTION, &List, nSize))
printf("InternetQueryOption failed! \n");
But i was unable to find appropriate details for setting other options of the "options" dialog.
Ex: To set Tools->Internet Options->Security->Localintranet->custom level(button)->Anonymous logon option.
An article in MSDN mentioned that setting registry directly is not recommended.Is there an alternative way to solve this issue.
|
|
|
|