|
There an easy way... I don't know if it's the best... but
You have to find the common "parent" to set up a "road" between you'r 2 dialog box. Like the Application itself, you can create a function who look like
void MyApplication::Populate()
{
DialogA.Populate()
}
in you'r dialog b you will be able to do¨
void DialogB::FucntionSomething(...)
{
//blablabla
(AfxGetApp())->Populate();
//blablabla
}
Other way is when you create you'r dialog if they are designed to work together you can add a private member to acess the other dialog
class DialogB : public CDialog
{
//blabla
DialogA* m_pDialogA;
}
So when you create them somewhere you can pitch there a valid pointer to the other DialogBox
Remi Morin
Rmorin@Operamail.com
Remi.Morin@Lyrtech.com
|
|
|
|
|
When I load my compiled program (under W95) on a W98 machine, it runs fine, but when I load it on a WMe machine, I get an error initializing the DAO JET Database.
Any ideas?
Richard
|
|
|
|
|
I think...
Try recompiling under WMe that should solve the problem
Name: STR
Mission: Take Over The World (c:
Tips: If you build it, he will come.
|
|
|
|
|
I think...
Try recompiling under WMe that should solve the problem
Name: STR
Mission: Take Over The World (c:
Tips: If you build it, he will come.
|
|
|
|
|
Hello,
Question #1:
I'm using a CEditView in my application to display text as it's read from the serial port. I'm having difficulty figuring out how to programatically insert text into the view. I tried the ReplaceSel function which works as long as the cursor remains at the end of the last text that was inserted. If the user selects any text in the window then it will be overwritten by this function. How can I just append a string to the view?
Question #2:
How can I turn the check marks next to menu options on/off (like the Toolbar & Statusbar commands under the View menu that Appwizard adds by default)?
Thanks a lot,
Joseph LeBlanc
unixd0od@hotmail.com
|
|
|
|
|
#1: I know I've written some hack code to do this where I got all of the edit's text into a string, appended some more onto that string, and then set the edit's text to be my new string. It was ugly, but it worked
#2: The check on a menu item comes from CCmdUI::SetCheck(bool), in the UpdateUI handler for that button item.
Hope some of that works for ya
*****
Jake Palmer
www.duke.edu/~jp6
|
|
|
|
|
Hy!
I think we work at the same problem
The solution that I find is that I get a HWND handle to the CEditView and then in the thread that read from the serial port call ::SetWindowsText( HWND, LPCTSTR ) ... it's not beautifull programming but it work ( you have to have a variable that hold all your input to this time ) ... but i'm still working at it
Bye,
Orbital
...the night is long ... but not long enought to do some real coding ...
|
|
|
|
|
Hi,
I am trying to create a Word Add-In WLL.
Been looking at the knowledgebase article
http://suport.microsoft.com/support/kb/artical/Q183/7/58.ASP
When I add the add-in, no effect takes places.
It all compiles okay, i am using Word 2000.
Anyone Any Clues, or good links of examples?
Not sure if my capilib.c, wdcapi.h, wdcmds.h, wderror.h, wdfid.h and config.h are corrupt. Does anyone know where i can get these files on-line.
Cheers
Richard
|
|
|
|
|
Hi,
An MDI app, using MFC.
I've set up all the filter things and so on in the string table. But when the user tries to "save as", i'd like to be able to suggest the filename, based on some of the documents contents. How do i do this?
|
|
|
|
|
The default OnFileSaveAs implementation calls CDocument::DoSave with NULL parameter. NULL means 'suggest simple name (based on document template) and display SaveAs dialog box". You can't call DoSave with your suggested name - this will disable the dialog box. DoSave is a virtual method, you can override it, but you can't just call base class. You'll have to copy the CDocument::DoSave body into CYourDoc::DoSave --and-- replace the code that calls CDocTemplate::GetDocString with your own routine creating suggested name.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
Hi!
I'm having problem with the line
cs.lpszClass = AfxRegisterWndClass (CS_NOCLOSE);
in PreCreateWindow function of the MainFrame
I want to disable the "x" (close) button in the upper right corner. That works with the:
cs.lpszClass = AfxRegisterWndClass (CS_NOCLOSE);
But there's a catch, if I use that line my program my applicatin icon (in the upper left corner and when minimized) is replaced by some ugly windows icon!
Is there another way I could do this?
Lynse
|
|
|
|
|
|
Ok, I'm a beginner at this so how do I get a handle to an icon in the resource file ?
Lynse
|
|
|
|
|
|
Hi,
I was wondering if there is any somewhat convenient way of "overriding" the new limitation of SetForegroundWindow() [for Windows 2000] (i.e. that it in fact does not set the window in foreground at all, but merely flashes it.)
I'm developing a small app where it would be nice if it could in fact sit in the background for a while, and then pop up on top of everything else when it's finished. How do I do this now that MS have closed the official door?
It can still be done, as for instance MS own Internet Explorer tends to do this all the time...
Thanks!
--
/Daniel
|
|
|
|
|
This is a short in the dark, have you tried SetActiveWindow after your App finishes working?
HTH
Jignesh
|
|
|
|
|
You have to implement it like this, in the app(windowhandle) you want to pop to the top:
Sleep(1);
BOOL btemp = SetForegroundWindow( (HWND) windowhandle );
if (!btemp)
{
Sleep(1);
btemp = SetForegroundWindow( (HWND) windowhandle );
}
You need the sleep since the system imposes a min switch time (and the originating app must be finished or at least released it's timeslice). Check the min switch time with:
BOOL bResult = SystemParametersInfo(SPI_GETFOREGROUNDLOCKTIMEOUT,0,timeout,0);
Regards
Boris
|
|
|
|
|
Hi all,
I'm trying to open a video stream but problems arise. Have a look at the code below:
::CoInitialize(NULL);
::AVIFileInit();
PAVISTREAM pAvi;
HRESULT hr = ::AVIStreamOpenFromFile
(&pAvi, "any.avi", streamtypeVIDEO, 0, OF_READ, NULL);
if (SUCCEEDED(hr))
{
AVISTREAMINFO si;
::AVIStreamInfo(pAvi, &si, sizeof(AVISTREAMINFO)); // <- Works ok
IGetFrame *pGetFrame;
pGetFrame = ::AVIStreamGetFrameOpen(pAvi, NULL); // <- Always returns NULL
if (pGetFrame != NULL)
{
pGetFrame->Release();
}
pAvi->Release();
}
::AVIFileExit();
Now, according to msdn, AVIStreamGetFrameOpen() returns NULL if it could not find a decompressor for this specific file. I can however view the file in windows media player w/o any problems. Doesn't that imply I do have a decompressor installed for this file???
I'm confused. Any help on this would be appreciated.
/Niklas
|
|
|
|
|
Hy!
How can I write in the window of a SDI aplication ( derived from CEditView ) from a worker thread??
Bye,
Orbital
...the night is long ... but not long enought to do some real coding ...
|
|
|
|
|
|
No, it dosen't because this function return the window caption. Here is what MSDN say :
"Copies the CWnd caption title (if it has one) into the buffer pointed to by lpszStringBuf or into the destination string rString. If the CWnd object is a control, the GetWindowText member function copies the text within the control instead of copying the caption. "
Bye,
Orbital
...the night is long ... but not long enought to do some real coding ...
|
|
|
|
|
|
I know you can ... but in the answer I specified that I want to change it from a worker thred and the function provide by CEditView are not thread-safe ... if you have any idea whow to workaround this problem I will gratly apreciate ...
Bye,
Orbital
...the night is long ... but not long enought to do some real coding ...
|
|
|
|
|
|
I've tryed that one to ... but i relly don't want to mdify the MFC source code ... any idea where i can put that critical section ( one is in the worker thread but the ather?? )
Bye,
Orbital
...the night is long ... but not long enought to do some real coding ...
|
|
|
|