|
I have tried using *pszData. But when I use that, it gives me numbers, a being 97, b 98, c 99, and so on...
pszData is Unicode, I believe. I don't realy understand the string converstions.
|
|
|
|
|
Looks like you have a Unicode string coming in which is trying to be treated as an Ansi string. Do you have UNICODE defined?
|
|
|
|
|
The Value that it saves from *pszData is the Decimal value of the character that is passed on! According to the ASCII table.
Why does it do that? and how can I make it save the character value?
Thanks...
|
|
|
|
|
I have:
#ifdef _UNICODE
That should be enough? or should I add more to it?
I don't understand this string converstion business too much, even so I have read lot's of articles on it...
|
|
|
|
|
A project under Visual C++ can be under many configurations. You have console or win32 application, MFC or ATL or both, etc. You control these configurations by defining values. A unicode project is controlled by the macros _UNICODE and UNICODE. The #ifdef _UNICODE is a preprocessor directive. Like an if, but at a preprocessor level which means if it's not true (evaluated at compile time) the code won't be included in the executable.
Try adding
#define _UNICODE
#define UNICODE
to the top of your stdafx.h before you include all the headers, or set them in the project settings under preprocessor definitions. Now your project will be unicode aware. For instance a possible problem in your case is passing an argument as a LPCTSTR, which under an ansi project (_UNICODE & UNICODE not defined) is a pointer to an ansi string. In a unicode project it's a unicode string.
|
|
|
|
|
I have added the following lines
Mark Petrik Sosa wrote:
#define _UNICODE
#define UNICODE
to the main.cpp file, don't work. and to stdafx.h file and don't work.
The result is still the same.
What do you think about converting the pszData into another variable such as buffer that is a wide string for example?
I have tried it, but I can't get it to work.
|
|
|
|
|
Try changing ofstream to wofstream.
void CChildView::SortData(LPCTSTR pszData)<br />
<br />
wofstream testFile ("test.txt", ios::app);<br />
testFile << pszData;
|
|
|
|
|
testFile << std::string (pszData);
This will work, but I doubt it is the best way of doing it. I'm not a fan of iostreams (slow and bloated), so I don't have the depth of knowledge that others will have.
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
I have tried
Tim Smith wrote:
File << std::string (pszData);
but it comes up with 2 errors:
std - is not a class or namespace name
string - undeclared identifier
|
|
|
|
|
You need to include <string> to use the string class.
|
|
|
|
|
Hello,
suppose i get an argument which gives me a string where the element is stored eg (root) (child)(grandchild)then how do i parse the xml file to travel to that particular node and then add the value of the attributes of grandchild to an array and return it
thanks
|
|
|
|
|
72arpita wrote:
how do i parse the xml file...
Use the IXMLDocument interface.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
Hi,
I want to draw a rectangle in a Rich Edit Text control (CRichEditCtrl) which is embedded on a Tab Control.
I am using CFormView (form as my container to place all my controls TabCtrl, RichEditCtrl, etc.) I need to get the correct Device Context to do the drawing in my CFormView::OnDraw(CDC* pDC) method.
Can someone help me out?
Thanks in advance,
Ahmed Kabir
|
|
|
|
|
Perhaps you want to subclass your CRichEditCtrl and override OnPaint()
|
|
|
|
|
Hi !
My C++ app needs to read an external text file and display it on screen. But, this text file can contain specific commands to change what has to be displayed by my app.
For instance, the text file could be :
Hello
[if foo]
Foo
[else]
Bar
[endif]
and my app should display (depending of foo) : Hello Foo.
The problem is that I don't know where to start. Should I just parse the text file and just check each [] ? Should I write a real interpreter (I have no idea how to do this). Can I reuse something existing ?
Any help, suggestions or idea are welcome !
THanks !
Jerome
|
|
|
|
|
|
Hi,
I'm working on an SDI application using MFC.
I'd like to change the background of titlebar and toolbar by adding a small bitmap image which looks like a short vertical line.
I found some source codes to change background color of titlebar.
But I don't know how to change the background of titlebar by a bitmap image.
Please let me know how to add the bitmap image as a background.
|
|
|
|
|
Look into WM_NCPAINT, LoadImage and BitBlt.
|
|
|
|
|
Hi
I am doing a project on image processing with VC++. When I try to display the bitmap(8 bit) on the screen using SetDIBitsToDevice() the actual color is not mapped correctly. The same code works fine with 24 bits bitmap.
Pls help
Thanks in advance
|
|
|
|
|
Hi guys,
I am writing a simple Windows Spy untility (like in VStudio tools),
I am having problems when dragging the cursor over different windows.I manage to draw a rectangle over them but when i move mouse to another window the retangle still stays on the previous window. I tried to store the previous windows handle and when mouse was over another window i simply called the Invalidate() function to the previous window.
For some strange reasons this worked only for 90% of the windows , but in some cases the retangle still remained over some windows.
Can anyone suggest any other way of achieving this??
Regards
"Success is the ability of going from one failure to another with no loss of enthusiasm" - W.Churchill
|
|
|
|
|
Try calling UpdateWindow() after Invalidate(). If this doesn't work you can try hiding and then showing the window.
|
|
|
|
|
My program has to get the message from Windows, if the every user wants to save his information on hard disk, or if the every user wants to connect to my computer by local net. How I can make this function?
qqq
|
|
|
|
|
I would have a look / search for FindFirstChangeNotification . This lets you monitor any
changes to files in a directory. If that is not enough, look at FileMon on www.systinternals.com[^] and
be impressed at the amount of work that took... As I understand it, they had to write a filesystem
driver to sit below the user processes. Gnarly.
Iain.
|
|
|
|
|
i would like to compare date like
DDMMYY > DDMMYY
pls giv me some codes that can somehow do this thx
|
|
|
|
|
Construct 2 CTime objects (cTime1, cTime2):
CTime::CTime( int nYear, int nMonth, int nDay, int nHour, int nMin, int nSec, int nDST = -1 );
then you'd compare them (cTime1 > cTime2).
Marc Soleda.
... she said you are the perfect stranger she said baby let's keep it like this... Tunnel of Love, Dire Straits.
|
|
|
|