|
Ok, I misread your initial post. Please disregard my previous question.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Zapacila wrote: char * buff=new char[sizeof(Bitmap)+sizeof(bfh)]; create a buffer
This will allocate 18 bytes instead of 58.
Zapacila wrote: i want to but the bits of those structures into a buffer : thats what he does here:
File.Write(&bfh,sizeof(bfh));
File.Write(Bitmap,Length);
Wrong. The two calls to Write() are not putting anything into a buffer. They are writing to a file.
So what exactly are you needing to do with buff ?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Hello Comunity,
i make a litle dialog using Create(); , how to set the window style to be always on top,
when the user click somewhere out of this dialog, that they stay on top!?
Like DoModal();?
Some code:
CWaitDlg cWaitDlg;
cWaitDlg.Ceate(CWaitDlg::IDD, GetDesktopWindow());
cWaitDlg.Show(SW_SHOW);
thanks
break;
|
|
|
|
|
Try this call:
cWaitDlg.SetWindowPos(&wndTopMost, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
Best,
Jun
|
|
|
|
|
Hello,
thanks for answer, how to keep focus on cWaitDlg, so that i cant click on hims parent!?
regards
break;
|
|
|
|
|
Keep focus on cWaitDlg and click on its parent window? Not quite sure about what you are asking.
Best,
Jun
|
|
|
|
|
Here is a generalized code:
CRect rect;
// 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 );
I hope this helps...
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
_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.
|
|
|
|
|