|
|
_T is a macro that is defined in tchar.h
If your compilation is a unicode one it will make that string a wide char type.
This is how it is defined...
#define _T(x) __T(x)
#define __T(x) L ## x
Nibu thomas
Software Developer
|
|
|
|
|
I always use TEXT , but heys thats just preference
It's a unicode thing... I'm going to make the assumption your now wondering what unicode is and suggest you check out this[^] article.
Check out this[^] article for an explaination about what the _T macro actually does.
It's worth getting into the habit of using the unicode ready versions of functions and the _T as it makes moving over to a unicode environment alot easier, especially when working on large projects (been there, done that - hopefully never again...)
Gavin Taylor
w: http://www.gavspace.com
-- modified at 1:01 Monday 20th March, 2006
|
|
|
|
|
Hi all
I am splitting a Text file and then merging its splitted parts.There is no problem in spitting the file, the total of size of all splitted parts remains same to original file but when i am merging those splitted parts the size of new file get increased as compare to original file.
//I have used this approach
iFile= fopen(sns,"r");
size=filelength(fileno(iFile));
char* buff1 =new char[size];
numread= fread(buff1,sizeof(char),size,iFile);
fseek(dFile,n,SEEK_SET);
numwrite= fwrite(buff1,sizeof(char),size,dFile);
fseek(dFile,0,SEEK_CUR);
n=ftell(dFile);
Thanx in advance;
alok singh chauhan
|
|
|
|
|
When I need to simulate a keyboard press event, I know I could use keybd_event or even PostMessage. How do I type a unicode character using PostMessage? Any help or pointers in this direction is greatly appreciated.
Aljechin Alexander
|
|
|
|
|
i want to identify that machine is online or offline through programming.if anybody know how it is possible and have any example please share with me .
Bankey Khandelwal
Software Engineer
|
|
|
|
|
Bankey Khandelwal wrote: i want to identify that machine is online or offline through programmin
InternetGetConnectedStateEx
"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
|
|
|
|
|
This[^] will make good reading too.
Nibu thomas
Software Developer
|
|
|
|
|
Im looking for MS Visual C++ Naming conventions. The naming conventions I know are from Visual Basic. I don't know if its ok to adopt the naming conventions from VB. If you know some articles on Visual C++ please let me know. Thanks.
|
|
|
|
|
|
I have some codes work properly under 32bit windows, but can't work under x64-based windows, such as win2003server/win64 XP pro, i don't want to rewrite my code, what should i do?
I am still use VC6 with service package5, can it compile the 64bit application
Tomorrow may not exciting, but the exciting tomorrow will surely come.
-- modified at 21:38 Sunday 19th March, 2006
|
|
|
|
|
VC++ 6.0 / Visual C++ 2003 are strictly 32bit, Visual Studio 2005 (including express editions) are the first offical Microsoft compilers to support x64 builds - From what I remember some of the more recently DDK's released before VS 2005 shipped with some sort of x64 support aswell but can't verify that though as I don't have any to hand.
Most code should be a pretty easy move across, it's worth checking out this[^] set of articles on MSDN which are a pretty good starting point on the new compiler, some of it's driver development specific but most of it's going to be relivent.
<edit>If your having problems actually running VS 6.0 on x64 - I don't know about that one and wont be able to try it until midweek, but I do know 2003 works fine</edit>
Gavin Taylor
w: http://www.gavspace.com
-- modified at 22:30 Sunday 19th March, 2006
|
|
|
|
|
It seems that i have to use the VS .NET 2005 to solve my trouble, any way, thanks very much!
|
|
|
|
|
i have 2 files :
file1.txt have a stream of "1010011"
file2.txt have a message :
The amount of energy used in buildings depends firstly on WHAT IT IS USED FOR.
i want to print to file3. the algoritm is simple:
read all char in file2 one by one and print in file3<br />
if char in file2 == space <br />
if char in file 1=='1'<br />
print 2 space in file3<br />
else if char in file1=='0'<br />
print 1 space in file3
below is my code
Binary=fopen("file1.txt","r");<br />
Message=fopen("file2.txt","r");<br />
Output=fopen("file3.txt"."w");<br />
while(true)<br />
{<br />
BinaryBuff=fgetc(Message);
if(feof(Message))<br />
break;<br />
<br />
else if (BinaryBuff=='A')<br />
fprintf(Output,"A");<br />
else if (BinaryBuff=='B')<br />
fprintf(Output,"B");<br />
else if (BinaryBuff=='C')<br />
fprintf(Output,"C");<br />
<br />
else if(BinaryBuff==' ')
{<br />
while (true)<br />
BinaryBuff==fgetc(Binary);<br />
if(BinaryBuff=='1')<br />
fprintf(Message," ")
else if (BinaryBuff=='0');<br />
fprintf(Message," ");
<br />
}<br />
<br />
}
the output in file3 should be :
The(2space)amount(1space)of(2space)energy(1space)used(1space)in(2space)buildings(2space)depends firstly on WHAT IT IS USED FOR.
but not work. what can i do???
HelpMe
|
|
|
|
|
Give more details - what do you mean "does not work"? It crashes? Nothing in output file?
From looking at the code, beardy janggut wrote: fprintf(Message," ")//print 2 space
this tries to write the spaces to the MESSAGE file - should be to OUTPUT.
|
|
|
|
|
I'm an infant when it comes to C++.
Can anybody help me to access a text file which has a comma that separates every item and after which put that file into an array which can be access later.
The problem is the items in a file are in this manner, each line:
char,int,int,int,long int,long int........
char,int,int,int,long int,long int........
char,int,int,int,long int,long int........
char,int,int,int,long int,long int........
........
.............
.........
......
upto 57-60 lines
Do i have to separate the char and int and long int and put it in different array?
Or put the items in a struct....
|
|
|
|
|
The way you have presented it, it looks like the choice is one of personal preference, rather than necessity.
How much coding is already done? Do you already have in place the code for reading the file line by line and parsing the data, or not?
Rich
|
|
|
|
|
Currently I've coded a chunk of code that extracts line by line. I've coded in Visual Basic and successfully extracted each of the input using this code.
Open FilePath For Input As #1
Delimiter = ","
SegmentCount = 1
ReDim TheSegments(1)
Do Until EOF(1)
DoEvents
If UBound(TheSegments) = SegmentCount Then
ReDim Preserve TheSegments(SegmentCount + 10)
End If
' Read a line from the vin file
Line Input #1, TheString
' Parse the line
SubStrings = Split(TheString, Delimiter, -1, vbTextCompare)
' Transfer all data to a Segment
'&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
' Get the name(description)
TheSegments(SegmentCount).Name = SubStrings(0)
' Get the Front Plane
TheSegments(SegmentCount).FrontPlane = Val(SubStrings(1))
' Get the Back Plane
TheSegments(SegmentCount).BackPlane = Val(SubStrings(2))
' Get the Color
TheSegments(SegmentCount).Color = Val(SubStrings(3))
' Calculate the number of pixels
PixelCount = UBound(SubStrings) - 4
TheSegments(SegmentCount).PixelCount = PixelCount
' Now get all the pixel positions
For Count = 1 To PixelCount
TempLong = Val(SubStrings(Count + 3))
'TheSegments(SegmentCount).Pixels(Count).Val = TempLong
TheSegments(SegmentCount).Pixels(Count).x = TempLong Mod 320
TheSegments(SegmentCount).Pixels(Count).y = TempLong \ 320
Next
'&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
SegmentCount = SegmentCount + 1
'''''''''''''''''''''''''''
Loop
Close #1
End Sub
In C++ i have no idea how to deal with this... I'm currently into self indulgement with this language at the same time working on Hardware and Software design of my project LCD USB Emulator...
|
|
|
|
|
So you want to pass the data to a C++ routine after it has been extracted by the VB program, or you just want to translate all of the VB code into a C++ program?
|
|
|
|
|
I just want to translate the VB code into C++ program. It's a bit difficult on my part.
Thanks
|
|
|
|
|
Hi Kuroro,
How about fscanf ?
Regards,
Chris
|
|
|
|
|
I'm currently studying string extractions. I can't focus really on software side coz i'm also designing the hardware...
Thanks Chris, I'll be trying it....
|
|
|
|
|
What does the dots at the end of each line signify?
Steve
|
|
|
|
|
char char_val;
int int_val1, int_val2, int_val3;
long int longint_val1;
char comma;
ifstream fs("C:\\a.txt");
if ( !(fs >> char_val >> comma) || comma!=',')
{
}
if ( !fs >> int_val1 >> comma) || comma!=',')
{
}
Steve
|
|
|
|
|
Steve,
Sorry for the dot stuff, that signifies another input of type long int... actually the first entry is Char, then the second, third and the fourth is of type int, the fifth until end of line is a type of long int. each line have different number of items.
I'm not good in explaining things.
Thanks Steve
|
|
|
|