|
kiranin wrote: any suggestions?
What is it doing?
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
iT IS NOT WRITING ANYTHING ....I HAVE STRING WHICH IS HAVING ENGLISH + CHINESE - WRITING ENGLISH STRING ONLY WHEN CHINESE STARTS ITS WRITES NOTHING
|
|
|
|
|
THERE IS NO NEED TO SHOUT AT HIM.
You said "failing".
But imagine you go to the doctor, and say "I am ill", and then say nothing else. Do you expect him to give you a cure for cancer?
Or when he says "Oh dear, that must be bad. What are your symptoms", you reply "I AM ILL"?
IN WHAT WAY is it failing?
Have you tried stepping into the CStdioFile::WriteFile yourself, and tracking your string to see where it goes wrong?
Iain.
Codeproject MVP for C++, I can't believe it's for my lounge posts...
|
|
|
|
|
This is what I used in a project few days ago:
std::basic_string<TCHAR> sFileContent = _T("");
if (sizeof(TCHAR) > 1) // if wide char
sFileContent += 0xFEFF; // this header tells notepad to read file as Unicode
sFileContent += _T("My favorite Dave Attell quote: ");
sFileContent += _T("Yeah, I know, some people are against drunk driving, ");
sFileContent += _T("and I call those people 'the cops'. But you know, ");
sFileContent += _T("sometimes, you've just got no choice; those kids gotta get to school!");
// save to file routine
|
|
|
|
|
From MS page
Byte order mark Description
EF BB BF UTF-8
FF FE UTF-16, little endian
FE FF UTF-16, big endian
FF FE 00 00 UTF-32, little endian
00 00 FE FF UTF-32, big-endian
Note: Microsoft uses UTF-16, little endian byte order.
|
|
|
|
|
having the same problem here, someone to help ?
|
|
|
|
|
Need help on Wizard Model..
Like3 dialogs flowing from one to other (First Dialog (Changed data , some controls dynamically created) -> Second Dialog (Changed data , some controls dynamically created) -> Third Dialog)
And when i want to come back from Second dialog to first the changed data and dynamic controls should exist on first dialog ..
What is the best method to do so?
|
|
|
|
|
please, show me how to solve this problem .
I need to create 2 process as follow :
process 1: this process allows us to enter an expression .
process 2: this proces calculates the above expression and return result for 'process 1 '.
Use 'Message queue ' to interact between 2 above process.
chet la het
|
|
|
|
|
Hi,
this is the recipe in pseudo-code:
1. follow a programming course
2. choose a programming language
3. get a development system
4. open the IDE
5. write some code that creates two processes
6. write some code that creates/writes to/reads from a 'Message queue'
7. run it
8. when problems occur, fix them
when stuck, read the documentation; use Google and/or MSDN.
when you have a specific question, ask it here, providing all relevant information and showing what
you did so far.
|
|
|
|
|
Hey man, he doesn't need all your points, he is 'Senior Developer', after all (I suppose... )
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]
|
|
|
|
|
What happend? are you ill,your color is gray?
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
how do I do step 1 - plz, its urgentz
chuckle - nice list Luc - I think it should be the stock-standard reply for these cases
hope you're having a fun weekend
Garth
|
|
|
|
|
Hi
do you give me an example??? because I don't do it .
thanks,
chet la het
|
|
|
|
|
I found this in the online help
http://msdn.microsoft.com/en-us/library/ms682499(VS.85).aspx
Creating a Child Process with Redirected Input and Output
This may be what you are looking for. It is actually very clever and the example worked for me.
-------------
Bibo ergo sum
|
|
|
|
|
Have a look at the 'two processes message queue ' project in the 'gimme codez urgent ' section of the website www.cpallini.free.productz.com.
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]
|
|
|
|
|
... and if you don't trust that site, just search CodeProject. Most of the articles on CP
have been scrutinized by golden boys.
|
|
|
|
|
Luc Pattyn wrote: ... and if you don't trust that site
Are you communist?
-- Bob Roberts, 1992.
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]
|
|
|
|
|
I'm not running for the senate.
|
|
|
|
|
I (Bob) am running for the Senate, you are the interviewer.
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]
|
|
|
|
|
What is the essence of your program?
Will it be ready in time? and within the budget limits?
What is your main problem?
(Please provide answers to each question in less than 14 seconds)
|
|
|
|
|
Sorry, time is up.
Capitol Hill will not be yours, try Porta Vittoria instead.
|
|
|
|
|
Oh, you communist looser... I (Bob) am actually not able to answer your questions, anyway I will win, 'cause I'm a true american patriot!
BTW Are you a terrorist?
BTW2: welcome in the THHB [^], Luc!
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]
|
|
|
|
|
I have compiled the following program in MS Visual C++ 6.0
Its strange for me to know the output of the program.
#include <stdio.h>
struct struct1
{
int i;
};
struct struct2
{
char s[2];
};
struct struct3
{
char s[2];
int i;
};
struct struct4
{
char s1[2];
int i;
char s2[2];
};
struct struct5
{
int i;
char s2[2];
};
int main()
{
printf("\nSize of Structure 1 = %d",sizeof(struct struct1));
printf("\nSize of Structure 2 = %d",sizeof(struct struct2));
printf("\nSize of Structure 3 = %d",sizeof(struct struct3));
printf("\nSize of Structure 4 = %d",sizeof(struct struct4));
printf("\nSize of Structure 5 = %d",sizeof(struct struct5));
printf("\n\n");
return 0;
}
The size shown by the program for structure 1 and 2 is OK. But result of structure 3,4 and 5 is mind f***ing. Why; when I declare the integer and charector in the same structer, the compiler add 2 extra bytes?
Actually i am reading the data from a binary file using the structure. But this thing has made me fool from last 2
days.
If anyone knows the reason or solution of that problem, please reply.
----------------------Output of the program-----------------
Size of Structure 1 = 4
Size of Structure 2 = 2
Size of Structure 3 = 8
Size of Structure 4 = 12
Size of Structure 5 = 8
|
|
|
|
|
if I remember correctly, the compiler adds packing bytes in certain cases to align data properly in memory
I believe there's a #pragma (PACK,<something,possibly num packing bytes/alignment > ) statement/define that can be used to change this
that may give you enough info to google/search on to see how accurate my memory is at 11pm on a Sat night ....
'g'
|
|
|
|
|
The compiler want's to align data so that it can be accessed efficiently. This generally means aligning the data on an n-byte boundary (so the address of the data is a multiple of n), or whatever it takes because processor operations are optimised for reading aligned data. What this means in practise is that integers, floats and structures are on 4 or 8 byte boundaries.
When this is applied to data in a structure, it can mean that padding is inserted to ensure that items with alignment requirements (such as integers) are correctly aligned. This is what you are seeing.
For more information, here's a Wikipedia page on the subject[^].
|
|
|
|