|
Hey all. I have run into a problem with the MessageBox command. I need the MessageBox to close as soon as a keyboard event occurs, but have yet to find an efficient way to do it. My project is a multiple document MFC program done under Visual C++ 6. Any help you can give would be cool.
|
|
|
|
|
Replace MessageBox with modal MFC dialog and override PreTranslateMessage.
Tomasz Sowinski -- http://www.shooltz.com
- It's for protection - Protection from what? Zee Germans?
|
|
|
|
|
I had done something similar to this earlier and it kind of worked but it continued executing the current function even with the modal dialog open. Before I try this method, I was wondering if this would do the same?
|
|
|
|
|
Anonymous wrote:
it continued executing the current function even with the modal dialog open
Sounds strange. Did you use multiple threads?
Tomasz Sowinski -- http://www.shooltz.com
- It's for protection - Protection from what? Zee Germans?
|
|
|
|
|
Hey, thanks. Your first reply just gave me an idea.
|
|
|
|
|
Anyone have any idea where the DLGTEMPLATEEX struct is defined??
It's explained and defined in MSDN, but I can't seem to use it in my source, as it isn't defined in any headers that I've included.
It seems to be defined in some of the ATL includes, but as a "local struct used for implementation" (ATLCTL.H).
Now I know that it is used, because if I load a DialogEx into memory and examine it, it's structure conforms to DLGTEMPLATEEX.
Any ideas, short of defining the struct myself where I need it?
TIA,
Pete
|
|
|
|
|
DLGTEMPLATEEX
typedef struct {
WORD dlgVer;
WORD signature;
DWORD helpID;
DWORD exStyle;
DWORD style;
WORD cDlgItems;
short x;
short y;
short cx;
short cy;
sz_Or_Ord menu;
sz_Or_Ord windowClass;
WCHAR title[titleLen];
// The following members exist only if the style member is
// set to DS_SETFONT or DS_SHELLFONT.
WORD pointsize;
WORD weight;
BYTE italic;
BYTE charset;
WCHAR typeface[stringLen];
} DLGTEMPLATEEX;
Happy programming!!
|
|
|
|
|
Thanks Wolfram, but I actually already had the structure, I just need to know where it's defined, so I don't have to typedef it myself.
|
|
|
|
|
I found it in the ATL include, atlhost.h, for class _DialogSplitHelper. Again, it appears to be local. HTHs.
|
|
|
|
|
I'd like to use LockFile() to lock a full file, is this possible?
MSDN doesn't mention how to do this.
Please help
|
|
|
|
|
Can you not specify 0 as the starting offset, and the file length as the length to lock?
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 happens if the file size is increasing because I append data to the file? Sometimes I want to lock a file and make sure nobody else can modiy or append data to it.
|
|
|
|
|
According to MSDN, it is not an error to set the locking range past the end of the file, but I am not sure if that would lock anything you append. To be safe, I think you should re-call LockFile() after you append data, specifying the new file length.
This is just a guess, I have never done this myself
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!
|
|
|
|
|
PJ Arends wrote:
According to MSDN, it is not an error to set the locking range past the end of the file
thx, I need to do some testing.
|
|
|
|
|
Anonymous wrote:
Sometimes I want to lock a file and make sure nobody else can modiy or append data to it.
Can't you just open file using CreateFile and FILE_SHARE_READ flag?
Tomasz Sowinski -- http://www.shooltz.com
What is "scratch" and why can everything be made from it?
|
|
|
|
|
Tomasz Sowinski wrote:
Can't you just open file using CreateFile and FILE_SHARE_READ flag?
that's not portable. on the other hand, file locking mechanism do exist on various platforms (open file, lock file, do something, close file).
|
|
|
|
|
Anonymous wrote:
that's not portable.
So on these 'various platforms', when you open file, other processes can also open the same file and write at the same time?
Tomasz Sowinski -- http://www.shooltz.com
What is "scratch" and why can everything be made from it?
|
|
|
|
|
Tomasz Sowinski wrote:
So on these 'various platforms', when you open file, other processes can also open the same file and write at the same time?
that's why you lock files. e.g. you gain the exclusive right to modiy data in a file ata specific time.
|
|
|
|
|
I want to write an app that will answer incoming calls and listen for the tones of the caller pressing buttons and do different tasks. Playing a "Press 1 for..." message would be nice also.
My question is where to start. Are there classes/libraries out there that would give me a good base? If anyone has done this or knows where I can start please let me know.
Thanks,
Jack
To an optimist the glass is half full.
To a pessimist the glass is half empty.
To a programmer the glass is twice as big as it needs to be.
|
|
|
|
|
Look at TAPI functions, for example lineGatherDigits .
As my daughter would say, "... Whatever!"
|
|
|
|
|
Hey all,
I have an ActiveX control, that was developed using ATL.
Now, I would like to add Active Document containment capabilities to that control, to allow it to host MSHTML.
I've been looking for information in MSDN, but found only little of it - and nothing about ATL - only about MFC.
So -
1. Does ATL have some support for that technology?
2. How difficult would it be to write the required interfaces WITHOUT a tool such as ATL/MFC?
3. Can you refer me to some good examples?
Thanks in advance!
|
|
|
|
|
Hi all,
Anyone know how I would go about embedding a dialog (DVCR) into another dialog (DNewDialog)?
What I want to do is treat it like a CWnd, and use CWnd::Create() in DNewDialog::InitDialog() to add it to the dialog.
I figure I should start by creating an inherited class (DEmbeddedVCR) that inherits from DVCR.
But calling DEmbeddedVCR::Create() always creates a standard dialog, e.g. one you can move around and that has a title bar.
I've tried DEmbeddedVCR::ModifyStyle() with various arguments, but have been unable to make it behave.
Am I going about this totally the wrong way?
TIA,
Pete
|
|
|
|
|
Change the style of the embedded in the resource editor to "Child". Then, create it as a modeless dialog.
/ravi
Let's put "civil" back into "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
you could also add a custom control "item" to the dialog and set its window class to the dialog window class #32768 or one of those # thingies
- Roman -
|
|
|
|
|
Did you mean setting the Class property of the custom control to IDD_VCR (where IDD_VCR is the id of the dialog I want to embed)?
I tried that and whenever I call DoModal on the dialog (the dialog I added the custom control to) it returns instantly, before it reaches InitDialog().
|
|
|
|