|
_AnShUmAn_ wrote: // get the current window size and position
this->GetWindowRect( rect );
::SetWindowPos(m_hWnd ,HWND_TOPMOST,rect.left,rect.top,rect.Width(),rect.Height,SWP_SHOWWINDOW );
Size and position are not necessary.
SetWindowPos(m_hWnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE|SWP_SHOWWINDOW);
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Hi,
yes i try without size and position, works, how to keep focus on that pWaitDlg, so that the user cant
click nothing on the parent window?
regards
break;
|
|
|
|
|
break; wrote: how to keep focus on that pWaitDlg, so that the user cant
click nothing on the parent window?
Make it modal, like:
CWaitDlg cWaitDlg;
cWaitDlg.DoModal();
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Hello,
thanks for answer, this is that what i mean, but i need to
avoid to loose the focus, e.g. pWaitDlg stay on top always, but i can set the focus to hims
parent and close him, or do something else on parent!!
pWaitDlg should be on top always(like in your sample) and have focus so long as is shown!
Like MessageBox, is allways on top, and have focus until someone clik ok, or other button!
regards
break;
|
|
|
|
|
|
I'd like to output some text from a csv file and faced a nice problem. Or maybe there isn't a problem, I'm just too anti-pro.
These files have normal english text and some japanese. Normal text is 1-byte and japanese 2-byte. I think this fits in the BMP so the UTF-16 characters are UCS-2.
Microsoft Wordpad displays these files correctly when BOM is UTF-16 Little-Endian, but e.g. Notepad++ does not handle these files correctly even when setting character encoding manually to UTF-16 LE, text is full of empty boxes instead of japanese.
What magic does Wordpad use to distinguish ASCII and UCS-2? No surrogate pairs are needed I think, and was unable to find them with binary-mode look at the characters.
Here is an example of the file's contents as shown with Hexedit:
65 72 2e 73 70 68 0d 0a 22 e7 95 aa e5 8f b7 e3 81 af
Thanks.
|
|
|
|
|
Are you sure it is a "mix of ASCII and UCS-2"? That would be very strange. It may be a multibyte encoding, like SHIFT_JIS.
|
|
|
|
|
No, I'm not really sure about anything.
It just seems like that for me. That hex code I pasted is something like ".sph *some japanese*" as clear text.
|
|
|
|
|
To find out if the Japanese characters are really encoded as UCS-2, check that the first two Japanese bytes form a symbol that you actually see on the screen. In your case it would be U+95e7, and this is the correspondingUnicode character[^]. Is that what you see?
On the other hand, if it is Shift_JIS, 0x95e7 would correspond[^] to Unicode 0x6155[^] - is that what you see on the screen? If it turns out to be SHIFT_JIS, just use MultiByteToWideChar to convert it to UTF-16.
|
|
|
|
|
I want to check whether LVS_EX_CHECKBOXES is set as the extended style of a list view. How to check that?
|
|
|
|
|
Let the m_list be the object of the list control.
You get the Extended style of the list control and check it as in the If statement....
m_list.SetExtendedStyle(m_list.GetExtendedStyle() | LVS_EX_CHECKBOXES );
if(m_list.GetExtendedStyle() & LVS_EX_CHECKBOXES)
{
AfxMessageBox("LVS_EX_CHECKBOXES Set");
}
else
{
AfxMessageBox("LVS_EX_CHECKBOXES Not Set");
}
VIBIN
"Fool's run away,where angle's fear to tread"
|
|
|
|
|
Hello All,
I have an MFC application. In my application I create an instance of IE, and browse to some link, say "www.Adserver.com".
After hitting to this link, I always receive an image from the "www.Adserver.com", I will get different image everytime I hit this URL.
I need to display this image on one of my dialog in my application, hence I need the handle to URLCacheEntry maintained by window for IE.
To get this handle I can use the function GetUrlCacheEntryInfo( IN LPCSTR lpszUrlName,...); however the input parameter to this function "IN LPCSTR lpszUrlName" is something I need to extract from the running instance of IE, which is displaying this image.
We can assume that always there will be a single image displayed in IE.
Thanks in advance for your replies.
Suyash
|
|
|
|
|
when source pass with null value the len will be 0.
but due to effect of that tempOutFile create the garbage value I need to clear it with null value.
<code>
string Utility::ConvertWCHARToString(LPCWSTR source)
{
try
{
size_t len = wcslen(source) * sizeof(LPCWSTR);
char* tempOutFile= new char[len];
WideCharToMultiByte(CP_ACP,0,source,-1,tempOutFile,(int)len,NULL,NULL);
string s = tempOutFile;
if(tempOutFile)
{
delete[] tempOutFile;
}
return s;
}
catch(exception ex)
{
throw ex;
}
}
I have try to intialize the value explicitly but it didn't work(crash application).
like
if(len==0)
tempOutFile=NULL;
|
|
|
|
|
amitmistry_petlad wrote: char* tempOutFile= new char[len];//tempOutFile=Garbage valve need tempOutFile =""
Modify this to,
char* tempOutFile = NULL;
if (len)
{
tempOutFile = new char[len];
}
|
|
|
|
|
This is for my master
I did it but it gives bad pointer and application crashed!!!
|
|
|
|
|
You are not supposed to use code following , if len in question is 0 .
|
|
|
|
|
yes ,i have do it. I had compare when got NULL then return s="".
|
|
|
|
|
Then, its definitely due to code, you have not shown here. Can you explain, how you are using this function, and where you are facing problem.
|
|
|
|
|
I think you also have a problem here:
size_t len = wcslen(source) * sizeof(LPCWSTR);
wcslen(source) should give you the length you need - but then you are multiplying it by sizeof(LPCWSTR) which is 4 bytes since it's a pointer. That really isn't necessary.
You should then be able to wrap the rest in an if:
if (len > 0)
{
char* tempOutFile= new char[len];
WideCharToMultiByte(CP_ACP,0,source,-1,tempOutFile,(int)len,NULL,NULL);
string s = tempOutFile;
if(tempOutFile)
{
delete[] tempOutFile;
}
return s;
}
Hope that helps.
Karl - WK5M
PP-ASEL-IA (N43CS)
PGP Key: 0xDB02E193
PGP Key Fingerprint: 8F06 5A2E 2735 892B 821C 871A 0411 94EA DB02 E193
|
|
|
|
|
Hi friends,
What is the Max limit of the number of bytes copied from Source to Destination in mempcy ??
Thanks in advance.
Appu..
"My blood group is not B+.But I have it my blood"
|
|
|
|
|
Hi,
The maximum limit is mostly compiler dependent.
It will be the maimum size of "size_t" .
i.e : "size_t" is an alias of "unsigned long" , so the maximum size of "unsigned long" is ULONG_MAX
Note : ULONG_MAX is 4294967295
Regards,
vinsankar
|
|
|
|
|
Vinod A Sankaranarayanan wrote: It will be the maimum size of "size_t" .
that's right
Vinod A Sankaranarayanan wrote: i.e : "size_t" is an alias of "unsigned long"
wrong here. unsigned long is always 4 bytes, even on 64 bits systems; size_t is 8 bytes on 64 bits systems
|
|
|
|
|
toxcct wrote: unsigned long is always 4 bytes, even on 64 bits systems;
Actually, unsigned long is 8 bytes on most 64-bit Unix systems; the Standard does not specify the size of unsigned long
|
|
|
|
|
Nemanja Trifunovic wrote: the Standard does not specify the size of unsigned long
doesn't it ?
AFAIK, only [signed | unsigned] int s weren't specified...
short and long still length to 2 and 4 bytes respectively
|
|
|
|
|
toxcct wrote: doesn't it ?
Nope[^], it pretty much guarantees only minimal sizes for integer types. As I said, on most 64-bit Unix systems, long is 64 bits.
|
|
|
|