|
When I read files with signs å, ä, ö I got strange characters like “ã-“ and so on. Do I use the wrong enconding type and how do I change that?
_____________________________
...and justice for all
APe
|
|
|
|
|
It seems that the textfile you're reading is UNICODE/UTF-8. You will have to take that into account, or reencode the file into some codepage. Windows 1250-something has å, ä, ö. I think. ISO-8859-1 (and -15) has them too.
--
|
|
|
|
|
Hello (Hej.)
My guess is that you read a text file, written in another charset than ANSI, probably a PC-8 (DOS) charset, CP 437 or 850.
Use the Windows func OemToAnsi to convert the text lines from the file to ANSI. And from there, do another conversion to Unicode if you whish.
You might also to considder the opposite character conversion func, AnsiToOem.
Use them as they are, or use them as member functions in a CString.
|
|
|
|
|
Hi,
I am developing hook application, which will create a file whenever the user do any SAVE_AS operations on any IDE (notepad, visualstudio...).
I can be able to get the save_as name (new name) for all applications EXCEPT Microsoft office packages(microsoft word, excel, frontpage...).
How could we get the save_as name when user do any save_as on this (microsoft word, excel...).
Please any help.
Be simple and Be sample.
|
|
|
|
|
You'll need to get real low-level for this. See here for an explanation of how others have monitored file activity.
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
Hi
I have the following code to change the balloon tooltip text.
SetToolTipText("zzzzzzzz");
Sleep(5000);
SetToolTipText("xxxxxx");
Sleep(10000);
SetToolTipText("yyyyyyy");
If there already balloon tooltip displayed(from other application) before I launch my application, Tooltip sequence will be
zzzzzzz
yyyyyyy
xxxxxxx
otherwise it will be
zzzzzz
xxxxxx
yyyyyy
Can anyone aware of any solution for this?
|
|
|
|
|
Hi,
I'm dealing with some automation for my code, and there is some syntax that is there that confuses me
I have code like this:
BEGIN_DISPATCH_MAP(MyDocument, CCmdTarget)
//{{AFX_DISPATCH_MAP(MyDocument)
DISP_FUNCTION(MyDocument, "SetVisible", SetVisible, VT_EMPTY, VTS_BOOL)
//}}AFX_DISPATCH_MAP
DISP_FUNCTION(MyDocument, "SetInvisible", SetInvisible, VT_EMPTY, VTS_BOOL)
END_DISPATCH_MAP()
The part i dont understand is why the AFX_DISPATH_MAP line is commented out? And why all code between the AFX_DISPATH_MAP lines is a different colour (grayed out in VS2003). This functions must still work as they do in fact work, but what would the differrence be between the SetVisible and SetInvisible method calls. This style of commenting out the AFX_DISPATH_MAP lines is present in sample code at MSDN, but i cannot find an explanation for it? In the example above, what in fact is the difference between the two differing lines referring to dispatch functions? How do they behave differently, if at all, etc
Many thanks
Will
|
|
|
|
|
(I am working with VS 6.0)
commented code //{{AFX_DISPATCH... is only mark for class wizard and if You delete this lines You will be in troubles with this wizard and its automation tab Real dispatch macros are BEGIN_DISPATCH_MAP, END_DISPATCH_MAP and some other (look into MSDN, there are lot of articles about this topic)
Next, every properties and methods added by wizard are placed between these commented lines
//{{AFX_DISPATCH_MAP(MyDocument)
DISP_FUNCTION(MyDocument, "SetVisible", SetVisible, VT_EMPTY, VTS_BOOL)
//}}AFX_DISPATCH_MAP
ANd because this, I think, that method DISP_FUNCTION(MyDocument, "SetInvisible", SetInvisible, VT_EMPTY, VTS_BOOL) was added later by hand (You can do like that with your other methods and properties, but then you can not manipulate those members by class wizard)
br
Jozef
|
|
|
|
|
Is there a limit to the number of timers that i can have in an application? If yes how many? Is it limited by the duration of each timer or is it just a max number?
|
|
|
|
|
I think that the only limit is the cpu performance. I mean, as much timers you add, the performance of the cpu will decrease.
Marc Soleda
... she said you are the perfect stranger she said baby let's keep it like this... Tunnel of Love, Dire Straits.
|
|
|
|
|
It is worth seeing if you can use one timer to handle several functions, e.g a 0.5sec function could processed on every tenth call to a 0.05sec timer.
Elaine
The tigress is here
-- modified at 7:28 Wednesday 5th October, 2005
|
|
|
|
|
As far as i know the only limit is
the CPU performance , as everythimer
thread in an O.S will use some resources
at some excess limit the resources are bound
to be extinct
Vikas Amin
Embin Technology
Bombay
vikas.amin@embin.com
|
|
|
|
|
nripun wrote:
Is there a limit to the number of timers that i can have in an application?
Yes, timers are a limited global resource.
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
No global resource is unlimited. To see how much you can create, you should write a program that just creates timers and reports the number of timers created when an error occurs...
Behind every great black man...
... is the police. - Conspiracy brother
Blog[^]
|
|
|
|
|
In the
CWnd class there is a function as "CWnd::CreateEx"
i would like to konw exactly what is the difference
beteween CWnd::Create.
thank u
Vikas Amin
Embin Technology
Bombay
vikas.amin@embin.com
|
|
|
|
|
The only difference in the arguments.otherwise both of them create a Window
|
|
|
|
|
vikas amin wrote:
i would like to konw exactly what is the difference
beteween CWnd::Create.
CreateEx Creates a Pop-up Window unlike Create
|
|
|
|
|
yes WinCreateEx::Create creates not only create child window(what CWnd::Create does)but also pop-up and overlapped window
attach it to CWnd object:->
-- modified at 8:12 Wednesday 5th October, 2005
|
|
|
|
|
Thank you
Vikas Amin
Embin Technology
Bombay
vikas.amin@embin.com
|
|
|
|
|
Hi
I have a dialog based MFC application in which I want to hide mouse globally.
I mean to say when I hide mouse it gets hidden but when i move my mouse over some other application or some other window, it gets displayed.
What I want to do is, once I hide my mouse, no matter where I move it, it should not be shown.....
Or is there any function through which I can disable my mouse ?
Regards
Amarelia Maehsh
Gujarat
India
|
|
|
|
|
i don't know of a funtion doing this but have you tried
using a global mousehook? are you familiar with window hooks?
i copuld imagine catching WM_SETCURSOR will do this but i'm not sure.
some links:
WM_SETCURSOR
SetWindowsHookEx()
MouseProc()
good luck!
___________________________________________
http://www.hartwork.org
|
|
|
|
|
Hi,
I haven't been using stream i/o very often, thought it was simple.
Wanted to read in an xml-file with 0x0A line delimiters.
used a for loop
(vc++ 6.0 on xp pro)
ifstream ifsIn("x1.xml");
string strData
for (string s; ifsIn>>s; strData+=s+'\n') {}
.
Was surprised to see, that operator>> uses blanks as input delimiters.
->Normal or bug?
Hence used
for (string s; ifsIn>>s; strData+=s+ifsIn.peek()) {}
i.e. blanks and newlines reside in stream and can be appended to be preserved in result.
Tried for fun to get '\r' + '\n' from ifsIn instead of just '\n' into my strData, because it's a windows format text file. Used ifstream ifsIn("x1.xml", ios::binary), but no success: Stream was empty then.
->Normal or bug?
I didn't find any way to set a property of the stream like "Use no delimiter, slurp in whole file".
->Is there?
Thanks for your assistance
And best regards
Werner
|
|
|
|
|
Sorry, 2nd for-loop is buggy of course, actually it is,
string strData;<br />
ifstream ifsData("x1.xml");<br />
char cPeek[2];<br />
memset(cPeek, 0, sizeof(cPeek));<br />
for (string strTmp; ifsData>>strTmp; ) {<br />
cPeek[0] = ifsData.peek();<br />
strData+=strTmp+cPeek;<br />
}<br />
Regards
Werner
|
|
|
|
|
Does the RECYCLER folder always exist as C:\RECYCLER or there is a CSIDL for it that I use to query the recycle bin folder using SHGetFolderPath?
Thanks!
/f
|
|
|
|
|