|
Sure. Do this to get the screen size:
RECT rectScreen;
VERIFY (GetWindowRect (GetDesktopWindow()), &rectScreen));
or
RECT rectScreen;
VERIFY (SystemParametersInfo (SPI_GETWORKAREA, 0, &rectScreen, 0));
/ravi
"There is always one more bug..."
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Hi,
does anybody know of a way to create a small program (ie what functions to use) that can change the icons of executables, similar to a pared down MicroAngelo or IconChanger? I was looking at BeginResourceUpdate() etc, but they are NT-only. My program copies an executable to another folder with certain settings stored in an INI file; I want the user to be able to choose the icon of the executable, thus I need to change it when it is copied (hope that makes sense). Is there a good way of doing this?
If anybody has any ideas, I would be very grateful.
Many thanks,
Keith
|
|
|
|
|
As you pointed out, BeginResourceUpdate and related functions are NT/2k/XP only. Fortunately, Erik Kallen wrote an amazing clone of this set of functions that works for 9x/ME systems as well: see his article Updating Resources on Win9x.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Thanks for your reply, I'll check it out.
Cheers,
Keith
|
|
|
|
|
I need to edit the compiler created com files
*.tli and *.tlh.
How can I do it? if it isn't posible then do I have to delete and then recreate the object?
thanks,
Aviv.
avivhal
|
|
|
|
|
You can do this, but it's probably not recommended. Just remove the #import statement after you've compiled the first time as that statement will continually overwrite your modifications. Also, make sure that both files are in the project so that they get compiled and linked.
Cheers,
Tom Archer
Author, Inside C#
A total abstainer is one who abstains from everything but abstention, and especially from inactivity in the affairs of others.
|
|
|
|
|
Thanks but I couldnt find the #import anywhere in the project nor in the tli , tlh files.
it seems like the compiler ignores my changes completely and reloads the files from somewhere... I don't know where.
Aviv.
avivhal
|
|
|
|
|
I'm going to need some more info to go on then. What tli and tlh files are you referring to? How did they get added to your project?
As an example of what I'm getting at, if I want to use the C++ wrappers for the ADO 1.5 COM interface, I simply use a #import which automatically creates a tli and tlh file and adds them to my project's build. This #import is typically located in the stdafx.h file.
Cheers,
Tom Archer
Author, Inside C#
A total abstainer is one who abstains from everything but abstention, and especially from inactivity in the affairs of others.
|
|
|
|
|
How do you update an edit box that holds an int?
I have asigned an int called m_nNumber to the edit box... then i change it and I would like it to show the change in the edit box
|
|
|
|
|
Call UpdateData(FALSE)
Cheers,
Tom Archer
Author, Inside C#
A total abstainer is one who abstains from everything but abstention, and especially from inactivity in the affairs of others.
|
|
|
|
|
Thanks!I am grateful for people that answers my stupid newbee questions
|
|
|
|
|
Hey mate. We all started out where you are. Don't even worry about it.
Cheers,
Tom Archer
Author, Inside C#
A total abstainer is one who abstains from everything but abstention, and especially from inactivity in the affairs of others.
|
|
|
|
|
By the way, I'm assuming that m_nNumber is a DDX variable already associated with the control in your DoDataExchange function.
Cheers,
Tom Archer
Author, Inside C#
A total abstainer is one who abstains from everything but abstention, and especially from inactivity in the affairs of others.
|
|
|
|
|
I'm e-mailing using SMTP, and in most cases there's no problem, but many e-mails get bounced back with an error "Domain of sender address xxx@yyy.com does not exist" where the e-mail address it says is my sender address and is a valid e-mail address.
I'd really appreciate it if anyone can shed any light on this problem and how to fix this.
Thanks,
Mark
|
|
|
|
|
I´m creating an application that has a control bar. This control bar is dockable and has a combobox inside of it. I´ve created the resource dialog bar and added the combobox to it. When my app loads, my control bar doesn´t have the default control bar layout (with the border and that dragging grip on the left). I´ve readed MFC docs and it says that to a control bar use the default layout you need to define the dialog resource id with an id between AFX_IDW_CONTROLBAR_FIRST (59392) and AFX_IDW_CONTROLBAR_LAST (59647). I´ve defined an ID with AFX_IDW_CONTROLBAR_FIRST + 32 and after the resource editor goes completly nuts, stating that I can only define resourceID between 1 and 32767. Anyone know how to solve this ? Do I need to create this dialog bar in a different way ?
Mauricio Ritter - Brazil
Sonorking now: 100.13560 Trank
I´ll take your brain to another dimension, I´ll take your brain to another dimension, I´ll take your brain to another dimension... Pay close attention...
|
|
|
|
|
Mauricio Ritter wrote:
Do I need to create this dialog bar in a different way ?
How are you creating it now? There are a few styles that control borders (CBRS_GRIPPER , etc.) that need to be present during creation.
--------
all the modern things
have always existed
they've just been waiting
to come out
and multiply
and take over Björk, The Modern Things
|
|
|
|
|
The resource doesn't have the ID in this range, the control bar does. In the call to Create() for the control bar, you need to specify the ID of the bar. This is usually the last parameter. Set this in the AFX_IDW range.
Roger Allen
Sonork 100.10016
If I had a quote, it would be a very good one.
|
|
|
|
|
Hello!
Everytime I try to run my program on an other machine, where MS Visual C++ is not installed, I got an error message: Debug Assertion Failed! … File: winocc.cpp - Line 189…
My program basis – class is CRichEditView. I also used the ADO – interface, CRichEditCtrl, CTreeCtrl.
I don’t know which files I have to add in the InstallShield DLL - links – or is it an other mistake????
|
|
|
|
|
Well what does line 189 in winocc.cpp say? That will help you track down the problem.
It isn't a missing DLL problem unless the DLL is delay loaded. Otherwise, the program wouldn't even start.
Tim Smith
I know what you're thinking punk, you're thinking did he spell check this document? Well, to tell you the truth I kinda forgot myself in all this excitement. But being this here's CodeProject, the most powerful forums in the world and would blow your head clean off, you've got to ask yourself one question, Do I feel lucky? Well do ya punk?
|
|
|
|
|
Is there any tutorial where they make more than one dialog box for begginers... I haven't found any.
|
|
|
|
|
Assuming Visual C++.NET (since you didn't specify):
1) Open the Resource View (via the View menu)
2) Expand the items in the Resource View until you see the Dialog folder
3) Right-click the Dialog folder and select the Insert Dialog menu item
4) Drag and drop the desired controls to the dialog
5) Double-click the dialog background to invoke the Add Class dialog
6) Name the class and select CDialog as the base class. Note the header file name
7) Include the header in the file that will display the dialog
8) Use the dialog's DoModal function to display the dialog
These are very general instructions. For any more help, you need to be more specific about what you're trying to do.
Cheers,
Tom Archer
Author, Inside C#
A total abstainer is one who abstains from everything but abstention, and especially from inactivity in the affairs of others.
|
|
|
|
|
The key to having more than one dialog is to make sure that they are modeless dialogs. When you use the DoModal function to create dialogs, it creates a Modal dialog. This locks everything down in your application until the user exits from the modal dialog.
A modeless dialog allows the user to switch from window to window, even the dialog box that you have created. In order to create a modeless dialog, allocate a dialog object, call Create in order to create the actual window, then call ShowWindow You can do this as many times as you want to with modeless dialogs.
If you are simply using the Win32 SDK, you can use DialogBox to create modal dialogs, or CreateDialog to create modeless dialogs.
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
I want to use a QueryDef in my database application. I used a parameter query (Find Words: "PARAMETERS WordParam Text ( 255 ); SELECT * FROM EN_Words WHERE Word LIKE [WordParam];" ) but it doesn't work, m_pSet->GetRecordCount returns 0. When I pass a SQL string ( "SELECT * FROM EN_Words WHERE Word LIKE 'connect*' ". ("connect*" is the default value of m_strWord) ) to CDaoRecordset::Open() function instead of m_pQD, it works and m_pSet->GetRecordCount returns 5. How can I do this?
Note: I'm using VC++ 6.0 SP3
m_pDB = new CDaoDatabase;
m_pDB->Open( "data/db3.mdb" );
m_pQD = new CDaoQueryDef( m_pDB );
m_pQD->Open( "Find Words" );
COleVariant varParam( m_strWord );
m_pQD->SetParamValue( "WordParam", varParam );
m_pSet = new CDaoRecordset( m_pDB );
try
{
m_pSet->Open( m_pQD );
}
catch( CDaoException* e )
{
AfxMessageBox( e->m_pErrorInfo->m_strDescription );
e->Delete( );
return FALSE;
}
kozlu
|
|
|
|
|
Hi, friends,
I create more than one windows (different instance but belongs to the same
window class) on desktop, and want to manage them by "Cascade", "Tile
Horizontally" and "Tile Vertically" commands.
Of course the first idea is using window SDK functions: CascadeWindows(...),
TileWindows(...). The problem arise however, The two functions will restore all
other windows on desktop, which is not a good design of course.
The solution is to write my own CascadeWindows and TileWindows subroutines.
But I don't know how to do it. any idea? Thanks!
wuwu
|
|
|
|
|
If you look at the definition for CascadeWindows:
WORD CascadeWindows(
HWND hwndParent,
UINT wHow,
CONST RECT *lpRect,
UINT cKids,
const HWND *lpKids
);
lpKids is an array that allows you to specify only the windows that you want to cascade. Therefore if you use GetWindow to enumerate and find only the window handles that you are interested in, you will be able to cascade the set of windows that you want.
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|