|
For that kind of resolution you'll probably want to use a multimedia timer.
Timer events coming through windows messages are pretty innacurate and resolution is not so good
(as you've seen).
Check out timeGetDevCaps(), timeBeginPeriod(), timeSetEvent(), etc.
Mark
|
|
|
|
|
Hello
I am trying to use wide character constants in my program in a switch statement basically as follows:
TCHAR chChar = L'ä';
switch( chChar )
{
case L'ä': break;
case L'ö': break;
}
UNICODE and _UNICODE are both defined.
The compiler gives me warning C4066: "characters beyond first in wide-character constant ignored". This leads to error C2196: "case value '195' already used".
Is there any way around this?
Thanks.
|
|
|
|
|
If you cast L'ä' and L'ö' to short , what do you get? If the values are different, then use casting for the workaround. If not, it would seem that there's an issue with the compiler.
--
Presented in doublevision (where drunk)
|
|
|
|
|
I can't reproduce that (warning level 3).
Are you sure _UNICODE is defined before #include <tchar.h> ??
Mark
-- modified at 18:41 Tuesday 24th October, 2006
|
|
|
|
|
Don't use any characters outside of the ASCII range in your source code. Use the \x escape with the Unicode code points for the characters - L'\xe4' for ä, L'\xf6' for ö, and so on.
|
|
|
|
|
Well, in the software i'm developing, we need to display images on a folder. I'm using the FindFirstFile function and specifying a directory. This is working fine.
The problem arises when there's a filename that contains extended characters, such as "U+FB98: Arabic Letter Gueh Initial Form", which is this one: ﮘ. Now, the FindFirstFile function returns it, but the FindFileData.cFileName returns a filename with some question marks(I suppose these are wildcards) instead of the symbols.
This would not be a problem if the loading CBitmap would work... but it doesnt. I suppose it's in fact because of these symbols being replaced with question marks.
Is there any way around this? How can I effectively get the filename I need? Is this a problem with gdiplus CBitmap loading operation or with the filename being given with question marks?
Thanks in advance!
Andrés Cartín
|
|
|
|
|
Are you using the Unicode version of FindFirstFile..?
--
If not entertaining, write your congressman
|
|
|
|
|
Well, I tried to. I have to prefix this "\\?\" to the path right? In C the prefix would be written as "\\\\?\\". This produces the exact same results.
<br />
strPattern = "\\\\?\\" + m_folder;<br />
<br />
if (strPattern.Right(1) != TEXT("\\") )<br />
strPattern += "\\";<br />
strPattern += "*.*";<br />
hFind = ::FindFirstFile(strPattern, &FindFileData);
Any ideas?
|
|
|
|
|
skullfire wrote: Any ideas?
No, sorry.
--
Simulcast on Crazy People's Fillings
|
|
|
|
|
skullfire wrote: I have to prefix this "\\?\" to the path right?
No. You do not have to add the prefix. Just go to your project settings and change your project to using UNICODE.
And you have to change all string constants in your program to wide char strings, i.e., "*.*" should be replaced with L"*.*" , unless you are using the TEXT macro like:
skullfire wrote: if (strPattern.Right(1) != TEXT("\\") )
|
|
|
|
|
Currently I have a working example code (VC++ 8) for Win32 platform which uses WinPcap libraries. Does anybody know how to change the platform to Pocket PC 2003? Do I have to have WinPcap libraries for Pocket PC?
Yinyan Wang
|
|
|
|
|
Hi,
How do I send message to the parent window to move a cursor from one point to another
Any ideas please
Prithaa
|
|
|
|
|
Move the mouse cursor? SetCursorPos()
Move the "text cursor" (caret)? SetCaretPos()
Does the parent need to do this?
Mark
|
|
|
|
|
Hello,
Yes ,I need to send a message to the parent to move the keyboard cursor
Thanks
Prithaa
|
|
|
|
|
Hi
I am using _popen to execute an exe file and read back the result in to a text file and analyze it. but from the time that user clicks the button the console window appears on the screen and goes away when the process is finished. how can i hide the console window from the user and show something like work in progress instead.
is there a way to hide _popen ?
char Buffer[9];<br />
string commandline="address";<br />
<br />
FILE *fp;<br />
<br />
if ( (fp= _popen(commandline.c_str(),"r"))==NULL)<br />
exit(1);<br />
<br />
fgets( Buffer, 9, fp );
|
|
|
|
|
mitil20390482304 wrote: I am using _popen to execute an exe file...
To create a Windows application that redirects input and output, read the section "Creating a Child Process with Redirected Input and Output" in the Win32 SDK. See here and here.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
thanks man..i have already read those,,,and I have a really hard time undrestanding how i can use it in my case...can you help me some more...how can i run my _popen inside a process that has a hiden window?
|
|
|
|
|
|
Hi good people,
I was wondering if anyone could help me with a error i keep getting?
I have variable - int Size;
That i wish to parse to a function by reference that receives a int value.
However, i keep getting the following error message,
"cannot convert parameter System::Drawing::Size to &int"
If I parse it by value i get the same message just without the & "ampersand".
Please Help,
Thanx everyone
Phoenix
|
|
|
|
|
Phoenix101 wrote: That i wish to parse to a function by reference that receives a int value.
Pass-by-reference means to pass the variable's address (i.e., a pointer), like:
void foo(int *num)
{
}
...
int abc;
foo(&abc); Pass-by-value means to pass the variable itself, like:
void foo(int num)
{
}
...
int abc;
foo(abc); Lastly, if the function is expecting a reference, use:
void foo(int &num)
{
}
...
int abc;
foo(abc);
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Hey Good People,
I found the solution to the error...
It turns out that Size is a reserved word or something.
I changed it to size and it parsed without any errors.
Thanx everyone for your help;)
Phoenix
|
|
|
|
|
Phoenix101 wrote: cannot convert parameter System::Drawing::Size to &int"
That looks like C++/CLI to me.
|
|
|
|
|
I want to read a file containing unknown number of integers and store all the values to an array. I was using (in C) malloc/calloc for first allocation and and realloc subsequent allocation of memory to the array. In the process I could keep the values assigned intact while expanding the size of the array. Now I have started using C++ where I use the operator 'new' for allocation of memory. Is there any function equivalent to 'realloc' so that I can do the above thing?
|
|
|
|
|
pani68 wrote: Is there any function equivalent to 'realloc' so that I can do the above thing?
No, and thank goodness. See here for my comment. If you are now using C++, use a vector to hold the numbers.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
#include <vector>
vector <int> intvector;
...for each int read from file...
intvector.push_back( intfromfile );
Edited for anglebrackets LOL
|
|
|
|