|
No, they are not modals but continously displayed windows.
Cheers,
solosnake
|
|
|
|
|
the function "DoDataExchange" can be used to update variables in your main CMainFrame. This is called automatically on Exit or you can do it yourself.
I am not sure if this would work but you could use a handler to the dialogue class to detect a change if it is detected then call DoDataExchange to update your CMainFrame
Eric
|
|
|
|
|
OK , but the problem is that the combo box represent the user choosing an item in a internally maintained array of items. The main frame holds this array. When the user changes the combo box I want the main window to be notified so that it can change the required values that the dialog displays. The dialog is never closed, so data must be updated as a response. Thanks for the ideas, but I need some more?
Cheers,
solosnake
|
|
|
|
|
You may try to have in the dialog class a member that is a reference or a pointer to the array in the CMainFrame class. Thus you would be acessing those members directly.
Best regards,
Alexandru Savescu
|
|
|
|
|
Hello
Thanks to everyone who replied. I have solved the problem, which was partially of my own making anyway. I am now registering a new message, and sending it from the deep child window. The difference, which is not well documented in the help, is that SendMessage only sends to its own message queue. By using AfxGetMainWnd()->SendMessage I can get a message back out to the upper level windows. I have added a custon ON_MESSAGE handler, and everything is working fine. Thanks for all suggestions, and I hope my problem and solution can help someone else perhaps.
Cheers!
solosnake
|
|
|
|
|
Hi! I'm trying to create a static box into a FormView derived class, i tryed like this:
void CUnits_Sold::OnUpdate(CView* pSender, LPARAM lHint, CObject* pHint)
{
//This lines had the propose of initialize the pointer, i could not find another way to do it!
CStatic estatico;
CStatic* estatico2;
estatico2=&estatico;
estatico2->Create("Olá", WS_CHILD|WS_VISIBLE|SS_NOPREFIX|SS_LEFTNOWORDWRAP, CRect(30, 30, 100, 100), this);
estatico2->ShowWindow(SW_SHOW);
}
Anyone have a clue why this isn't working?
Thank you
|
|
|
|
|
|
Hi,
I'm trying to port some unix code over to visual c++. Can anyone tell me if there is an equivalent to the unix types sema_t and key_t.
Cheers
Steevie
|
|
|
|
|
You just might want to be a little more specific. Otherwise I could answer like this;
Sure, just typedef int sema_t; and so on. Please explain what these types are used for, and how they are used, and I'm sure you'll get an intelligent answer.
Note however if you're targetting Visual C++ you might get answers referring to the worst "designed" class library of all times (MFC). Perhaps you should initially limit yourself to Win32? Just an idea.
|
|
|
|
|
sema_t is a UNIX POSIX semaphore structure defined as follows
typedef struct {
pthread_mutex_t lock;
pthread_cond_t cond;
int count;
} sema_t;
Then you can define for WIN32
typedef HANDLE pthread_mutex_t;
typedef struct pthread_cond_t {
int waiters_;
CRITICAL_SECTION waiters_lock_;
HANDLE sema_;
HANDLE waiters_done_;
size_t was_broadcast_;
} pthread_cond_t;
|
|
|
|
|
key_t is defined as follows
typedef int key_t
|
|
|
|
|
Hi,
I am trying to make my client area view based on CFOrmView fit exactly into the client area of the parent and resize along with it. ANy ideas would be appreciated. Thanks
|
|
|
|
|
Why not simply rewrite it to fit the client area???
|
|
|
|
|
I found Brian Harts sample code for centering an MDI Child in the MainFrame window and modified it so it works wonderfully now (that part anyways).
Thanks for the response. I'm quite new at this stuff so I wouldnt have known the slightest about how to rewrite it....
|
|
|
|
|
Hi ,
I spawned a modal dialog form from an SDI project and used SetWindowPos to position it and size it the same as the client area of the SDI.. Two odd things happened. First the GetWindowRect function returned funky results (wrong sizing as a result). More seriously, when I dismissed the modal dialog from the OK button or the system cross on the right hand side, I got a debug assert!
However, the same code works great if I use it for a modeless spawned dialog!
ANy ideas why and how to get past the error?
|
|
|
|
|
|
Great! thanks!
ANy clue why the onOk and exit gives me the debug assert?
Thank you so much for the hint.
|
|
|
|
|
|
Hello,
I am trying to access the size of my MainFrame window in an MDI MFC project from the OnSize function. I am trying to fit the child window into the frame when resizing happens and I realise this isnt quite the way since the child gets created only once, but I thought at least what should happen is that the child should fit the frame at startup. In the Childfrm.ppp I wrote:
BOOL CChildFrame::PreCreateWindow(CREATESTRUCT& cs)
{
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
if( !CMDIChildWnd::PreCreateWindow(cs) )
return FALSE;
cs.x=0;
cs.y=0;
cs.cx=CMainFrame::m_FrameWidth;
cs.cy=CMainFrame::m_FrameHeight;
return TRUE;
}
I got the compile error that CMainFrame was not a class or namespace.
Please help!!!!!
|
|
|
|
|
Your using the CMainFrame class name as a namespace in this case. What you need to do is:
#include "mainfrm.h"
CWnd *pWnd = AfxGetApp()->m_pMainWnd ;
CMainFrame *pMF = static_cast < CMainFrame* > (pWnd) ;
cs.cx = pMF->m_FrameWidth ;
Roger Allen
Sonork 100.10016
If I had a quote, it would be a very good one.
|
|
|
|
|
Heyyyyyyyy Friendssssssssss
What a surprise...hooo the Codeproject logo changed...
what happend???? nice really nice and funny...!!!haha
Enjoy with CodeProject.....
Love u Codeproject..
Renjith-The CPian.
|
|
|
|
|
Hi,
I want to clear contents of Output Window programmatically. I don’t want to use right click-clear option. Do U have any idea how to do?
Regards;
Uttam Kumar
|
|
|
|
|
Did you try to record a macro?
Best regards,
Alexandru Savescu
|
|
|
|
|
In fact I want to write a function so that using that fuction I can clear my debug window any time. I guess I need to get handle of the
|
|
|
|
|
Can any one please tell me about any open source project, a client application that connects to MSN or Yahoo servers and access these services.
If you know about any such open source project then please tell me, whether available from CodeProject, Codeguru or CVS(SourceForge.net),
Thanks
SattarSingh
|
|
|
|