|
Good try. But it didnt resize the CFormView or the mainframe. It may be a side effect of things I am doing (which I need to do). I have this function:
void CMainFrame::CenterMDIChildWindow(CMDIChildWnd *pWndToCenter)
{
ASSERT(::IsWindow(pWndToCenter->GetSafeHwnd()));
ASSERT(::IsWindow(m_hWndMDIClient));
CWnd* pMDICLIENT = CWnd::FromHandle(m_hWndMDIClient);
if (pMDICLIENT == NULL)
return;
CRect rcChild;
pWndToCenter->GetWindowRect(&rcChild);
CRect rcCenter;
pMDICLIENT->GetClientRect(&rcCenter);
int xLeft =0;
int yTop=0;
pWndToCenter->SetWindowPos(NULL, xLeft, yTop, rcCenter.Width(), rcCenter.Height() ,
SWP_NOZORDER | SWP_NOACTIVATE);
}
which I call as:
pMainFrame->CenterMDIChildWindow(pFrame);
that makes it fit the mainframe.
|
|
|
|
|
Well, I think you should try harder on the ResizeParentToFit path, but anyway. For CScrollView -derived classes (like form views themselves), maybe CScrollView::GetTotalSize is of some use.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
GetTotalSize was exactly what I needed. Now things fit!
Appreciate it!
ns
|
|
|
|
|
My program doesnt like it if you close the CFileDialog Open folder with the right cross menu . I looked at the m_ofn structure but didnt see anything that will suppress this menu. I only want the user to cancel or IDOK.
Any ideas?
Thanks,
ns
|
|
|
|
|
|
I think thats right - have to triple check it. I was doing something in ID_CANCEL that was making it behave inappropriately, and I thought it was a result of the system menu, but it was my fault I think.
Thanks,
ns
|
|
|
|
|
I have externed a structure from one dialog window to another and have used the debugger to check the values. That seems fine as far as the debugger is concerend, but when I assign one of the floats to a local float it is alway zero.
Is there possibly a compiler option or something that may be limiting my scope on the extern such that the debugger sees one thing and my program is seeing another. I just don't get it I have tried and tested everything I can think of.
|
|
|
|
|
try passing a pointer of ur struct, did that?
Papa
Murex Co.
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
I gave that a try, same thing.
Is it possible to send a pointer from one dialog window to another?
|
|
|
|
|
I have included an header in my project in which are listed some function headers... eg:
[code]////////////////
// NGNBASIC.H //
////////////////
#ifndef NGNBASIC_H
#define NGNBASIC_H
float ngn_sign(float f);
float ngn_rad2deg(float radiant);
float ngn_deg2rad(float degrees);
#endif[/code]
I espect that these function appear under the "globals" labed in Class View, but this doesn't happen... instead, in another workspace where I work to produce the lib owned by that header, they are listed. What am I doing wrong?
Thanks in advance for your time.
|
|
|
|
|
Under globals only appear those functions that are actually defined in a .c or .cpp file included in the project, i.e. those who are provided by libs do not count (Otherwise, the whole MFC and Win32 API would appear in the classview!).
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Ah, thanks
is there no way to let class view to display them? Class interfaces are displayed, and I supply only .h files for them (implementation reside in .libs).
|
|
|
|
|
You could write dummy functions that fool ClassView into thinking your project implements them, but that the compiler ignores. Put the functions in some cpp file and wrap them like this:
#ifdef _SOME_DEFINE_THAT_IS_NEVER_DEFINED_
float ngn_sign(float f)
{
}
#endif // #ifdef _SOME_DEFINE_THAT_IS_NEVER_DEFINED_
</code>
ClassView will now show them under Globals, because ClassView doesn't care about preprocessor directives like that. The compiler does, of course, and that code will never be included so long as you don't actually define the tag.
Ty
"The significant problems we face cannot be solved at the same level of thinking we were at when we created them." -Albert Einstein
|
|
|
|
|
Thanks for the trick
|
|
|
|
|
I have an application that runs under Win2K Pro and needs to disable the network card temporarily (I need to have as close to real-time response as possible and I don't want the CPU interrupted to deal with network activity). I can ask the user to go to the control panel and disable the network card, but is there a way to do this programmatically?
Thanks for any advice.
|
|
|
|
|
hav an idea, u can try it: surely the control panel is setting some entry in the registry to false or something like that, so all u need is try to know that entry.
If this ever exists, (hope it does) u can spy it using RegMon tool on the www.sysinternals.com
Hope this help
Papa
Murex Co.
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
While not an answer to your question, have you looked at maybe using CreateProcess() to start your app in REALTIME mode? This will give you the highest possible priority, above nearly everything else, without having to disable other processes or drivers. You could write a little proxy application whose sole job is to launch your actual app by calling CreateProcess() with a creation flag of REALTIME_PRIORITY_CLASS.
Just a word of caution, of course... if you do it this way you will have priority above even disk I/O. Like the friendly manual states, if your process runs for more than a very brief interval, you can "cause disk caches not to flush or cause the mouse to be unresponsive."
If REALTIME is too much, there are also HIGH_PRIORITY_CLASS and ABOVE_NORMAL_PRIORITY_CLASS (Win2000) flags that are not quite as severe, but still preempt normal apps. Just take a gander at the CreateProcess() docs.
Ty
"The significant problems we face cannot be solved at the same level of thinking we were at when we created them." -Albert Einstein
|
|
|
|
|
Thanks for the thought. I have indeed been experimenting with this with some success. However, it's also a good thing to turn off sources of hardware interrupts that I would just as soon avoid. I deal with the disk I/O problem by using a gigabyte of RAM, locking pages in memory, and avoiding any file I/O until the acquisition is complete.
Since I only need this priority level for a small portion of my application's running time, I use SetPriorityClass() rather than CreateProcess() .
I am trying to capture 5000 frames per second from a high-speed camera, so I am trying to avoid even an occasional millisecond of latency.
I would really like to work with an RTOS, such as QNX, but the frame grabber board I must use only has drivers for Windows.
|
|
|
|
|
I did a quick google search and came up with a few things that might help. Someone mentioned that there's a sample in the Windows DDK, under NTDDK\src\general\setup\Enable. Whether that has disable code or not, I'm not sure
More interestingly, there's an external program named DevCon that might do the trick, and apparently Microsoft gives out the source code in their latest XP DDK:
DevCon.exe KB Q311272[^]
Ty
"The significant problems we face cannot be solved at the same level of thinking we were at when we created them." -Albert Einstein
|
|
|
|
|
Thanks a million! Those pointers help me with exactly what I need. For the moment, calling DevCon from my application should do just what I need. Sometime later, I can see about incorporating the DDK code into my application's core.
Thanks so much for pointing me an answer.
|
|
|
|
|
Glad to help
Ty
"The significant problems we face cannot be solved at the same level of thinking we were at when we created them." -Albert Einstein
|
|
|
|
|
Just a wild guess, but have you looked at the CloseClusterNetInterface() function?
CPUA 0x5041
Sonork 100.11743 Chicken Little
"So it can now be written in stone as a testament to humanities achievments "PJ did Pi at CP"." Colin Davies
Within you lies the power for good - Use it!
|
|
|
|
|
What is the correct way to update the FormView(EditBoxes)on the fly from the Document after the OnInitialUpdate? I am currently using a pointer to the View object, this works but seems to me that it is by-passing the rules of encapulation.
Steve Daly
|
|
|
|
|
See UpdateAllViews .
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Hi there !!
I am currently working on my term project in VC++ using MFC. I want to implement MSN Messenger type System tray alert messages (which appears when a user signs in or a new email is recieved ) in MFC. If anyone could tell me how to implement it , which classes to use or could tell me any references or any example, I would be obliged.
Petrol.
|
|
|
|