|
I use Visual C++ 6.0.
I work on a pC that the screen have 15", When a compile the program and execute it on a PC that the screen have 21",the objects on the screen have not a good position like on 15" screen. All goes to the left corner.
What to do so that, I can have the good presentation independently of screen. In any screen dimension i must have a good design.
I learn my self
|
|
|
|
|
I think you want to display controls at the right locations; well it depends on the screen resolution, which you can get using GetSystemMetrics(SM_CXSCREEN) for width and GetSystemMetrics(SM_CYSCREEN); for height. Then you can position your dialogs and windows using SetWindowPos(...) and MoveWindow(...) .
this is this.
|
|
|
|
|
Dear Sir, my problem is not that,
On my 15" screen I put some objects like Edit Control, Combox,... and on the position I prefer on my view.
And I make "SHOW" screen parameter to "MAXIMISE" on my App aplication so that when i open one view it is maximized.
My problem is the position of all object in the new screen. Why they don't occupy the some position acoording to the new dimension of screen ?
Will I use MOVEWINDOWS for all object on the view ? It is painfull i thing, is it n't?
What to do ?
I learn my self
|
|
|
|
|
mikobi wrote: Will I use MOVEWINDOWS for all object on the view ?
Yes, the only option to avoid that is to use a dialog box that stays the same size (so, that you don't maximize it). Of course it will look 'smaller' on a screen with higher resolution but all controls will be at their right positions. If you search on this website, I know there is an article about a kind of rezisable dialog in which the controls are resized automatically.
|
|
|
|
|
I think that is one of the ways it can be done. Alternatively you could buy one of the ActiveX controls to reposition, or even resize the controls according to the new screen dimensions.
I would suggest you handle the WM_SIZE message, and reposition or even resize some of the controls according to the new dimensions. It could be a little work, but worth it.
this is this.
|
|
|
|
|
PLease help me;
That an example of one CEDIT Control, What codes to write for resize it ?
|
|
|
|
|
It really is not totally about resizing. It is more about repositioning.
Like:
int x, y;<br />
CRect rect;<br />
GetClientRect(&rect);<br />
x = rect.Width();<br />
y = rect.Height();<br />
m_Edit.SetWindowPos(NULL,(x/2)-100, (y/2)-50,0,0,SWP_NOZORDER | SWP_NOSIZE);
It would position the Edit around the center of the dialog. Of course it is not perfect, but shows how it can be done; very simple.
If you need to position a control at the right-side of the dialog, then:
x = rect.Width()-100;
y = rect.Height()-100;
m_Button.SetWindowPos(NULL,x,y,0,0,SWP_NOZORDER | SWP_NOSIZE);
this is this.
|
|
|
|
|
Your right , it is a bout repositionning .
To be very clear ;
When you are in dialog template and you click on a control, you see the position and the size on this control on the bottom panel. for example when i click one my CEDIT control I see its position : 105,20
from there what to do to reposition this control when we change screen dimension ?
|
|
|
|
|
I don't think the control's original position will be useful. You could just drag and drop all the controls on the dialog, and then position them in the OnSize() handler. See my previous post to position a button at the right-bottom corner of the dialog. Just forget the original position of the controls; reposition them where you like them; where they look good. (At runtime)
One important thing is that you must wait for the OnInitDialog() to be called before you reposition the controls, because OnSize() gets called before the controls have been associated with their variables. At the end of OnInitDialog() , you can explicitly send a resize message like: SendMessage(WM_SIZE);
You can keep a class variable like: BOOL m_bInitialized; make it false in the constructor, and make it true in OnInitDialog() . In OnSize() , check if it is true, then do the positioning work.
this is this.
|
|
|
|
|
Hi,
how to add a Tree control as an item in the ListCtrl.
can we add other controls as items in list ctrl.
If ListCtrl cant do this is there any other control which can do this like the GridCtrl or some thing like that???
plese help..
thanks in advance
shibu
-- modified at 23:09 Sunday 11th December, 2005
|
|
|
|
|
Hello!!
I am running an application in a MSCS cluster node. I want to get the name of the virtual cluster name and not the cluster node name. GetComputerName returns the cluster node name (the machine in which the applicaton is run). I want to get the cluster name (virtual cluster server name), or the name of the cluster which is exposed to the outer world.
I created an generic resource through the Cluster Administrator. I chose the option "Use Network Name for Computer Name" in the resource properties. The resource was created and indicated that it was offline. When I brought it online (through a menu option in the context menu) my application executed and picked up the virtual cluster server name and not the cluster node name. This is excatly what is required. But the application takes the virtual cluster server name only when it is run from the cluster admin and when it is executed manually (by double clicking the application) the application again takes the cluster node name.
So bottomline, how to obtain the virtual cluster server name of the cluster just as you get the machine name from GetComputerNaame() when you run the application independently.
Sandeep
|
|
|
|
|
Hi all:
I have an array unsigned char * image which contains my image information. Is there any way to display it on the screen or maybe save it into a file ??? Could somebody give me an answer please??
Thanks very much!!!
Asura
|
|
|
|
|
What do you mean exactly by 'displaying it on the screen' ? You want to just display that like an image or rather have a way to display each byte (just display the value of the byte) ?
|
|
|
|
|
display like an image
Asura
|
|
|
|
|
display like the game
Asura
|
|
|
|
|
Is this image a BMP, JPG, TIF, GIF, etc file?
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
|
Add the .bmp file as a resource to your project. Give it an ID such as IDB_BITMAP . Add a picture control to the dialog template. Change the Type to Bitmap, and the Image to IDB_BITMAP . Now when the dialog is displayed, the BMP image will be shown.
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
I use the raw ip code in Windows 2000 ,and everything are ok.
Now the appllication do not work on Windows XP.
Compiled and built on XP , the net still do not work.
Why?
|
|
|
|
|
The use of raw sockets has been restricted in Windows XP SP2. See here[^] for more information.
|
|
|
|
|
I got a Democode (publish by Microsoft) to replace msgina.dll. I open it in a new IDE,I found the compile option is disabled so to create the DLL I use Rebuild and it created DLL without any error.What I understood that it is a Make file.
After Rebuilt I found that all the .obj files are created outside the Debug Folder.
I copied the completed code into a new Workspace in Win32 Application Dll (choosing empty project option).Now it is showing me error and warnings
I am not understanding what is the problem. Pls Help me
Thanx in advance
|
|
|
|
|
This the output of the Democode.From the output what I understood related Unicode.But Still I am confused.Pls help me
Copyright (C) Microsoft Corp 1988-1998. All rights reserved.
cl -Z7 -Od -DWIN32 -D_WIN32 -D_MT -D_DLL -MD -c -W3 -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -nologo -D_X86_=1 -D_WINNT -D_WIN32_WINNT=0x0400 -D_WIN32_IE=0x0300 -DWINVER=0x0400 -DUNICODE -D_UNICODE -DDBG -I. gina.c
gina.c
cl -Z7 -Od -DWIN32 -D_WIN32 -D_MT -D_DLL -MD -c -W3 -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -nologo -D_X86_=1 -D_WINNT -D_WIN32_WINNT=0x0400 -D_WIN32_IE=0x0300 -DWINVER=0x0400 -DUNICODE -D_UNICODE -DDBG -I. debug.c
debug.c
cl -Z7 -Od -DWIN32 -D_WIN32 -D_MT -D_DLL -MD -c -W3 -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -nologo -D_X86_=1 -D_WINNT -D_WIN32_WINNT=0x0400 -D_WIN32_IE=0x0300 -DWINVER=0x0400 -DUNICODE -D_UNICODE -DDBG -I. welcome.c
welcome.c
cl -Z7 -Od -DWIN32 -D_WIN32 -D_MT -D_DLL -MD -c -W3 -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -nologo -D_X86_=1 -D_WINNT -D_WIN32_WINNT=0x0400 -D_WIN32_IE=0x0300 -DWINVER=0x0400 -DUNICODE -D_UNICODE -DDBG -I. shutdown.c
shutdown.c
cl -Z7 -Od -DWIN32 -D_WIN32 -D_MT -D_DLL -MD -c -W3 -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -nologo -D_X86_=1 -D_WINNT -D_WIN32_WINNT=0x0400 -D_WIN32_IE=0x0300 -DWINVER=0x0400 -DUNICODE -D_UNICODE -DDBG -I. options.c
options.c
cl -Z7 -Od -DWIN32 -D_WIN32 -D_MT -D_DLL -MD -c -W3 -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -nologo -D_X86_=1 -D_WINNT -D_WIN32_WINNT=0x0400 -D_WIN32_IE=0x0300 -DWINVER=0x0400 -DUNICODE -D_UNICODE -DDBG -I. logon.c
logon.c
cl -Z7 -Od -DWIN32 -D_WIN32 -D_MT -D_DLL -MD -c -W3 -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -nologo -D_X86_=1 -D_WINNT -D_WIN32_WINNT=0x0400 -D_WIN32_IE=0x0300 -DWINVER=0x0400 -DUNICODE -D_UNICODE -DDBG -I. util.c
util.c
rc -r -fo gina.res res.rc
link /NODEFAULTLIB /INCREMENTAL:NO /PDB:NONE /RELEASE /NOLOGO -entry:_DllMainCRTStartup@12 -dll -ignore:4078 -subsystem:native,4.0 -def:gina.def -out:gina.dll gina.obj debug.obj welcome.obj shutdown
.obj options.obj logon.obj util.obj gina.res msvcrt.lib oldnames.lib kernel32.lib ws2_32.lib mswsock.lib advapi32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib comctl32.lib
Creating library gina.lib and object gina.exp
gina.dll - 0 error(s), 0 warning(s)
-- modified at 2:42 Thursday 8th December, 2005
|
|
|
|
|
"gina.dll - 0 error(s), 0 warning(s)"
What errors and warnings do you get when you compile your version?
Kakan
|
|
|
|
|
the above output is of Democode which build without any error
but when i copy the same project in new Workspace (Win32 Dynamic link Library) then it shows error
Compiling...
SHUTDOWN.C
e:\gina\shutdown.c(21) : error C2053: 'szShutdownSettingPath' : wide string mismatch
e:\gina\shutdown.c(48) : warning C4133: 'function' : incompatible types - from 'unsigned short []' to 'const char *'
e:\gina\shutdown.c(142) : warning C4133: 'function' : incompatible types - from 'unsigned short []' to 'const char *'
GINA.C
E:\gina\GINA.C(186) : warning C4133: 'function' : incompatible types - from 'char *' to 'unsigned short *'
E:\gina\GINA.C(234) : warning C4133: 'function' : incompatible types - from 'char *' to 'unsigned short *'
E:\gina\GINA.C(295) : warning C4133: 'function' : incompatible types - from 'unsigned short [260]' to 'char *'
E:\gina\GINA.C(299) : warning C4133: 'function' : incompatible types - from 'char [2]' to 'const unsigned short *'
E:\gina\GINA.C(304) : warning C4133: '=' : incompatible types - from 'unsigned short *' to 'char *'
E:\gina\GINA.C(310) : warning C4133: '=' : incompatible types - from 'unsigned short *' to 'char *'
E:\gina\GINA.C(318) : warning C4133: 'function' : incompatible types - from 'unsigned short *' to 'char *'
E:\gina\GINA.C(335) : warning C4133: 'function' : incompatible types - from 'char [2]' to 'const unsigned short *'
E:\gina\GINA.C(371) : warning C4133: 'function' : incompatible types - from 'char *' to 'unsigned short *'
E:\gina\GINA.C(426) : warning C4133: 'function' : incompatible types - from 'char *' to 'unsigned short *'
LOGON.C
E:\gina\LOGON.C(24) : error C2053: 'szMiniKey' : wide string mismatch
E:\gina\LOGON.C(32) : warning C4133: 'initializing' : incompatible types - from 'char [7]' to 'unsigned short *'
E:\gina\LOGON.C(32) : warning C4133: 'initializing' : incompatible types - from 'char [15]' to 'unsigned short *'
E:\gina\LOGON.C(32) : warning C4133: 'initializing' : incompatible types - from 'char [7]' to 'unsigned short *'
E:\gina\LOGON.C(32) : warning C4133: 'initializing' : incompatible types - from 'char [5]' to 'unsigned short *'
E:\gina\LOGON.C(33) : warning C4133: 'initializing' : incompatible types - from 'char [6]' to 'unsigned short *'
E:\gina\LOGON.C(33) : warning C4133: 'initializing' : incompatible types - from 'char [8]' to 'unsigned short *'
E:\gina\LOGON.C(33) : warning C4133: 'initializing' : incompatible types - from 'char [6]' to 'unsigned short *'
E:\gina\LOGON.C(33) : warning C4133: 'initializing' : incompatible types - from 'char [5]' to 'unsigned short *'
E:\gina\LOGON.C(34) : warning C4133: 'initializing' : incompatible types - from 'char [6]' to 'unsigned short *'
E:\gina\LOGON.C(34) : warning C4133: 'initializing' : incompatible types - from 'char [8]' to 'unsigned short *'
E:\gina\LOGON.C(34) : warning C4133: 'initializing' : incompatible types - from 'char [6]' to 'unsigned short *'
E:\gina\LOGON.C(34) : warning C4133: 'initializing' : incompatible types - from 'char [6]' to 'unsigned short *'
E:\gina\LOGON.C(35) : warning C4133: 'initializing' : incompatible types - from 'char [9]' to 'unsigned short *'
E:\gina\LOGON.C(35) : warning C4133: 'initializing' : incompatible types - from 'char [1]' to 'unsigned short *'
E:\gina\LOGON.C(35) : warning C4133: 'initializing' : incompatible types - from 'char [1]' to 'unsigned short *'
E:\gina\LOGON.C(35) : warning C4133: 'initializing' : incompatible types - from 'char [1]' to 'unsigned short *'
E:\gina\LOGON.C(50) : warning C4133: 'function' : incompatible types - from 'unsigned short []' to 'const char *'
E:\gina\LOGON.C(97) : warning C4133: 'function' : incompatible types - from 'unsigned short *' to 'const char *'
E:\gina\LOGON.C(142) : warning C4133: '=' : incompatible types - from 'char [9]' to 'unsigned short *'
E:\gina\LOGON.C(143) : warning C4133: '=' : incompatible types - from 'char [1]' to 'unsigned short *'
E:\gina\LOGON.C(144) : warning C4133: '=' : incompatible types - from 'char [1]' to 'unsigned short *'
E:\gina\LOGON.C(145) : warning C4133: '=' : incompatible types - from 'char [1]' to 'unsigned short *'
E:\gina\LOGON.C(162) : warning C4133: 'function' : incompatible types - from 'unsigned short []' to 'const char *'
E:\gina\LOGON.C(183) : warning C4133: 'function' : incompatible types - from 'unsigned short [64]' to 'char *'
E:\gina\LOGON.C(204) : warning C4133: 'function' : incompatible types - from 'unsigned short [260]' to 'char *'
E:\gina\LOGON.C(232) : warning C4133: 'function' : incompatible types - from 'unsigned short [260]' to 'const char *'
E:\gina\LOGON.C(358) : warning C4133: '=' : incompatible types - from 'unsigned short *' to 'char *'
E:\gina\LOGON.C(363) : warning C4133: '=' : incompatible types - from 'unsigned short *' to 'char *'
E:\gina\LOGON.C(364) : warning C4133: '=' : incompatible types - from 'unsigned short *' to 'char *'
E:\gina\LOGON.C(400) : warning C4133: 'function' : incompatible types - from 'char [1]' to 'unsigned short *'
E:\gina\LOGON.C(531) : warning C4133: 'function' : incompatible types - from 'char *' to 'unsigned short *'
E:\gina\LOGON.C(550) : warning C4133: 'function' : incompatible types - from 'char *' to 'unsigned short *'
E:\gina\LOGON.C(599) : warning C4133: 'function' : incompatible types - from 'unsigned short *' to 'char *'
E:\gina\LOGON.C(600) : warning C4133: 'function' : incompatible types - from 'unsigned short *' to 'char *'
E:\gina\LOGON.C(601) : warning C4133: 'function' : incompatible types - from 'unsigned short *' to 'char *'
OPTIONS.C
E:\gina\OPTIONS.C(40) : warning C4133: 'function' : incompatible types - from 'char [16]' to 'unsigned short *'
E:\gina\OPTIONS.C(55) : warning C4133: 'function' : incompatible types - from 'unsigned short [260]' to 'char *'
E:\gina\OPTIONS.C(126) : warning C4133: 'function' : incompatible types - from 'char [16]' to 'unsigned short *'
E:\gina\OPTIONS.C(300) : warning C4133: 'function' : incompatible types - from 'char *' to 'unsigned short *'
E:\gina\OPTIONS.C(313) : warning C4133: 'function' : incompatible types - from 'char *' to 'unsigned short *'
E:\gina\OPTIONS.C(322) : warning C4133: 'function' : incompatible types - from 'char *' to 'unsigned short *'
OUT.C
E:\gina\OUT.C(29) : error C2143: syntax error : missing ';' before '}'
E:\gina\OUT.C(29) : warning C4091: ' ' : ignored on left of 'struct _MiniAccount *' when no variable is declared
DEBUG.C
UTIL.C
e:\gina\util.c(105) : warning C4133: 'function' : incompatible types - from 'unsigned short [256]' to 'char *'
e:\gina\util.c(116) : warning C4133: 'function' : incompatible types - from 'unsigned short [256]' to 'char *'
e:\gina\util.c(120) : warning C4133: 'function' : incompatible types - from 'unsigned short [256]' to 'const char *'
e:\gina\util.c(120) : warning C4133: 'function' : incompatible types - from 'unsigned short *' to 'const char *'
WELCOME.C
Error executing cl.exe.
gina.dll - 3 error(s), 58 warning(s)
-- modified at 4:15 Thursday 8th December, 2005
|
|
|
|
|
Hello again, I'm sorry for the delay.
As far as I can see, it's definately worth trying to build a unicode version. Then most (and probably all) warnings and errors will disappear.
But you knew that already, right?
Kakan
|
|
|
|