|
It is MDI application in vc++. It contains 32 dialogs. Each dialog could contains 4 to 7 tabs. When I am running my application and opened one Child dialog. switched between two tabs in same child dialog. Suddenly XP feature got disabled. I am working on WINDOWS XP, VC++6.0. How can I solve this problem. Kindly let me know the solution.
Why this problem is comeing. Can any one help me in this.
Cheers
-Haranadh
-- modified at 2:21 Wednesday 31st August, 2005
|
|
|
|
|
I know how to import the .lib files into vc++, but how to use them?
if I import MSN Messengers .lib files, then I can see its classes like DMessengerEvents::OnSignin;
but when I creat a button and put the code in Onclick, then nothing happen... any ideas about this?
|
|
|
|
|
Hello,
I need to make my window to be the background window of some of currently running windows (eg. all notepad windows).
When the user activates the notepad (one of the running notepad or opening a new one), my application should come to top, but behind all the notepads.
Similarly if the user activates my window, the same thing should be happened.
In other words, my window needs to be the background of all the notepads.
Does anybody have an idea to solve this problem?
|
|
|
|
|
Nishad S wrote:
my window needs to be the background of all the notepads
Do you mean, your window should be "behind" all notepads windows ? Or should the background of the notepad window (the white surface on which you write the text) be your window ?
~RaGE();
|
|
|
|
|
|
Yes, I want my window to be behind all the notepad windows.
|
|
|
|
|
In my attempts to make my program as versatile as possible I followed all the advice given about using TCHAR's and the _T macro so that my code could be compiled in both the ansi standard and the UNICODE standard. However i have run into a wall now which suggests i am not understanding something.....
in this line:
sFontDetails.FaceName = _T("Times New Roman");
i get the error:
error C2440: '=' : cannot convert from 'const unsigned short [16]' to 'WCHAR [32]'
I was under the impression that the _T macro when used with a string literal should be automatically converted to the WCHAR[] type or the normal char[] type depending on whether i have the line #define UNICODE in my program or not..... what am i missing?
Thanks in advance,
Ed Bosher
|
|
|
|
|
did you defined those two constants :
stdafx.h :
#define _UNICODE
#define UNICODE
do it at the beginning of the stdafx.h file...
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
The Groinal Rampager wrote:
sFontDetails.FaceName = _T("Times New Roman");
i get the error:
error C2440: '=' : cannot convert from 'const unsigned short [16]' to 'WCHAR [32]'
I was under the impression that the _T macro when used with a string literal should be automatically converted to the WCHAR[] type or the normal char[] type depending on whether i have the line #define UNICODE in my program or not..... what am i missing? <
What is the type of 'FaceName'?
|
|
|
|
|
Sloppy Joseph wrote:
error C2440: '=' : cannot convert from 'const unsigned short [16]' to 'WCHAR [32]'
What is the type of 'FaceName'?
i believe it is WCHAR[32]... don't you agree ?
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
|
TheGroinalRampager wrote:
if I hadn't i believe it would have a different error along the lines that _T would not a be a declared macro....
no, _T() is declared for both Unicode and ansi. this is for allowing compilation for unicode and ansi without changing the code...
TOXCCT >>> GEII power [toxcct][VisualCalc]
-- modified at 7:32 Tuesday 30th August, 2005
|
|
|
|
|
Ok thx didn't know that but still, I have definately declared both the UNICODE macros, if I remove them it says:
error C2440: '=' : cannot convert from 'const char [16]' to 'CHAR [32]'
instead of (with #define _UNICODE and #define UNICODE):
error C2440: '=' : cannot convert from 'const unsigned short [16]' to 'WCHAR [32]'
So maybe the question is why is the UNICODE macros turning my string into and unsigned short and not a WCHAR?
|
|
|
|
|
because the operator = () don't copy the contents of the C-style strings but only the addresses of the pointers...
does this error occur with strcpy() ? i doubt...
you could use strncpy() also if you want to copy not the totality of the string but a part...
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
Yes it is WCHAR, I have already included the #define UNICODE and #define _UNICODE line, if I hadn't i believe it would have a different error along the lines that _T would not be a declared macro....
|
|
|
|
|
The Groinal Rampager wrote:
sFontDetails.FaceName = _T("Times New Roman");
it is just as if you were doing this :
char* psz = "Hello";
char tab[10];
tab = psz;
use <a href = "http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclib/html/_crt_strcpy.2c_.wcscpy.2c_._mbscpy.asp" rel="nofollow">strcpy()</a>[<a href = "http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclib/html/_crt_strcpy.2c_.wcscpy.2c_._mbscpy.asp" target = "_blank" rel="nofollow">^</a>] and/or wcscpy()
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
The problem with doing that is doesn't it stop the code from being able to be compiled in both ansi and UNICODE since i would have wcscpy() in my code? I suppose some macros could fix it but i would rather just use the _T macro which is how MSDN says it should work.....
thx again though
|
|
|
|
|
hum, yes, but you can now define a macro like this :
#if defined(_UNICODE)
#define _MBCSCPY wcscpy
#else
#define _MBCSCPY strcpy
#endif
now, you can use it just like that :
#include <string.h>
TCHAR* psz = "Hello";
TCHAR tab[10];
_MBCSCPY(tab, psz);
_tcscpy(tab, psz);
it will use strcpy() if _UNICODE is not defined, wcscpy() otherwise.
TOXCCT >>> GEII power [toxcct][VisualCalc]
-- modified at 8:44 Tuesday 30th August, 2005
|
|
|
|
|
toxcct wrote:
hum, yes, but you can now define a macro like this :
#if defined(_UNICODE)
#define _MBCSCPY wcscpy
#else
#define _MBCSCPY strcpy
#endif
Or simply use _tcscpy , which is already defined with the same purpose
--
jlr
http://jlamas.blogspot.com/[^]
|
|
|
|
|
yes,
thanks for the info, i did not read the msdn page to the end...
i updated my post consequently.
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
Hi,
sFontDetails.FaceName is an array of character, you cannot simply do this
sFontDetails.FaceName = _T("Times New Roman");
So use _tcscpy() it will work fine for you
" Action without vision is only passing time,
Vision without action is merely day dreaming,
But vision with action can change the world "
- Words from Nelson Mandela
Thanks & Regards,
Gopalakrishnan
|
|
|
|
|
did you bother read the other posts on that thread ?
all you said were already answered...
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
Thanks everyone, tried _tscpy and it worked like a charm:
_tcscpy(sFontDetails.FaceName, _T("Times New Roman")); //no problem
Learning C++ having done C# is clearly giving me some problems. Anyway thanks again to all who helped...
|
|
|
|
|
Respected all
Regards!
I am david and have a problem.
I have a number of images that store on disk i want that when i run my program all the images readed once and then store in memory temorarily and then displaying from memory rather reading one by one from desk.
plz guide me.
from
david
|
|
|
|
|
First you have to make some memory dcs. I think you can!
Then load the images to that dcs with LoadImage(...).
You can then use those dcs anytime you want to show the images.
OK?
|
|
|
|