|
In WinNT (but not only), in the control pannel, you have the possibility to open a dialog for changing some values which are typical fom the country you're currently living in, such as the local currency, or whether you are using a , to separate thousands or a . or nothing, and so on. This dialog usually opens up showing a map.
So, I'd like to programatically change the values in this dialog. Is this possible ? Are these values stored in the registry (if yes, which key?)?
Thanks
~RaGE();
|
|
|
|
|
Hello!
You need to look up these functions:
National Language Support Functions
The following functions are used with national language support.
ConvertDefaultLocale
EnumCalendarInfo
EnumCalendarInfoEx
EnumCalendarInfoProc
EnumCalendarInfoProcEx
EnumCodePagesProc
EnumDateFormats
EnumDateFormatsProc
EnumLocalesProc
EnumSystemCodePages
EnumSystemLocales
EnumTimeFormats
EnumTimeFormatsProc
GetACP
GetCPInfo
GetCPInfoEx
GetCurrencyFormat
GetDateFormat
GetLocaleInfo
GetNumberFormat
GetOEMCP
GetSystemDefaultLangID
GetSystemDefaultLCID
GetThreadLocale
GetTimeFormat
GetUserDefaultLangID
GetUserDefaultLCID
IsValidCodePage
IsValidLocale
LCMapString
SetLocaleInfo
SetThreadLocale
Mike Eriksson
Sonork 100.21825
|
|
|
|
|
Hi, everyone!
I do not understand what is the function of new operator
in the following example. Especially this statement,
--------
(void)new (pint) Elem(10);
--------
Another question, when compiling, a warning jumps out like the
following, I want to know how to avoid the warning.
Thanks in advance,
George
--------
c:\program files\microsoft visual studio\myprojects\testnew\testnew.cpp(25) : warning C4291: 'void *__cdecl operator new(unsigned int,void *)' : no matching operator delete found; memory will not be freed if initialization throws an exception
--------
#include <iostream.h>
inline void* operator new(size_t, void* ptr) { return ptr;}
class Elem{
public:
Elem(int a)
{
data = a;
}
public:
int getData()
{
return data;
}
private:
int data;
};
void main()
{
int* pint = new int[2 + sizeof(Elem)];
(void)new (pint) Elem(10);
Elem* elem = (Elem*)pint;
cout << elem->getData() << endl;
delete pint;
}
|
|
|
|
|
(void)new (pint) Elem(10); Constructs a new Elem object at the address pint . Run it step by step with a breakpoint in new 's body and you'll see what is all about.
rechi
|
|
|
|
|
Hi, Bogdan buddies!
I do not understand why we add a "(void)" before
the statement?
Thanks in advance,
George
|
|
|
|
|
George2 wrote:
I do not understand...
Neither do i. The call has right value so the conversion appears to be useless since there's no variable to receive it.
rechi
|
|
|
|
|
Hi, Bogdan pal!
The return type of new operator is void*, so
I think we should use
--------
(void*) ...
--------
other than
--------
(void) ...
--------
Since void* is a C++ data type and void is not a C++ data type. What is your opinion?
Thanks in advance,
George
|
|
|
|
|
Perhaps it's to get it rid of a compile warning. Leave it out and see if there is one.
|
|
|
|
|
Thanks, Anonymous buddies.
I have tried and you are right. Can you tell
me why?
George
|
|
|
|
|
I am implementing a skin based tool kit.
When repainting the frame of a window,
i catch WM_NCPAINT message then get window's
device context :
case WM_NCPAINT:
{
HDC hdc = NULL;
if( wparam==1 )
hdc = GetWindowDC( hwnd );
else
hdc = GetDCEx( hwnd, (HRGN)(wparam), DCX_WINDOW|DCX_INTERSECTRGN );
paintFrame( hdc );
ReleaseDC( hwnd, hdc );
}
The 'GetDCEx line' is taken from MSDN.
I use MSVC++7 under winXP
Thanks for your help
|
|
|
|
|
REQUIREMENT:: Application shud be sized to full monitor irrespective of the monitor size and current system resolution.
My APPLICATION:: Application is having four formviews in tabcontrol with many controls(AcitveX Lables and Buttons) on each forma view. My application is developed for best view in 15 inch and 800*600 resolution.
MY PROBLEM: i have written code to catch when resolution ic changed.and accorind to the new resolution m changing the each contols's client rect and moving the corresponding control to new client react. but reafreshing si becoming problem and some controls are painting over other controls.
Adi Narayana
|
|
|
|
|
Hi All,
I'm currently a firmware engineering and trying to get into software programming (using C++ for right now). I've decided to create a simple text editor as my first project.
Does anybody know any good references out there on this topic in particular and Windows programming in general?
Any suggestion on better projects for beginners?
Thanks y'all
Dody
|
|
|
|
|
onezerocode wrote:
I'm currently a firmware engineer
Snap! I moved from firmware to software too, so I thought I would answer your question. I'm still a novice really so others may have something more usefull to say.
I started with the book 'SAMS Teach Yourself Visual C++' and I found it very poor, it didn't expain much just took you through some examples (very briefly).
Next I got the book 'Practical Visual C++' by Bates & Tompkins, this was much better, it assumes that you know very little and explains a fair ammount.
Lastly, I am currently reading 'Programming Windows with MFC' by Jeff Prosise, this is an excelent book it talks alot about what is actually going on - I like that, coming from a firmware/hardware background I want to know what is 'under the hood', but you need to understand C++ first as it does not explain this.
Hope that helps, good luck ,
Ali
|
|
|
|
|
Programming MFC (written by Jeff Prosise) is a good reference.
A. Riazi
|
|
|
|
|
Looking for a good C++ reference book ??? "Thinking in C++" rocks, take a look at http://www.mindview.net/Books/TICPP/ThinkingInCPP2e.html.
Also, for M$ Development, MSDN provide exelent references e documentation.
Hope it Helps !!!
?
|
|
|
|
|
|
How to create a toolbar of more than one row in which bitmap is used to create buttons?
|
|
|
|
|
Try CreateToolbarEx.
Dody
|
|
|
|
|
hey my sdi ap starts off by mimising itself and i can't see why (i even so a showwindow sw_maximixed in by view's oninitialupdate)
anyone got any thoguhts?
Cheerypip
Bryce
|
|
|
|
|
I am no expert, but I belive that you would need to overide the showwindow function in your MainFrame class.. not the views..
|
|
|
|
|
hey get the Mainframe pointer in InitInstance() of AppClass and do as follow
pMainFrame->ShowWindow(m_nCmdShow|SW_SHOWMAXIMIZED);
it shud work now
nice time
Adi narayana
|
|
|
|
|
duuuh of course *feels like a plonker*
cheers for that
Bryce
|
|
|
|
|
Hello. This is a general C++ question. Can somebody please shed some light on the const modifier? I have been programming for about a year.. and I never use const because I really don't understand it... so I am trying to gain some ground, and I just can't understand this.
Please look at the class declaration below, and can somebody explain to me why the functions draw(), and getx() allow me to modify the private data members. they are declared const, so they shouldn't allow me to modify those variables.. but they do.
according to MSDN help library, you declare a member function const by placing the keyword after the parameter list.. this is what I did.. but it still lets me modify them.
I know if I declare the variables const it will work.. but shouldn't I be able to declare a function const so the compiler won't let me modify?
class cRectangle
{
public:
// constructors
cRectangle();
cRectangle(int nL, int nW);
// Destructor
~cRectangle();
// public accesors
void SetLength(int nL);
void SetWidth(int nW);
int GetLength() const { return *nLength;}
int GetWidth() const { return *nWidth;}
// public methods
void Draw() const;
private:
// Data Members
int* nLength; // pointers because they will be stored on the heap
int* nWidth;
};
// implementation file
// striped but draw() function
// Drawing functions
void cRectangle::Draw() const
{
// try and change a variable
*nWidth = 42; // why its this allowed????
// function is const? should not let me change
// the object.
}
If anybody could explain this to me. It would be greatly appreciated. Thank you.
|
|
|
|
|
because nWidth is a pointer to an int, not an int. your Draw code is changing the value that nWidth points to, not nWidth itself. and it will probably give you an access violation, since nWidth isn't initialized.
if you change the Draw code to "nWidth = 42", it will not compile.
-c
A | B - it's not a choice.
|
|
|
|
|
Damn - looks like you can type faster than me.
Christian
No offense, but I don't really want to encourage the creation of another VB developer.
- Larry Antram 22 Oct 2002
C# will attract all comers, where VB is for IT Journalists and managers - Michael
P Butler 05-12-2002
It'd probably be fairly easy to make a bot that'd post random stupid VB questions, and nobody would probably ever notice - benjymous - 21-Jan-2003
|
|
|
|