|
In MBCS, a 'character' as the user thinks of it may be one or two bytes and in Unicode, it is two bytes.
More info regarding conversion from Unicode to mbcs refer MSDN with key as "MBCS/Unicode conversion"
The chosen One
|
|
|
|
|
In UNICODE, all the characters are in two bytes. (english characters, chinese characters, kanji characters, vietnamese character, etc )
In MBCS, english characters A-Z , a-z are in single bytes, but some characters like numeric 1- 10, chinese characters, kanji characters, vietnamese character, etc should be treated as two bytes or else you will not be able to read it properly.
You need a in depth study to understand it.
For your case as I assume you do not know about the languages like Chinese, Kanji, and etc. I suggest you to stick to UNICODE.
Just my suggestion.
Hope this helps.
Sonork 100.41263:Anthony_Yio
|
|
|
|
|
|
I see, au2B is defined like this,
#define au2B( STUFF ) auT(STUFF)
#define au2B( STUFF ) (LPTSTR)((LPCTSTR)STUFF)
but i'm still not sure what that means...and why there are 2 definitions...
Thanks for ur help guys...
|
|
|
|
|
I am uploading mltiple files at a time using FTP protocol. For this i am using multithreading. Each file is transferred through a different thread. But when i start more than one thread my CPU usage shoots up to 100 % and then everything becomes very slow. and sometimes the application hangs. What might be the reason for this???
|
|
|
|
|
are u looping somewhere?
hint
Sleep
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
hi,
What kind of syncronization objects u r using? Whats the priority of threads u have set?
I think u have posted this question few days back. Did u check with Trace() function as per suggested by somebody.
The chosen One
|
|
|
|
|
Synchronization object used is Critical section and priority of all the threads is Normal.
There is no looping. I have removed all the infinite loops.
Well to communicate with the main thread i am using SendMessage and not PostMessage. Is this the culprit???
As it is recommended to use PostMessage. I have to pass some structure and if i use PostMessage then that sturcture passed to the PostMessage function goes out of scope. So i have to use SendMessage for that. If there is any other alternative to achieve this.
|
|
|
|
|
samhita wrote:
SendMessage and not PostMessage. Is this the culprit???
Sure it is - You can't SendMessage from a thread (as you have seen demonstrated )
samhita wrote:
[...]that sturcture passed to the PostMessage function goes out of scope.
Construct that structure on the heap (new ...). (Your whole process with all threads shares one memory space)
Then send the address of that struct with PostMessage and do not delete it in your calling function. With the call to PostMessage , you transfer the ownership to your message handler.
After use (in your message-handler), you call delete on the struct, so as not to leak memory.
Hope this helps
Who is 'General Failure'? And why is he reading my harddisk?!?
|
|
|
|
|
|
Michael Dunn wrote:
[Sendmessage from a thread]
But then you have to do a lot of synchronisation yourself.
Who is 'General Failure'? And why is he reading my harddisk?!?
|
|
|
|
|
after execute an app by CreateProcess() function, we can establish communication pipe between the app and its owner (another app).
the owner, in some way, is a "command window".
now i want to use shared memory between the 2 apps.
the Q comes from java jdb.exe (an app).
when i use dos command window to execute jdb.exe, they communicate properly.
but when i use my app to execute jdb.exe, they can't communicate each other.
the reason is that the commanication must be on shared memory, not pipe (ip is possible OK but not in our case).
do you have any idea that how dos command window use sheared memory or how an user app use shared memory whth other apps?
thanks in advance.
includeh10
|
|
|
|
|
|
Hi, can u please tell me how to remove icon from header in CListCtrl ?
Thanks.
|
|
|
|
|
hi,
IN LVCOLUMN structure, give blank image id.
This should work.
Chill
Anand
The chosen One
|
|
|
|
|
Thx but text is not formated right , there is a space between text and border
|
|
|
|
|
What space u c is not space it is blank image.
Live with it if possible
The chosen One
|
|
|
|
|
hi,
for my application backend is mysql. for crystal report i need to create ODBC dsn on run time. any one help to me.
thanks in advance.
|
|
|
|
|
How do i get the mapped drive information?
Suppose I map a folder Shared of machine A to drive h then how to get the mapped drive information like which folder is mapped to this drive.
Suvarna
|
|
|
|
|
Check out WNetGetConnection() .
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
I am setting font to menu items. For this i have set the onwerdraw property to true and implemented DrawItem.
In WndProc Procedure the lparam parameter is type cast to Drawitemstruct. This has one field as itemId which specifies the menu item id.
In windos 2000 i am not able to get this item id correctly, if the menu item has a submenu. for example if my menu is like
File Edit Search
|-------Open |-----Find
|-------New |-----Find Next
|------Close
Then it does not give itemid of file properly, some big value is assigned to itemid which is not correct. Similarly i am not getting itemid of search as well. For rest of the items Open, New, Close,Edit, Find and Find Next i am getting the correct item id and i am able to change its font and font size.
This concludes that if any menuitem has a submenu then its item id is not assigned properly. Also this happens in Winows 2000 only and in Windows 98 it shows properly. Can anybody please tell me why it is not assigning correct itemid?
Suvarna Joshi
|
|
|
|
|
How do I Change the font for text in controls . like a CStatic or CButton Object ?
|
|
|
|
|
::SendMessage(hWndStatic, WM_SETFONT, (WPARAM)hFont, (LPARAM)TRUE);
--
Human beings, who are almost unique in having the ability to learn from the experience of others, are also remarkable for their apparent disinclination to do so. (Douglas Adams)
|
|
|
|
|
I am running a Dialog app that creates a ProperySheet .
1)The sizes and positioning in one screen resolution seems totally ugly in the other . How do i make all positioning independent of the Windows screen settings ! Please help
2) I want my PropertySheet window never to be closed ! How to do this ?
3) I want to disable one of the tabs of my PropertySheet at runtime ! How do I do this ?
act_x
I have lost the race of finding a Software job in the US ! I am outta here!
|
|
|
|
|
hi,
1) use GetSystemMetrics to get the screen resolution without depending on which resolution you are in, then set the size to be a ratio from the screen width and height
2) override OnApply and just return
3) override OnSetActive for the property page u want to disable...
hope i helped ya
Yaron
|
|
|
|