|
i have some updateData(),updatewindow(), and a "SetWindowPos(&wndTopMost,NULL,NULL,NULL,NULL,SWP_NOMOVE|SWP_NOSIZE);" funcs in the maindlg, maybe thats why the childdlg get overpainted? but i dont have it enabled on mousemove func.. strange.
|
|
|
|
|
rolfhorror wrote: ...i only want the child dlg to appear inside the main dlg, not anywhere else on the screen.
Something like this?
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
Hi All,
We are trying to internationalize our software. To do this, we created resource bundles for various languages. However, after doing this we realized that all the .rc files needs to be updated when a new dialog is added to the project. To over come this problem, we moved all the strings to a header file and used to #defined in the .rc files. Now, we had to only update the header files for each of these languages and add the new dialog only in one .rc. The same rc file was linked all the resource bundle projects. Example as shown below.
As created by the resource editor:
IDD_DIALOG1 DIALOGEX 0, 0, 186, 90
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Test Dialog"
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
DEFPUSHBUTTON "OK",IDOK,129,7,50,14
PUSHBUTTON "Cancel",IDCANCEL,129,24,50,14
LTEXT "Sample text",IDC_STATIC,25,21,39,8
END
After replacing all the strings with constants:
ResourceBundle_en-US.h:
#define TEST_DIALOG “Test Dialog”
#define OK “OK”
#define CANCEL “Cancle”
#define SAMPLE_TEXT “Sample Text”
IDD_DIALOG1 DIALOGEX 0, 0, 186, 90
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION TEST_DIALOG
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
DEFPUSHBUTTON OK,IDOK,129,7,50,14
PUSHBUTTON CANCEL,IDCANCEL,129,24,50,14
LTEXT SAMPLE_TEXT,IDC_STATIC,25,21,39,8
END
The above code just works fine when you compile and run. The problem is when you try to add new dialogs or other resources from the resource editor. The resource editor replaces all the #defines with the actual strings and creates a new resource.h file. Is it possible to instruct resource editor not to replace the #define with the actual strings? or are there any other way to accomplish the same result -- Have a header file to specify all the strings used in the project and not in a resource file or define resources like dialog only once? We are currently using Visual Studio 2005.
Thanks,
Anand
|
|
|
|
|
Since dialog box sizes may change with each language and to simplify the life of your translators, it is best to create a resource file for each language.
In one small project, every set of resources had a base ID that was linked to a language. Internally, a resource was then requested based on an ID + the base language ID. I've had other projects where we simply had two builds and others where the language specific resources were in their own DLLs--this last one is probably the most common approach.
Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke
|
|
|
|
|
I'm using the below code to enumerate the available pixel formats. For each pixel format, I'm checking the flags to see if this format provides HW accelerated rendering. I'm getting "NONE" for half the formats and "GENERIC" for the other half. I don't get "ACCELERATED" for any of them. I've tried this on multiple machines which have hardware that I would expect to provide HW accelerated OpenGL rendering.
PIXELFORMATDESCRIPTOR pfd;
int maxpf = DescribePixelFormat(hDC,0,0,NULL);
for (int i = 1; i <= maxpf; i++)
{
if (DescribePixelFormat(hDC,i,sizeof(PIXELFORMATDESCRIPTOR),&pfd) == 0)
continue;
if ((pfd.dwFlags & PFD_SUPPORT_OPENGL) == 0)
continue;
if ((pfd.dwFlags & PFD_GENERIC_ACCELERATED) != 0)
{
TRACE1("%d: ACCELERATED\n", i);
}
else if ((pfd.dwFlags & PFD_GENERIC_FORMAT) != 0)
{
TRACE1("%d: GENERIC\n", i);
}
else
{
TRACE1("%d: NONE\n", i);
}
}
So my question is what is the correct way to determine which pixel formats support HW accelerated rendering? Are the flags in the pixel format even the right place to look?
One site I found which discusses this is below:
here
Seems pretty vague though unfortunately.
modified on Wednesday, August 6, 2008 9:53 AM
|
|
|
|
|
Hi,
I am getting the following error message when I login as a standard user and invoke my applicatin from SUA and close it.Can anyone help me resolving this errors.
Detailed information
Privs: Called GetTokenInformation, requesting 'TokenOwner'
Stack Trace
vfluapriv2!NS_LuaPriv::FudgeGetTokenInfo+3f
vfluapriv2!NS_LuaPriv::VfHookGetTokenInformation+6a
mscorwks!GetMetaDataInternalInterfaceFromPublic+1b11a
mscorwks!GetMetaDataInternalInterfaceFromPublic+bb96
mscorwks!GetMetaDataInternalInterfaceFromPublic+1bbcb
mscorwks!GetMetaDataInternalInterfaceFromPublic+1bb4c
mscorwks!GetMetaDataInternalInterfaceFromPublic+1b52b
mscorwks!GetMetaDataInternalInterfaceFromPublic+1b849
mscorwks!GetMetaDataInternalInterfaceFromPublic+b5c3
mscorwks!GetMetaDataInternalInterfaceFromPublic+b31b
mscorwks!GetMetaDataInternalInterfaceFromPublic+b2ba
mscorwks!CoInitializeEE+56
mscorwks!GetAddrOfContractShutoffFlag+c0
mscorwks!GetAddrOfContractShutoffFlag+a7f
Thanks,
Venkat
|
|
|
|
|
Can you > and < to find the greater of two floating point (float) numbers in C?
Or do I have to do something else like write a function?
|
|
|
|
|
johnny alpaca wrote: Can you > and < to find the greater of two floating point (float) numbers in C?
what ? what is the verb in your sentence ?
if you're asking "can I compare two floats using < and > operators", the short answer is : yes. the long one would say to be careful when comparing floats/doubles because of decimal precision...
but that makes a question come to mind : why didn't you just test it ?
|
|
|
|
|
verb "use"
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
i don't see it then
|
|
|
|
|
Sorry for the bad english.
Thanks I thought so. It worked on my PC but just wanted to confirm that it could be done without any problems just like integers.
Also what about testing equality of two floating point numbers ?
They could be tested for almost equality as I understand it
|
|
|
|
|
You can get into trouble checking the equality of floating point numbers.
As a decimal example, if you did an operation such as adding 1 + 1.
x = 1.0 + 1.0;
the internal respresentation might end up being
x = 1.999999999999999999999999999999999
instead of 2.0000000000000000000000000000
if you then checked if (x == 2.0) that would be false instead of true.
|
|
|
|
|
johnny alpaca wrote: They could be tested for almost equality as I understand it
Yes, you are right; floating points are not well represented in binary forms, so that a value like 1.4 can be stored as 1.39999999 or 1.400000001 ( for example)
so if yo need to compare floating point numbers, you have to check them against a pre-defined precision; they are identical "up to" a certain precision
for example:
double x;
double y;
double epsilon = 0.00001;
bool bEqual = fabs( x - y ) < epsilon;
this is a good read : http://docs.sun.com/source/806-3568/ncg_goldberg.html[^]
|
|
|
|
|
johnny alpaca wrote: They could be tested for almost equality as I understand it
Yes, with the difference being epsilon.
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
Hi all,
I want to make enteries in add remove program through coding...
how can i do this??
|
|
|
|
|
hey you asking from the base .......if we do means ...what abt your knowledge ...???
ok any ill give some tips
give AddString() function for add button
and take the index value,and then give deletestring() button for remove button...
i think this tips may be help for u ...
|
|
|
|
|
WTF are you talking about ?
the OP is asking how he can add an entry in the "Add / Remove Programs" Section of Windows.
how can AddString() and DeleteString() help him in this regard ?
moreover, your english is quite hard to read. please avoid SMS-typing.
|
|
|
|
|
You would need to create a key in the registry under HKEY_CLASSES_ROOT\Installer\Products
with ProductName and value (that you want to appear in the add/remove program)
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
sorry guys its for my mistakes..
|
|
|
|
|
I am working on a DLL which hosts various dialogs and property sheets which is being developed in Visual Studio 2003. I would like to have Windows XP styled controls but not having much luck so far.
I have tried using #define ISOLATION_AWARE_ENABLED 1 along with embedding a manifest and calling InitCommonControls(); in the constructor for the item but at best it does nothing, at worst it crashes. I have been searching for a way to do this and tried various tools which embed the manifest but they do not seem to have an effect. I have seen articles which suggest setting the manifest in the linker options but I cannot see the option so I believe this must be a 2005+ option.
Is there a way to do this or is it just not possible in 2003 projects?
|
|
|
|
|
Have you added the manifest to your application's resource file as follows?
CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "YourApp.manifest"
Please check Using Windows XP Visual Styles[^]
In the newer version of visual studio, embedding manifest is as follows by defining it in stdafx.h
#ifdef _UNICODE
#if defined _M_IX86
#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='x86' publicKeyToken='6595b64144ccf1df' language='*'\"")
#elif defined _M_IA64
#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='ia64' publicKeyToken='6595b64144ccf1df' language='*'\"")
#elif defined _M_X64
#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='amd64' publicKeyToken='6595b64144ccf1df' language='*'\"")
#else
#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"")
#endif
#endif
-Sarath.
"Great hopes make everything great possible" - Benjamin Franklin
|
|
|
|
|
Thanks for the reply, I have tried adding the manifest as specified but it makes no difference. I have also defined SIDEBYSIDE_COMMONCONTROLS in my stdafx.h and called InitCommonControls() in my constructor all with no success. I read somewhere that I needed to set the resource ID to ISOLATIONAWARE_MANIFEST_RESOURCE_ID but that stops my DLL from registering.
The only part of the "Using XP Visual Styles" I am not sure about it whether I am using the correct SDK. I have installed "Microsoft Platform SDK for Windows XP SP2" and specified the include and lib directories in the project. Is that all that is required to use the SDK or are there more steps I need to take?
|
|
|
|
|
Hello All
I've come across a strange (or perhaps not!) problem regarding the display of colours on the screen.
I have an application that is used on mutlitple platforms, 2000 and XP being the two I have been able to test to date.
In this application I change the colour of a button (by subclassing the CButton class) to indicate a warning state and then revert it back to the normal colour when the warning stae has passed. I do this ussing an RGB item:
<br />
pDC->FillSolidRect(rect, RGB(236, 233, 216)); <br />
This is the RGB value for the normal Windows "Form Grey", which I used a colour picker application to obtain. This is the colour of the rest of the form. Thus what im aiming to achieve by setting the button to this value is have its colour the same as the rest of the form.
The problem is that this appears a lot brighter on a 2000 platform - so the button is a different colour.
Using the same colour picker on the 2000 machine. The colour of the form is given as
RGB(212, 208, 200)
Any ideas why...?
|
|
|
|
|
Can you try using GetSysColor function?
The GetSysColor function retrieves the current color of the specified display element. See msdn for parameters
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Nice Idea, unfortunately, none of those colours match the colour of my application. It's the same colour as Visual Studio 2003 - I've not changd any colour settings for the form - so this must be the default colour...
Any other ideas...?
|
|
|
|
|