|
I have seen applications where the initial data entry dialog is small but when the user selects the 'Advance' option a lot more information is displayed on a larger dialog.
Does anyone know how this is done as I would like to display a listCtrl, buttons and labels when the use selects the 'More Information' options on a small dialog.
Regards,
|
|
|
|
|
Does anyone know how this is done
yes.
when the user clicks on "more infor", you need to manually resize the dialog, that will make the controls "visible" or not to the user.
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
A little more information would be useful. Do I use the SetWindowPos() to be a small dialog at initialisation and then resize to a larger dialog when the 'More Info' button is hit?
Is it trial and error to guess the units/size?
|
|
|
|
|
MFC measures dialogs in a ratio of the font size, so it can be a bit hit or miss (try changing your system font size to be bigger, then run your app, and you'll see it's got bigger too!)
I did something like what you're attempting in the past, and found the easiest solution was to add a simple frame at the bottom (the size of the area that gets shown/hidden)
At run time, you can find the height of this control, and resize the dialog window accordingly - this'll make it much easier if you keep going back to add extra controls to the "hidden" part
--
Help me! I'm turning into a grapefruit!
Phoenix Paint - back from DPaint's ashes!
|
|
|
|
|
Hi,
You can simply use MoveWindow(int x, int y, int nWidth, int nHeight, BOOL bRedraw = FALSE) on the click on 'More Settings' button and expand/collapse the dialog using required width and height.
This will solve ur problem.
Vikram Kashyap
Sr. Software Engineer
TechBooks International
R&D Division
|
|
|
|
|
sweep123 wrote:
Does anyone know how this is done...
Yes. See the "Expanding and Contracting your dialog boxes" section of this article for an example. Here is another example, in the "More / Less Detail on Dialog" section.
"Opinions are neither right nor wrong. I cannot change your opinion of me. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
This is surely an easy q for you but I don’t remember how to do it…
How do I get the size of the users screen?
_____________________________
...and justice for all
APe
|
|
|
|
|
HDC tmpDC = GetDC(NULL);<br />
int xRes = GetDeviceCaps(tmpDC,HORZRES);<br />
int yRes = GetDeviceCaps(tmpDC,VERTRES);<br />
|
|
|
|
|
GetClientRect(hWnd, &clientRect);
|
|
|
|
|
Use this one...
int cx = GetSystemMetrics(SM_CXSCREEN); // return the width in pixels
int cy = GetSystemMetrics(SM_CYSCREEN); // return the height in pixels
Vikram Kashyap
Sr. Software Engineer
TechBooks International
R&D Division
|
|
|
|
|
Tnx - My solution
_____________________________
...and justice for all
APe
|
|
|
|
|
See the 'GetSystemMetrics' function. You can get de screen metrics among many other parameters of the system
|
|
|
|
|
Hi,
I need to programmatically view the contents of a textual file. In order to open it in read-only mode, I use the following line :
<br />
::ShellExecute(0, "open", "iexplore", s_file, SW_SHOWNORMAL);<br />
This works on most cases, but when testing the program on a VMWare virtual machine I have observed that the following command line :
<br />
C: > start iexplore <path to s_file><br />
briefly displays a confirmation dialog box that dismisses itself immediately. The dialog box contains rougly the following message :
You are downloading the <path to="" s_file=""> file.
Do you want to open it or save it on the hard disk? [open][save][cancel]
What might go wrong?
Cheers.
--
Maxime Labelle
maxime.labelle@freesurf.fr
|
|
|
|
|
Do you have to use internet explorer to view the file contents? If it's a file that is associated with an application you would use the file name inplace of the iexplore..
ShellExecute(NULL, "open", s_file,/*params*/ NULL, /*working dir*/NULL, SW_SHOWNORMAL);
Hope this helps
Whoever said nothing's impossible never tried slamming a revolving door!
|
|
|
|
|
I need to create programmatically a self-executable zip file, which has exe as file extension, can be unzipped by winzip and can be executed by double click it.
some one gave me a link
http://www.codeproject.com/win32/selfextract.asp
example from the link is self-executable but can not be unzipped by winzip.
there are many exe files are in this way, for example, winzip itself (winzip80.exe) and java sdk (j2sdk1401.exe).
can you help me?
thx
includeh10
|
|
|
|
|
The example you linked to uses zlib compression rather than zip compression, which is why it isn't compatible with winzip
The basic format of a self-extractor is actually pretty simple
What you need to do is write some code that can extract a zip archive from an address in memory
You then create an exe containing this code, and another small tool that takes a zip file, and merges the zip with the exe (i.e. just append the zip data to the end of your exe)
The exe needs to know where to look (i.e. at the end of the code), and extract the zip data from there.
As long as you keep the zip file intact within the self extractor, without modifying it, then winzip should still be able to find the archive and extract it manually
--
Help me! I'm turning into a grapefruit!
Phoenix Paint - back from DPaint's ashes!
|
|
|
|
|
Hi
I created a AdoDatabase connection in my service. But when the system is logged off or shutdown it shows OleMainThreadWndName error.
This happens only in NT not in 2000 or later.
Any idea will be greatly appreciated. I have been looking for this for quite some time
Thanks in advance
Shiraz
The Best Relligion is Science.
Once you understand it, you will know God.
|
|
|
|
|
|
Hi
Thankyou Lim Bio Liong for your answer.
I have had a look at this. But this is not the problem. OleMainThreadWndName error occurs because one you initialize COM using CoInitialize it creates some windows for databases.
Now if the service is running and I try to logout, the system cannot close those windows. And throws of errors.
So my question is how can I overcome that.
Please Help me....!
Regards
Shiraz
The Best Relligion is Science.
Once you understand it, you will know God.
|
|
|
|
|
Hello Zainu,
Sorry that the article did not help. I do have a comment that I hope will be helpful with your problem, this is summarised below :
>> one you initialize COM using CoInitialize it creates some windows for databases.
Yes, this is typical of COM, the windows that it creates are hidden windows and they are for sending hidden messages for COM objects in order to facilitate inter-thread method calls, etc.
However, I think it is safe to assume that these windows will not be of use once the COM objects behind them have been destroyed (once their reference counts have dropped to zero).
When you log out of the current windows session, your application should have Release()'ed all reference counts to COM objects. This should ensure that no hidden windows remain active.
My suggestion is therefore to see if there are any memory leaks in your application either in your service or in clients of your service.
Best Regards,
Bio.
|
|
|
|
|
Hi
Thankyou very much for your time.
>>When you log out of the current windows session, your application should >>have Release()'ed all reference counts to COM objects. This should ensure >>that no hidden windows remain active.
This is exactly my problem. How can I Uninitialize COM. My service should be running everytime.
Now the problem reduces to, How to handle CoInitialize and a Service. How to call CoInitialize within a service?
Regards
The Best Relligion is Science.
Once you understand it, you will know God.
|
|
|
|
|
Hello Zainu,
Some comments I have at this time are as follows :
1. I get the impression that your service connects to the database on behalf of your client. If it is your service that connects with the database, my advise is to connect only when your client requests for it and to disconnect when your client app terminates.
2. Concerning calling CoInitialize() and CoUninitialize(), generally speaking, services service client requests in separate threads. A service normally creates a separate thread to service each client that connects with it.
Every individual thread must call CoInitialize() in order to make COM API calls. Every thread must eventually call CoUninitialize() before terminating.
So if you do need to call CoInitialize() and CoUninitialize(), call these in the individual threads of your service.
3. Please remember, Zainu, that the most important thing is to ensure that there are no memory leaks. Calling CoUninitialize() may not solve your problems if your interface pointer(s) messed up the reference counts.
To avoid such problems, always use ATL smart pointers and do not call Release() directly. Let the smart pointers take care of reference counts for you.
Hope the above helps, Zainu.
Best Regards,
Bio.
|
|
|
|
|
Hi
Thankyou again..
I will get back to you after following your instructiong. This time I believe your advice will be fruitful.
Regards
The Best Relligion is Science.
Once you understand it, you will know God.
|
|
|
|
|
Hi
Thank you very much. At last I got over it...
Regards
The Best Relligion is Science.
Once you understand it, you will know God.
|
|
|
|
|
from C++ header files to UML class diagrams?
Hi everybody
Currently I do have C++ header files with class definitions (member variables and methods), no source files with implementations yet, it doesn't even need to compile yet and everything is in "design phase". From those header files I would like to automatically generate a UML class diagram, with bells&whistles (and all the arrows like dependencies, aggregations, etc.), so I can nicely show my bosses my suggestion for that future class concept. Does anybody of you know such a program to generate UML from header files?
I know that you could do it with "Together Solo" since I already did exactly that, but the new company I work at is very small and the piles of bucks you need to buy "Together Solo" are very big ($3500+).
Since I basically want to make some UML class diagrams I (of course) tried tools like ArgoUML and DIA. ArgoUML looks quite nice, but it's not really "finished" yet and... well... it's made for Java: I wasn't yet able to define pointers to classes as class members - and I do love pointers and I do need them. DIA is more "drawing" than "syntax checking" but the whole application crashed several times at my computer - so I'm not impressed.
I want to add that I am a coder guy: I prefer to write down all the derivations and dependencies right into a class definition than to draw some lines and arrows into diagrams (those arrows I want to be generated automatically). I even need no automatic code generation. As soon as I am confident in my design concept and my bosses nod I will start to code it again from scratch anyway, with code commenting and such.
Any help very welcome!
Thanks & Bye,
Matthias / T.T.H.
|
|
|
|