|
I am attempting to change some text in a .dat file used on a pda with EVC++4.
However when my application reads the file on the pda it appears that every character that has been written to the file has a Null character after it.
When this file is transfered from the pda to a pc via activesync and viewed on the pc in notepad it appears that the null values are not present.
I have tried using fgetc to read each character from the file and fread to read the file into a char array and both options show the Nulls after each char. Tried fgets but this will not read I believe due to the Nulls in the string.
I am able to change the required text but it appears to be damaging the file as when viewed on the pc after the change it appears that the null values are present, also the application that uses this file fails to read it.
Would anyone know please why there would be null values after each character. Could the characters have been written originally as wide characters. If so could you help with a bit of sample code for the easiest way to read and write wide character data from and to a file.
Thanks
steve
|
|
|
|
|
the file is written in unicode. in unicode, each "character" is actually coded on 2 single bytes, so mainly, if it contains common occidental characters, their char code is within 0 to 255, which causes the 2nd byte to be 0.
|
|
|
|
|
It sounds like the file is written using the 16-bit character set (UNICODE). Use the wide versions of read functions and objects (wstring, wifstream, etc).
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week
Zac
|
|
|
|
|
sdt24 wrote: However when my application reads the file on the pda it appears that every character that has been written to the file has a Null character after it.
fgetwc
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
Hello,
I have imported a VC6 project into Visual Studio 2005 and have a question. When looking at the dialogs in the dialog editor pane, they look fine--with the current style of buttons and such. But, when I execute the app, the buttons are rendering the older Windows style instead of the current version.
I created a new app just to see if I could duplicate the problem and i could not. This seems to have something to do with the import.
Does the import/conversion process not update the rendering to the latest styles?
Thanks!
|
|
|
|
|
|
ctroyp wrote: Does the import/conversion process not update the rendering to the latest styles?
if you need XP style you have to include manifest file in your program!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
So basically, if I do not have a manifest for it I need to create one?
Thanks for the reply...
|
|
|
|
|
ctroyp wrote: basically, if I do not have a manifest for it I need to create one?
yes you have to create one... see the link provided by Sarath
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
I've looked through articles and in the forums but wasn't able to find what I needed. I'm trying to find a way to control the minimum size of the main/parent window so the user can't make it too small for the toolbar. I know there is a way to do it but for the live of me I can't find where to put the code. I created my initial code using MS Visual Studio MFC wizard so I have the standard classes. Any help would be appreciated.
Thanks,
Bubba
Wishin'I was fishin'.
|
|
|
|
|
BubbaGee wrote: Studio MFC wizard so I have the standard classes. Any help would be appreciated.
handle WM_GETMINMAXINFO Notification
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
|
for that you have to handle WM_SIZE too
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
Yaa...Need to handle WM_SIZE too
Dream bigger... Do bigger...Expect smaller
aji
|
|
|
|
|
see me wrote: Yaa...Need to handle WM_SIZE too
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
hi all
i want to load images which is in a folder to the list box.
Some one Please help me
Dream bigger... Do bigger...Expect smaller
aji
|
|
|
|
|
You'll need to make sure the listbox has the LBS_OWNERDRAWFIXED style.
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
I did this by ticking the check box Owner Draw Fixed.
Is there any other method??
OR how can i load the images to list box from a folder that specified by me????
Dream bigger... Do bigger...Expect smaller
aji
|
|
|
|
|
see me wrote: Is there any other method??
You may also need to handle the following messages:
WM_COMPAREITEM (only if the LBS_SORT style was used)
WM_DELETEITEM
WM_DRAWITEM
WM_MEASUREITEM
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
You can use also from CListCtrl i think its better than CListBox
You can see an example for your answer with CListctrl in codeproject "Thumbnail_demo"
|
|
|
|
|
I want to retrieve history of files printed on a machine using VC++/MFC/C/C++. Can any one help me out ? any ideas ?
i want the foll details:
1.Names of all files printed from machine x
2.Date and Time of printed files
3.Errors if any while printing these files
Thanks in advance,
-Mahesh
Mahesh
|
|
|
|
|
Check out the API calls FindFirstPrinterChangeNotification, FindnextPrinterChangeNotification etc.
|
|
|
|
|
Duncan Edwards Jones wrote: Check out the API calls FindFirstPrinterChangeNotification, FindnextPrinterChangeNotification etc.
AFAIK, I believe that is not the right API to accomplish that
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
|
mahesh kumar s wrote: I want to retrieve history of files printed on a machine...
You mean after they have been printed? I am not aware of such information being retained by Windows.
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|