|
ES_WANTRETURN is definately not set for the edit control.
Derek Lakin.
I wish I was what I thought I was when I wished I was what I am.
Salamander Software Ltd.
|
|
|
|
|
rather than finding out why not, why not just make a new button, label it "OK" and write your own OnOK function?
-c
Conscience is what hurts when everything else feels good.
Smaller Animals Software, Inc.
|
|
|
|
|
I need something to happen when the Enter button is pressed, but the focus is on a different control.
It's a messenger type app. When you type a message into an edit control, the message should be sent when you press the Enter button, so you don't have to use the mouse to click on the send button.
Derek Lakin.
I wish I was what I thought I was when I wished I was what I am.
Salamander Software Ltd.
|
|
|
|
|
i agree with chris
create a new button
create a click event for the button
in the button place the following code
CDialog::OnOK();
|
|
|
|
|
This doesn't solve the problem, because the BN_CLICKED notification handler will not be triggered when the Enter button is pressed, which is the behaviour I want.
It doesn't necessarily have to be the OnOK function that gets called, but it must be the Enter button being pressed (while the focus is on an edit control) that triggers a function call.
Derek Lakin.
I wish I was what I thought I was when I wished I was what I am.
Salamander Software Ltd.
|
|
|
|
|
sorry i misunderstood the problem.
what you want to do is goto the properties of the button and make it the default button. when enter key is pressed that button will click.
|
|
|
|
|
The button already has the default button style set
As I think mentioned earlier in the thread: if the dialog is loaded as modal it works fine, if it's shown as modeless the behaviour stops and pressing the enter key has no effect
Derek Lakin.
I wish I was what I thought I was when I wished I was what I am.
Salamander Software Ltd.
|
|
|
|
|
In my application OnOK called correctly. Please, write some your code...
|
|
|
|
|
I have a problem with capturing an image from Windows media Player.
I have implemented CMediaplayer in my dialogbased app. and want to capture an image from the MediaPlayer window/control after I pause/stop the MediaPlayer.
Does anyone know how to do that?
I´m using MS Windows 98.
Thanks in advance
Jesper s.
|
|
|
|
|
I am doing research for a potential product that my company is thinking of starting on, and one of the features we would like to implement is plugin capability. I have looked around the web and haven't found much information on different ways to implement such a system. Does anyone know of an article or book that can explain the basic steps on doing this? Our main goal would be to have this "dummy" application that would keep track of what plugins are registered and execute a users commands on those plugins. Any information would be greatly appreciated.
Thanks
Zac
|
|
|
|
|
If you're into COM, define an interface for the plugin and check all DLLs located in some predetermined plugin directory (a plugin is simply added to the system by copying its DLL to this directory). If you don't lean towards COM, substitute the interface thing with:- An abstract class defining the functions a plugin has to implement (important: define the destructor as virtual.)
- A common "creation point" all DLLs are supposed to provide accessed with
GetProcAddress , just like this:
typedef CPluginInterface * (WINAPI * PLUGIN_CREATOR)();
...
PLUGIN_CREATOR * plugin_creator=(PLUGIN_CREATOR *)GetProcAddress(hPluginDll,"Creator");
CPluginInterface *plugin=plugin_creator();
...
delete plugin; Internally, creator functions just create plugins with new .
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
I have no objections to using COM, though, some of the plugins may need the ability to add menus or views to the application -- is there an easy way of implementing that?
Thanks again
Zac
|
|
|
|
|
Well, that very much depends on the structure of your app. Usually, it is better to have the plugins provide the functionality and data and let the app itself control the GUI (for instance, the plugin can provide a command name and a command callback and it is the responsibility of the app to insert the command into the main window menu).
If you're after a full-fledged doc/view architecture, I guess you're heading a lot of work for it to function based on a plugin system.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Okay, here is the idea I came up with. Since we do not want to have to recompile the app everytime we add support for a new hardware product we produce, we have this "shell" app that simply scans for plugins/ActiveX controls in a certain directory (or you select them from the app . . .) And the app will then make the features available in the plugin available to the user (ie if it is a communications plugin for the serial port, a menu would be appended to the top-level menu called "Communications" with options like "Configure", "Connect", and "Disconnect"). The whole idea is that we would only have to redistribute the application if we found a bug in it somewhere (making it easy to upgrade by simple adding new features via plugins that can be made available). The other benefit is that the application itself is worthless without one or more plugins (since it only functions via plugins), which would also make it very easy to give out demo versions (of some of the plugins) and give them the full-fledged application to evaluate.
Thanks again
Zac
|
|
|
|
|
for my stuff, i just defined a COM interface and told plugin writers "implement this interface, name it thusly and put your plugin DLL in this folder". then, to see which plugins are available, i just scan the folder and attempt to Create an instance of each DLL. it works well. people can write plugins for my stuff using any language that can create an IDispatch interface (this includes the biggies, VB and VC).
it is somewhat ugly to have to scan a folder, but it was the easest way to go. there is some COM interface that you can implement that tells the system "yes, i implement this other interface". that would have allowed me to use yet another interface to query the system to see which components implemented my plugin interface,
but there were difficulties getting VB to implement a non-IDispatch interface. so, i went with the scan-the-folder option.
-c
Conscience is what hurts when everything else feels good.
Smaller Animals Software, Inc.
|
|
|
|
|
Am I going crazy? I decided I want to do some DX work on my XP box. I need the DX 8.1 SDK, but I prefer the CD-ROMS over the download. I have up until 8 on CD-ROM, but can't find a link for the world of it to order 8.1. Anyone out there have a link?
Jeremy L. Falcon
"The One Who Said, 'The One Who Said...'"
<nobr>
Homepage : Feature Article : Sonork = 100.16311
|
|
|
|
|
How to used "Multiple Display Monitors" and "virtual screen" with the c & c++ & sdk, Who can tell me this and give me some source.
|
|
|
|
|
I've never done it myself...but have read about it a few times and I think it's pretty simple.
GetSystemMetrics()
Using
SM_XVIRTUALSCREEN
SM_YVIRTUALSCREEN
SM_CXVIRTUALSCREEN
SM_CYVIRTUALSCREEN
SM_CMONITORS
Use the 5 following API functions:
EnumDisplayMonitors()
GetMonitorInfo()
MonitorFormPoint()
MonitorFromRect()
MonitorFromWindow()
Psuedo-code:
int monView[9][2];
int nMonitors = 0;
BOOL CALLBACK MonInfo(HMONITOR hMon, HDC hdc, LPRECT rect, LPARAM extra){
MONITORINFOEX mi;
mi.cbSize = sizeof(MONITORINFOEX);
GetMonitorInfo(hMon, &mi);
monView[nMonitors][0] = mi.rcMonitor.left;
monView[nMonitors][1] = mi.rcMonitor.top;
nMonitors++;
return TRUE;
}
OnCreate(){
m_pxTop = GetSystemMetrics(SM_YVIRTUALSCREEN);
m_pxLeft = GetSystemMetrics(SM_XVIRTUALSCREEN);
m_pxRight = GetSystemMetrics(SM_CXVIRTUALSCREEN);
m_pxBottom = GetSystemMetrics(SM_CYVIRTUALSCREEN);
::EnumDisplayMonitors(NULL, NULL, MonInfo, 0);
}
Obviously this is not a complete example of source, but will get you started. Read up on MSDN on the preceeding functions and you should figure it out from here.
Cheers!
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
This is frightening:
c:\Development\Projects\phantom\phantom-edlib-win\PhantomExplorer.cpp(110): warning C4996: 'CWinApp::Enable3dControlsStatic' was declared deprecated
Does this mean MS is soon going to force us to link dynamically to their libraries?
This is the thing I hate about that company: forcing is to walk in their footsteps, regardless of our needs.
|
|
|
|
|
Seemingly, it only means that 3D controls are provided by default (relief sigh).
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
I need to calculate the length in pixels of a printed text (on the screen).
It's painted using a true-type font, so i would like to know if there is a simple function(font, text) to give me just what i need.
rechi
|
|
|
|
|
No, but it's easy to write one using DrawText() with the DT_CALCRECT flag.
/ravi
"There is always one more bug..."
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
|
|
Use GetTextExtent or one of its variants to get the width. However, it is usually best to use GetTextMetrics to get the height. TEXTMETRIC.tmHeight represents the absolute height of the tallest character for a given font. I'm fairly certain that GetTextExtent will only give you the height of whatever characters are in the string and that may vary according to the characters.
"There's a slew of slip 'twixt cup and lip"
|
|
|
|