|
Is that an MFC or a Win32 project? You don't see something like _MBCS or _UNICODE or UNICODE even?
Many are stubborn in pursuit of the path they have chosen, few in pursuit of the goal - Friedrich Nietzsche
.·´¯`·->Rajesh<-·´¯`·.
[Microsoft MVP - Visual C++]
|
|
|
|
|
Its MFC project and the settings are WIN32;NDEBUG;_WINDOWS and not _MBCS or _UNICODE or UNICODE
|
|
|
|
|
So add _UNICODE to it.
WIN32;NDEBUG;_WINDOWS;_UNICODE
|
|
|
|
|
I have changed the preprocessor definition to
WIN32;NDEBUG;_WINDOWS;_UNICODE
but still it is not able to recognize japanese and other characters
Please help me.
|
|
|
|
|
Please, can you be a little more specific than that? We want to help you, but you won't let us help you.
What do you mean by "not able to recognize"? Is the control displaying question marks? Are you able to type Japanese characters elsewhere (say in Notepad) on the same computer? I am hoping that after changing the preprocessor definition to include _UNICODE, you did a rebuild. Is your control capable of displaying "other" Unicode characters than Japanese?
Many are stubborn in pursuit of the path they have chosen, few in pursuit of the goal - Friedrich Nietzsche
.·´¯`·->Rajesh<-·´¯`·.
[Microsoft MVP - Visual C++]
|
|
|
|
|
Actually the Original Japanese Message is こんにちは貴重私の名前はcmoing何が私にところでdhirajである。.
But when i copy it and paste it in the CEditControl it shows boxes as characters.
I am not able to type Japanese characters on notepad but i was able to type on codeproject as u can see the text which i have sent to u above.
After rebuild i havent checked it for english characters for which it is working but not for Japanese. One thing more i want it to accept any characters other than Japanese also
Thanx
|
|
|
|
|
Dhiraj kumar Saini wrote: I am not able to type Japanese characters on notepad but i was able to type on codeproject as u can see the text which i have sent to u above.
If you are not able to type it in notepad (exclude the browser for now), you will NOT be able to type it in your application. You need to read a very good tutorial on Unicode. Please, search for one and read.
Coming back to your problem, please install/enable Japanese language on your computer and first try to successfully type it in notepad. You can do it from Control Panel -> Regional and Language Opttions -> Languages -> (Check and Enable) Install files for East Asian Languages. (Windows XP assumed)
After you finish this step, restart the computer if required and do a Unicode build of your application and then try typing it in your app.
Many are stubborn in pursuit of the path they have chosen, few in pursuit of the goal - Friedrich Nietzsche
.·´¯`·->Rajesh<-·´¯`·.
[Microsoft MVP - Visual C++]
|
|
|
|
|
under the preprocessor definitions are WIN32;NDEBUG;_WINDOWS
|
|
|
|
|
Hello, There.
I changed tool, VC++2008 but I had a error code.
How can i repair this error?
Error Message
=======================
Error 1 error C2440: 'static_cast' : 'void (__thiscall CDisplayRect::* )(WPARAM,LPARAM)' to
'LRESULT (__thiscall CWnd::* )(WPARAM,LPARAM)' Can't change.
Maked Message.
=======================
// for Windows messages #define ON_MESSAGE(message, memberFxn) \ { message, 0, 0, 0, AfxSig_lwl, \ (AFX_PMSG)(AFX_PMSGW) \ (static_cast< LRESULT (AFX_MSG_CALL CWnd::*)(WPARAM, LPARAM) > \ (memberFxn)) }
Calling Function.
===================
ON_MESSAGE(WM_DISPLAY_RECT, DisplayRect);
Thank you
|
|
|
|
|
Well this is due to prototype difference in ON_MESSAGE macro message map function. Earlier this function returned a void now it returns an LRESULT .
So you got to change the prototype from
void DisplayRect(WPARAM, LPARAM)
to
LRESULT DisplayRect(WPARAM, LPARAM);<br />
Another one that has changed is ON_WM_ACTIVATEAPP() , whose last parameter used to be HTASK but now it's DWORD .
Nibu babu thomas
Microsoft MVP for VC++
Code must be written to be read, not by the compiler, but by another human being.
Programming Blog: http://nibuthomas.wordpress.com
|
|
|
|
|
Hi,
I am using the following statement. It works fine for debug mode but not for release mode. whats the problem.
double dServerAppVersion = _wtof(strServerAppVersion);
Please tell me.
Thanks In Advance
|
|
|
|
|
Possibly the debug build defines the _UNICODE symbol while the release build NOT defines it.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Hi,
I want to display a scrollbar in my MFC ActiveX Control. How do i do this? Do i have to create a scrollbar control or is there a way i can specify a scrolling window style or maybe a scrollable view i can work with?
Thanks for the help
Regards
Jagannathan
|
|
|
|
|
SandipG :) wrote:<br />
<br />
Why dont you create a stitched bitmap first and then draw this bitmap on device context.<br />
i mean <br />
Graphics gr(bmpTemp)<br />
.... Stitching code.<br />
<br />
Graphics gr(hDC)<br />
RatateTransform()...<br />
DrawImage(bmpTemp)..<br />
<br />
Does it make sense?? <br />
<br />
<br />
Regards,<br />
Sandip.
I received a reply from Sandip but I'm having hard time translating it to code. The process is what i needed it's just that I can't make it work.
First I haven't found a constructor for
Graphics gr(bmpTemp)
and for function
DrawImage(bmpTemp)..
I'm not that good in GDI so I hope somebody can help me.
It will be a big help if you reply. Thanks.
|
|
|
|
|
TooShy2Talk wrote: Graphics gr(bmpTemp)
(One overload of )The Graphics constructor accepts a pointer to a CImage object.
DrawImage (as well as RotateTransform ) is a method of the Graphics class.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
But how will I declare bmpTemp?
?????????<br />
Graphics gr(bmpTemp)
I'm confused on how will I declare this one.
Can yu please show. Thank you.
|
|
|
|
|
Did you look at the link i gave.
It shows a graphics constructor which accepts Image class object as a parameter.
Bitmap class is derived from the Image class. So when you will pass the Bitmap object to the graphics constructor it would invoke that constructor.
Now declaration of bitmap.
You can simply create a canvas bitmap which will hold your other bitmaps someting like this.
Bitmap *bmpTemp = new Bitmap(iWidth,iHeight);
Is it clear now???
Regards,
Sandip.
|
|
|
|
|
I have tried
Image *bmpTemp;<br />
Graphics gr(bmpTemp);<br />
.... stitching here
but result to following error,
bmpTemp is being used without being defined.
I don't really know how to implement it.
|
|
|
|
|
For instance
CImage bmpTemp;
bmpTemp.Create(640,400,32);
Graphics gr(& bmpTemp);
Bitmap bmpTemp(640,400, PixelFormat32bppRGB);
Graphics gr(& bmpTemp);
Did you follow the link provided by
Sandip?
Have you a good C++ tutorial?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
modified on Tuesday, September 9, 2008 4:41 AM
|
|
|
|
|
Yes, I have tried also
CImage bmpTemp;
but there is no intellisense for .Create()
bmpTemp.Create();
I have tried including altimage.h but it comflicts to other class I'm using.
Or is there other header to include?
|
|
|
|
|
TooShy2Talk wrote: CImage bmpTemp;
I dont know if CImage is derived from Image.
But you can use
Image *bmpTemp = new Image(iWidth,iHeight);
Did you try this??
I don't know why are you facing so much trouble in this
Previously you were using hDC directly to draw your bitmaps on.
Now you just have to replace this hDC with temporary bitmap..
and once you finish all your operations do following
Graphics gr(hDC);
gr.RotateTransform(..);
gr.DrawImage(bmpTemp);
Is it clear?
Regards,
Sandip.
|
|
|
|
|
SandipG wrote: But you can use
Image *bmpTemp = new Image(iWidth,iHeight);
I received an error on this,
I think there is no constructor available.
|
|
|
|
|
TooShy2Talk wrote: Image *bmpTemp = new Image(iWidth,iHeight);
I am nt sure if constructor is available for the Image class but it is surely there for Bitmap.
What is the problem you facing in following code.
Bitmap *bmpTemp = new Bitmap(iWidth,iHeight);
Graphics gr(bmpTemp);
If you still have problems
Please Look at this section on CP GDI+[^]
I hope it will help you..
Regards,
Sandip.
modified on Tuesday, September 9, 2008 4:40 AM
|
|
|
|
|
You're right: I made confusion, I'm sorry about.
I've modified my previous post. Hope it helps.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Finally, it WORKS.
Thank you very much.
It's a big help.
Till my next question.
|
|
|
|