|
Hi!
what is the code to enable a disabled dialog object?
Like if I want to enable IDC_RADIO1 when someone writes in IDC_EDIT1.
|
|
|
|
|
GetDlgItem(IDC_RADIO1)->EnableWindow(TRUE)
|
|
|
|
|
I need to monitor windows with certain titles, and I want to use wildcards like "*" in expressions. How can I easy add wildcard support (may * only) in my app?
I don't need complex solutions like RegExp.
Thanks.
|
|
|
|
|
You've got a very simple wildcard matching routine in snippets.org. Go to the snippets section of that website, download the .zip file (this is seemingly the only option available, the rest of the site is under construction) and search for match.doc , match.h and match.c .
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Thanks, but I link to Zip I found there was broken.
ftp://ftp.snippets.org/snip9707.zip
Can you mail me these files or tell anothar solution?
Thanks again!
|
|
|
|
|
It ain't broken, I jues downloaded the .zip 5 minutes ago. Anyway, I've sent it to you by email.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
|
Hey~
I have an MFC dialog based app with a menu bar. I've created my accelerator table and added the LoadAccelerators and TranslateAccelerator functions where appropriate and everything works fine... except... Ctrl+O will not work. Anyone have an idea why? Ctrl+X will not work either. Note, I am not intending to use Ctrl+O for the standard open file menu choice.
thanks in advance!
thundercatzlair
|
|
|
|
|
Hi,
How do i make my dlg window have focus..
I mean i have a small system tray icon.. when i press it
it displays a window.. how to i set focus on that
|
|
|
|
|
With SetForegroundWindow ?
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Along with Joaquín's answer, the CWnd::ShowWindow will also do the trick. I personally prefer this function as it has more options with regards to how to handle minimize, maximize, hiding, etc.
Cheers,
Tom Archer
Author, Inside C#
Please note that the opinions expressed in this correspondence do not necessarily reflect the views of the author.
|
|
|
|
|
I need to create an application which loads parts of its GUI (views) and functionality(docs) depending on the connected device type at runtime.
My first idea was to create several extension DLLs providing the neccessary functionality and load them at runtime. But this seems to be rather complicated since extension DLLs normally are
statically linked via the DLLs lib (aren't they ?). How can i overcome this ?
Any ideas ?
|
|
|
|
|
Use dynamic linking on your Dlls!! see MSDN.
Sorry to dissapoint you all with my lack of a witty or poignant signature.
|
|
|
|
|
Dynamic linking, sure ... but tell me how , GetProcAddress works only for plain functions, not classes or objects
|
|
|
|
|
Make a signature in every dll. I.e. a minimun set of exported functions. In your case, assuming you are using MDI, it might look like
CMultiDocTemplate* __cdecl GetDLLDocTemplate()
{
CMultiDocTemplate* pDocTemplate;
pDocTemplate = new CMultiDocTemplate(
IDR_CHARTDLLTYPE,
RUNTIME_CLASS(CDLLDoc),
RUNTIME_CLASS(CDLLFrameWnd),
RUNTIME_CLASS(CDLLView));
return pDocTemplate;
} I guess this will work no mather what type of DLL you are using, since it doesn't export any classes.
|
|
|
|
|
Use your imagination a little, have the function you export return a class/struct.
|
|
|
|
|
My artical on this subject shows how it can be done:
http://www.codeproject.com/docview/docviewfromdll.asp
Roger Allen
Sonork 100.10016
yet to be identified being from the planet Paltinmoriumbanfrettybooter
|
|
|
|
|
Just read the article - nicely done, Roger. No idea why you got a 4 out of 5 when the article does exactly what the title says and explains every step
Cheers,
Tom Archer
Author, Inside C#
Please note that the opinions expressed in this correspondence do not necessarily reflect the views of the author.
|
|
|
|
|
Actually I show how to do this in my Visual C++.NET Bible. If you're still having problems, email me and I'll send you a demo and that part of the chapter.
Cheers,
Tom Archer
Author, Inside C#
Please note that the opinions expressed in this correspondence do not necessarily reflect the views of the author.
|
|
|
|
|
I am using the code below to display my
dialog boxx..
The problem is that whenever it is displayed.. it
is cropped .. and this continues..
CRect myRect;
GetClientRect(&myRect);
ClientToScreen(myRect);
MoveWindow(myRect.left, myRect.top,
myRect.Width(), myRect.Height());
ShowWindow(SW_SHOWNORMAL);
Please Help
|
|
|
|
|
ummmmm
am i missing something or is this a really twisted way of showing a dialog box? is there a running thread of these posts that gets you to here so it makes sense?
situations to avoid #37: "good morning ... how many sugars do you take in your coffee ... and what was your name again?"
coming soon: situations to avoid #38: "...and the dog was there too?"
|
|
|
|
|
I'm with Lauren. I'm not sure what you're attempting to do here since you're not providing much in the way of details. Is this code from an init function (such as OnInitDialog) of the dialog or is this from another class trying to show the dialog?
If it's the former, your dialog is always going to be cropped because you're specifying the client area's height and width for the dialog size. If you just want to move the dialog - and not resize it use the SetWindowPos function and specify the SWP_NOSIZE flag:
SetWindowPos(NULL, 50, 50, 0, 0, SWP_NOSIZE);
Cheers,
Tom Archer
Author, Inside C#
Please note that the opinions expressed in this correspondence do not necessarily reflect the views of the author.
|
|
|
|
|
Hi,
I want that whenever my application starts, the Dialog
(in a dialog based application).. is hidden ShowWindow(SW_HIDE). (Actually this doesn't work under InitDialog()..
How do i do it
Sameer
|
|
|
|
|
This is answered in Mike Dunn's C++ FAQ.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Thanx a lot
|
|
|
|