|
Glad to help.
RecalcLayout is generally used to tell MFC to reshuffle the visible controlbars when a toolbar/controlbar is added or removed from being docked (top/bottom/left/right).
MSDN Describes it this way:
Called by the framework when the standard control bars are toggled on or off or when the frame window is resized.
-Remarks-
The default implementation of this member function calls the CWnd member function RepositionBars to reposition all the control bars in the frame as well as in the main client window (usually a CView or MDICLIENT).
Override this member function to control the appearance and behavior of control bars after the layout of the frame window has changed. For example, call it when you turn control bars on or off or add another control bar.
Hope this helps.
Happy Programming and God Bless!
"Your coding practices might be buggy, but your code is always right."
Internet::WWW::CodeProject::bneacetp
|
|
|
|
|
I'm using Visual Studio 6..
But as you know we can not change font of some part such as classview pane..
It seem to be fixed to system font.. you guys might be able to see Sans serif font..
(I'm not pretty sure about that..)
Anyway My question is 'How can I change the system font?'
I'm actually using Korean Version Windows.
What I wanna use is the sans serif system font like what you guys using.
the System font that comes with Korean Edition Windows is not good looking...
I'd like to change it..
Does any know about that?
ps. sorry about that my question is out of programming topic..
|
|
|
|
|
To change the buttons' size of a SpinButton, I need to use CSpinButtonCtrl::Create() function. Now I added a SpinButton control on my dialog, what shall I do next?
|-|3llo Wo|2ld
|
|
|
|
|
Shuang. Wu wrote:
what shall I do next?
What is it that you are wanting to use the Spinner control for? Are you wanting it to be used with a Edit Control?
Happy Programming and God Bless!
"Your coding practices might be buggy, but your code is always right."
Internet::WWW::CodeProject::bneacetp
|
|
|
|
|
Yes, with an Edit Control.
<font=sans-serif>|-|3llo Wo|2ld
|
|
|
|
|
Place code something like this (minus the lengthly comments) in your host dialog's OnInitDialog() function like:
<code>m_spinner.SetBuddy(GetDlgItem(IDC_EDIT_BOX));</code>
<code>GetDlgItem(IDC_EDIT_BOX)->SetWindowText("0");</code>
<code>m_spinner.SetRange(0, 100);</code>
<code>m_spinner.SetDlgItemInt(IDC_EDIT_BOX, 0, FALSE);</code>
That should do it! I hope this clarifies things for you and aids you in your programming efforts. Best of luck on your projects!
Happy Programming and God Bless!
"Your coding practices might be buggy, but your code is always right."
Internet::WWW::CodeProject::bneacetp
|
|
|
|
|
Thx. But what i want is to change spin button contro's size. I know CSpinButtonCtrl::Create can do, see:
BOOL Create( DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID );
...
Parameters
...
rect
Specifies the spin button contro's size and position. It can be either a CRect object or a RECT structure
Thus, I want to know when I can call CSpinButtonCtrl::Create.
Or, do you have any idea to change the spin button contro's size?
<font=sans-serif>|-|3llo Wo|2ld
|
|
|
|
|
|
hello
I,m new to mfc/windows.
I would like to find x-co-ordinate,y-co-ordinate ,height and width of 'OK' button on a property sheet in MFC.
Any help appreciated
Thanks
rajesh
|
|
|
|
|
Buttons are just windows so you can use GetDlgItem() to get a handle to the Window and then use GetClientRect() to get its size/pos.
Neville Franks, Author of ED for Windows www.getsoft.com and coming soon: Surfulater www.surfulater.com
|
|
|
|
|
OK button is IDOK
CWnd* pWndOK = GetDlgItem(IDOK);
ASSERT(pWndOK != NULL);
Then use GetWindowRect()
CRect crOK;
pWndOK->GetWindowRect(&crOK);
The CRect holds the x, y, width and height
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fuity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Williams (Little Britain)
|
|
|
|
|
I'm new to windows programming and I'm trying to create a basic setup for my program where users go through several screens and input preferences. Seems to me that these are mainly done using MFC dialog boxes, is that true?
thanks for your input
-bacon
|
|
|
|
|
You might want to look at the wizard-type form of Property Sheets...
Steve
|
|
|
|
|
Since you are new to this you probably don’t' want to tackle this, but… The latest approach to "properties" is the list view with tree style behavior. Like the Visual Studio Property view window in the form designer.
"No matter where you go, there your are." - Buckaroo Banzai
-pete
|
|
|
|
|
Dear all,
I am using mfc thread to acquire data from usb port and do signal processing. My signal processing program is written in Borland C++. Since my processing & classification program involves a few of submodules, I would not want to insert it in the thread. Instead I would like to call it from the thread, e.g. processing().
Below is my MFC thread:
UINT Process(LPVOID pParam2)
{
DWORD ExitCode;
int Code=1;
if(status==0)
{
myWinThread = AfxBeginThread(SendOpThread, &Code,
THREAD_PRIORITY_HIGHEST,0,CREATE_SUSPENDED);
myWinThread->m_bAutoDelete=FALSE;
myWinThread->ResumeThread();
status=1;
}
ExitCode=STILL_ACTIVE;
while(ExitCode==STILL_ACTIVE)
{
::GetExitCodeThread(myWinThread->m_hThread,&ExitCode);
}
for (int i=0; i<1024;i++)
{
j=i/4;
k=i%4;
channel[k][j]=r_Buffer[i];
}
delete myWinThread;
myWinThread = AfxBeginThread(SendOpThread, &Code,
THREAD_PRIORITY_HIGHEST,0,CREATE_SUSPENDED);
myWinThread->m_bAutoDelete=FALSE;
myWinThread->ResumeThread();
//signal processing occurs here
return(1);
}
Below is an example structure of my processing program:
#include <stdio.h>
#include <conio.h>
int i;
void Read();
void Save();
int main()
{
}
void Read()
{
}
void Save()
{
}
Can I use Callback routine? I came across some examples that uses this. What is it actually doing? Will my thread routine (UINT Thread) wait for the processing program to finish processing before execute the next line if I use call back function for the processing program? Any other better way of doin this?
Any examples that call other module from a thread?
Thanks a lot
Einly
|
|
|
|
|
You are asking multiple questions in just a couple of lines. Essentially, what do you want to know? Multithreading is compiler indepennt.
Kuphryn
|
|
|
|
|
I wrote a function a while back to clean out a directory and all of its contents and tried re-writing the same one tonight but can't seem to get it right. Any chance someone can point out my mistake?
short ClearEntireDirectory(char *szDirectory)
{
HANDLE hFile;
WIN32_FIND_DATA wfd;
if ( SetCurrentDirectory(szDirectory) == 0 )
return 1;
hFile = FindFirstFile("*.*", &wfd);
while ( FindNextFile(hFile, &wfd) != 0 )
{
if ( wfd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY &&
strcmp(wfd.cFileName, "..") != 0 &&
strcmp(wfd.cFileName, ".") != 0
)
{
if ( ClearEntireDirectory(wfd.cFileName) == 1 )
return 1;
}
DeleteFile(wfd.cFileName);
}
if ( SetCurrentDirectory("..") == 0 )
return 1;
if ( RemoveDirectory(szDirectory) == 0 )
return 1;
FindClose(hFile);
return 0;
}
I keep getting error 32 (ERROR_SHARING_VIOLATION) when I try to ultimatelly remove the directory.
|
|
|
|
|
I'm such an idiot!!! It would help if FindClose cam before RemoveDirectory!!!!!
|
|
|
|
|
The calls to SetCurrentDirectory() are unnecessary. If the usage of this function is low, it probably makes no difference, but if it is an oft-used function, changing directories so many times is not efficient.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Hi,
I m developing an application that displays Bitmaps on Window....
he problem is that the bitmap dispayed using 256 color scheme, but i want show my bitmaps with high-resolution.
Thanks in advance.
|
|
|
|
|
|
Hi,
I m developing application that displays Window with Lines, Bitmaps, but I haven't used any Document-View Architecture.
I have developed Dialog-based application and then instead of displaying Dialog , I m displaying Window usig CFrameWnd class on InitInstance of Application.
When any other Window overlapes over my Application Window,it erases the Graphics.....
I tried to use OnPaint(ON_WM_PAINT) event to solve the problem , but the event has been called continuously...
I grately Thankful to have the solution as soon as possible.
Or is there any other ways to solve the problem.
Thanks in advance.
|
|
|
|
|
I would immediately scrap the project and create a new one using MFC instead of trying to violate it. CFrameWnd is the frame of a view. You are expected to have a view to draw the application data to. Using a CFrameWnd in a dialog-based application is very much trying to combine the worst from two worlds, just don't do it. If you have started out with a dialog-based application, and have now decided to go the full route with a proper SDI- or MDI-based application, the advice is the same: scrap the old application and create a new project with the wizard if you don't know how it should be built by hand.
Second, that you have a window not redrawing after being covered and then uncovered implies that you draw outside of OnDraw in the view. Ooops! You have no view - well well, outside the application main window WM_PAINT -handler then.
Calling OnPaint yourself is completely inappropriate - you are supposed to invalidate the view, which sooner or later triggers a WM_PAINT , which makes MFC call your OnPaint , which probably is not drawing anyway - implied from your error description. If you want to trigger an immediate redraw, call RedrawWindow .
So, one step back, get the hang of the structure of SDI/MDI-apps, not least as regards visual updating. Otherwise you'll get into lots of frustrating situations in the future.
|
|
|
|
|
hi:everyone:
tell you i have some model ,but some of them is written using ODBC,but others is written using ADO,now i want to integrate them into a big project,i want to know whether it is ok?
thank you
|
|
|
|
|
>> can ADO and ODBC be mixed
I don't know... did you try it? Did it work?
"No matter where you go, there your are." - Buckaroo Banzai
-pete
|
|
|
|