|
i am reading a file in win32 now my file data is stored in the WCHAR array buffer
now I want to put this data orderwise in the listview.
for that i need to convert WCHAR to string.
Environment .net(unicode).
the xml file is below.
<xml>
<FILElist>
<listitem type="file" order="1" >
<filename>C:\Documents and Settings\Administrator\Desktop\MediaFiles\TT.wmv</filename>
<Extension> khuntapada </Extension>
<size>494KB </size>
<duration>00:00:38</duration>
<bitrate>103kbps</bitrate>
<type>Windows Media Audio/video file</type>
<modifieddate>12/10/2005 </modifieddate>
<protected>completed/incompleted</protected>
</listitem>
<listitem type="dir" order="2">
<path>C:\Documents and Settings\Administrator\Desktop\MediaFiles </path>
</listitem>
</FILElist>
</xml>
source file
WCHAR szBuff[5000];
hFile=CreateFile ( L"c:\\Encoder_3.XML"
, GENERIC_READ | GENERIC_WRITE
, FILE_SHARE_READ
, NULL
, OPEN_EXISTING
, FILE_ATTRIBUTE_NORMAL
, NULL
);
if(hFile == INVALID_HANDLE_VALUE)
{
MessageBox(0,_T("File is not exist"),_T("Create File"),0);
}
else
{
MessageBox(0,_T("File is exist"),_T("Create File"),0);
}
bool bSucced=ReadFile(hFile,&szBuff,5000,&dwRecvLen,NULL);
szBuff[dwRecvLen] = '\0';
size_t len = wcslen(szBuff) * sizeof(WCHAR);
char* tempOutFile = new char[len];
WideCharToMultiByte(CP_ACP,0,szBuff,-1,tempOutFile,(int)len,NULL,NULL);
//std::string str1 = tempOutFile;
|
|
|
|
|
Hello to all...
Please suggest me neccessary stuff about client server programming..
I need to build an application where I have some exe file (say A.exe) on the server...
Client sent a path of a file(say B.exe) on their machine to server..
Server modifies that file(B.exe) on the cliend end...using the Exe(A.exe).
I hope request is clear..
Bye...
|
|
|
|
|
Hi,
I was looking about C++ crtification but didn't really find anything. So, I wonder if someone can help me telling about how to be a certified C++ Professional.
Thanks very much
C++Prog
|
|
|
|
|
Certification doesn't mean anything, and I've NEVER been asked if I was "certified". Get experience and demonstrate some talent.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
I've heard it suggested you may be certifiable, is that the same ? :P
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Close.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
celllllllll wrote: So, I wonder if someone can help me telling about how to be a certified C++ Professional.
Hardly[^]
|
|
|
|
|
|
Certifications are a joke, they are a waste of time. They prove nothing, apart from a willingness to pay for a test over and over, until you pass it.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Christian Graus wrote: Certifications are a joke
And Microsoft is Big. So Microsoft Certified means a Big Joke?
Nobody can give you wiser advice than yourself. - Cicero
ப்ரம்மா
|
|
|
|
|
Yep, probably
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
All the certificate shows is that you know how to take and pass a test. It doesn't show you are good at what you do. The chances are you will never be asked for it.
I'm a certified teacher. I spent years and a lot of money to get my certificate. Does that make me a good teacher? Does it prove I can handle rugrats nibbling away at my ankles? I think not. I have never EVER been asked for my qualifications, the only thing I do get asked for is my experience.
|
|
|
|
|
Hi,
The test case 30(“Verify the application is Restart Manager Aware”) for Certified for Vista tells "The application should shut down quietly via the RMShutdown API".
It's means I've to handle WM_QUERYENDSESSION in my application and respond TRUE back to OS.
The application should be in on idle. My application is MFC MDI application.
- The question is : where(CMainFrame or in MyApp::OnIdle()) and how(I've to return TRUE back) should I handle this.
Thanks for the any sutable information.
|
|
|
|
|
oleg63 wrote: It's means I've to handle WM_QUERYENDSESSION in my application and respond TRUE back to OS.
TRUE is the default return value. Unless your application needs to return FALSE , you don't need to do anything.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
This has been a problem of mine for years.
It appears to be compiler specific which is why I put it in this section.
Run this piece of code
double test = 3.0/10.0;
The result of test is .299999999999999
I know why this happens. I was just wondering how some of you have solved this problem.
Thanks for any input
George W
Software Developer
www.zsystems.ca
|
|
|
|
|
IGeorgeI wrote: I know why this happens. I was just wondering how some of you have solved this problem.
If you know why it happens, then you must also know it has no solution. Floating-point numbers behave that way on binary machines.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Of course but when you are dealing with high precision numbers, you have to implement workarounds to solve the problem.
I was just wondering how others have handled it. You simply cannot leave it like that when dealing with mathematical engines written in c++. The error will carry through and get worse. So I just wanted to see what others are doing.
For your information, the c# compiler does solve the problem and does give you to correct base 10 answer of .30
George W
Software Developer
www.zsystems.ca
|
|
|
|
|
IGeorgeI wrote: For your information, the c# compiler does solve the problem and does give you to correct base 10 answer of .30
Perhaps it makes use of some sort of epsilon value. See here for more.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
IGeorgeI wrote: For your information, the c# compiler does solve the problem and does give you to correct base 10 answer of .30
First, this isn't a C# forum.
Second, If you're doing this in C++, you're going to have to write some code to "fix" it. Write yourself a rounding function that will round to the nearest whole number. It ain't rocket science.
Third, you're arguing with someone that's trying to help you. Not very smart, even for a C# programmer.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
I am not a C# programmer by trade. I am a C/C++/Java/MFC developer.
1) I posted my C++ question in the C++ section of this forum. I merely added the fact about the C# compiler to help other people. You must have misunderstood my post.
2)I have written work arounds for this problem, I just wanted to see how other people have handled this problem out of pure interest. We can all become better programmers if we want to. You must have misunderstood my post.
3) At no point was I arguing with him. Why would I argue with somebody who is clearly trying to help me?? You must have misunderstood my post.
I would suggest that in the future you should try reading the post more closely to avoid misunderstandings like this. If you want, you can contact me anytime and I will help you with that.
Kindest Regards
George W
Software Developer
www.zsystems.ca
|
|
|
|
|
IGeorgeI wrote: I was just wondering how some of you have solved this problem.
add a tiny amount to the result of the division, then truncate. aka. 'round up'
yes, it biases the results in one direction, but them's the breaks.
|
|
|
|
|
First of all I want to state that I have read the other posts and would have ignored that one about C#. This is not a compiler specific problem, it is a hardware problem and I do not know any solution. Although there is an excellent book called “Numerical Recipes in …” (very old now) that probably addresses these issues. If Microsoft has introduced a way to solve it, via software, they have not been vocal about it. The only thing I can think of is rounding up when you see all those ‘9’s’.
INTP
"Program testing can be used to show the presence of bugs, but never to show their absence."Edsger Dijkstra
|
|
|
|
|
When I try to set the tab stops in a CEdit control using the SetTabStops(int numberofstops, LPINT tabstops) method, they don't get set properly and they appear different on two different Win XP-Pro computers. I set them to 64, 64, 64, 32, 32, 32, 32 and on one computer get the first one at 64, and the rest at 32. The other gives me the first at 64 and the remaining ones packed together.
Any ideas on what I'm doing wrong?
|
|
|
|
|
Bill Brocklebank wrote: ...they appear different on two different Win XP-Pro computers.
Nothing wrong with that since DLUs are machine, or rather, current system font, dependent.
That aside, wouldn't you need to use 64, 128, 192, 224, 256, 288, and 320?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
DavidCrow wrote: That aside, wouldn't you need to use 64, 128, 192, 224, 256, 288, and 320?
Actually, according to the MFC documentation, each value represents an offset from the preceding position.
int tabs[3] = {8, 8, 8};
Results in tab positions of 8, 16, 24.
I am still thinking about the unexpected format displaying problem.
INTP
"Program testing can be used to show the presence of bugs, but never to show their absence."Edsger Dijkstra
|
|
|
|