|
led mike wrote: That question confuses me.
Mine or the OP's?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
|
So I can use existing code in an application that I developed using Win32 APIs. i.e.SendMessage(HWND, ID, wparam, lparam)
MFC "Hides" this from me.
However, if I am taking off in wrong direction I would appreciate some guidance here.
Thanks
|
|
|
|
|
If you wanted to send a message to some edit control, you could use:
m_edit.SendMessage(WM_GETTEXTLENGTH, 0, 0); or
::SendMessage(m_edit.GetSafeHwnd(), WM_GETTEXTLENGTH, 0, 0); or
m_edit.GetWindowTextLength();
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
You have struck upon one of the problems I have using MFC.
What does m_edit mean and where can I find a list of all the m_whatever?
Thanks
|
|
|
|
|
jonsey29847 wrote: What does m_edit mean and where can I find a list of all the m_whatever?
It's just an arbitrary name I chose for that code snippet. You may call it whatever you wish.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Is it the name I assign using the class wizard?
|
|
|
|
|
Yes.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Wow!
I can't wait to try it.
I just love this website!
Thanks.
|
|
|
|
|
If it's your dialog, you probably have a variable assigned to it.
YourDialog dlg;
or
YourDialog* pDlg;
pDlg = new YourDialog;
after you create the dialog (Create ), you could do something like
HWND CWnd::GetSafeHwnd( ) const;
to get the handle to the dialog.
This signature was proudly tested on animals.
|
|
|
|
|
MFC does not expose the handle to me, or does it?
Thanks for fast replies!
|
|
|
|
|
Well, GetSafeHwnd() returns a safe handle to the dialog window.
do you need something more ?
This signature was proudly tested on animals.
|
|
|
|
|
HWND hwndDlg = GetSafeHwnd();
Is it really that simple?
How does GetSafeHwnd() know which window you wish the handle of?
Thanks
|
|
|
|
|
jonsey29847 wrote: How does GetSafeHwnd() know which window you wish the handle of?
It's called in the context of a CWnd object.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
associate a class with dialog and use object of that class to access dialog.
|
|
|
|
|
In your dialog class m_hWnd varialbe will give you the handle of your dialog.
You can store it as,
HWND DialogHandle = m_hWnd ;
Regards,
Sujeet
|
|
|
|
|
hi all,
i am creating an application in which i need to read the data at a particular sector for that i am using following code
Handle hCD = CreateFile (phydisk, //physical disk
GENERIC_READ ,
FILE_SHARE_READ|FILE_SHARE_WRITE,
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL,
NULL);
if (hCD != INVALID_HANDLE_VALUE)
{
DWORD dwSize = total_sector * 512;
__int64 y=512*start_sector;
__int64 ss=myFileSeek(hCD,y,FILE_BEGIN);
int aa;
aa = ReadFile (hCD, buffer, dwSize, &dwNotUsed, NULL);
}
now i am able to see data in buffer untill the 0x00 comes in data
for example :- there is given a sector below
Offset 0 1 2 3 4 5 6 7 8 9 A B C D E F
00094B000 FF D8 FF E1 11 B4 45 78 69 66 00 00 49 49 2A 00 ÿØÿá.´Exif..II*.
00094B010 08 00 00 00 0F 00 0F 01 02 00 0E 00 00 00 C2 00 ..............Â.
00094B020 00 00 10 01 02 00 06 00 00 00 D0 00 00 00 1A 01 ..........Ð.....
00094B030 05 00 01 00 00 00 D6 00 00 00 1B 01 05 00 01 00 ......Ö.........
00094B040 00 00 DE 00 00 00 28 01 03 00 01 00 00 00 02 00 ..Þ...(.........
00094B050 1B 9B 31 01 02 00 25 00 00 00 E6 00 00 00 32 01 .›1...%...æ...2.
00094B060 02 00 14 00 00 00 0C 01 00 00 13 02 03 00 01 00 ................
00094B070 00 00 02 00 2A 4F 69 87 04 00 01 00 00 00 28 01 ....*Oi‡......(.
00094B080 00 00 01 A4 03 00 01 00 00 00 00 00 AA 82 02 A4 ...¤........ª‚.¤
00094B090 03 00 01 00 00 00 00 00 75 3B 03 A4 03 00 01 00 ........u;.¤....
00094B0A0 00 00 01 00 5F 45 04 A4 05 00 01 00 00 00 20 01 ...._E.¤...... .
00094B0B0 00 00 06 A4 03 00 01 00 00 00 03 00 9E 8B 0C A4 ...¤........ž‹.¤
00094B0C0 03 00 01 00 00 00 03 00 68 D7 22 02 00 00 53 6F ........h×"...So
00094B0D0 6E 79 20 45 72 69 63 73 73 6F 6E 00 4B 37 35 30 ny Ericsson.K750
00094B0E0 69 00 48 00 00 00 01 00 00 00 48 00 00 00 01 00 i.H.......H.....
00094B0F0 00 00 52 31 44 42 30 30 31 20 20 20 20 20 70 72 ..R1DB001 pr
00094B100 67 43 58 43 31 32 35 39 35 32 5F 45 55 5F 31 5F gCXC125952_EU_1_
00094B110 43 4C 20 35 2E 33 00 82 32 30 30 38 3A 30 32 3A CL 5.3.‚2008:02:
00094B120 32 33 20 30 37 3A 35 34 3A 34 38 00 64 00 00 00 23 07:54:48.d...
00094B130 64 00 00 00 0F 00 9A 82 05 00 01 00 00 00 E2 01 d.....š‚......â.
00094B140 00 00 9D 82 05 00 01 00 00 00 EA 01 00 00 27 88 ..‚......ê...'ˆ
00094B150 03 00 01 00 00 00 64 00 3F FB 00 90 07 00 04 00 ......d.?û.....
00094B160 00 00 30 32 32 30 03 90 02 00 14 00 00 00 F2 01 ..0220.......ò.
00094B170 00 00 04 90 02 00 14 00 00 00 06 02 00 00 01 91 ..............‘
00094B180 07 00 04 00 00 00 01 02 03 00 04 92 0A 00 01 00 ...........’....
00094B190 00 00 1A 02 00 00 07 92 03 00 01 00 00 00 02 00 .......’........
00094B1A0 79 6A 08 92 03 00 01 00 00 00 02 00 CA FF 09 92 yj.’........Êÿ.’
00094B1B0 03 00 01 00 00 00 00 00 49 6D 00 A0 07 00 04 00 ........Im. ....
00094B1C0 00 00 30 31 30 30 01 A0 03 00 01 00 00 00 01 00 ..0100. ........
00094B1D0 88 B4 02 A0 04 00 01 00 00 00 C8 04 00 00 03 A0 ˆ´. ......È....
00094B1E0 04 00 01 00 00 00 60 06 00 00 00 00 00 00 01 00 ......`.........
00094B1F0 00 00 28 00 00 00 1C 00 00 00 0A 00 00 00 32 30 ..(...........20
but i am able to read data in buffer only
Offset 0 1 2 3 4 5 6 7 8 9 A B C D E F
00094B000 FF D8 FF E1 11 B4 45 78 69 66
but when i write data using foolowing code it write full data
value = WriteFile(
hFile, // handle to file
buffer, // data buffer
20*512, // number of bytes to write
nbytes, // number of bytes written
NULL // overlapped buffer
);
where is i am doing mistake and how to do it
plese help me
|
|
|
|
|
Shiv Murti Pal wrote: now i am able to see data in buffer untill the 0x00 comes in data
How are you verifying this?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Put the address of buffer in a memory window while debugging.
Debug -> Windows -> Memory -> Memory 1.
Check whether you are able to see all the data now.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
Its official, I need to get away from the computer! I recognize this sequence of bytes:
FF D8 FF E1 11 B4 45 78 69 66 00 00 49 49 2A 00
Thats a JPEG header! The FF D8 FF E1 gave it away.
But unfortunately I don't understand what you are trying to do. What do you mean footer?
If you are trying to find the end of the JPEG file I think that you can just read until you find the EOI (End of Image) marker which are the bytes FFD9 but make sure that you reach each marker defined in the specification sequentially firsthand.
JPEG Header Information[^]
I think you need to ask a better question... Maybe I just gave you an answer that your not looking for.
Best Wishes,
-David Delaune
|
|
|
|
|
how to find end of jpeg file, and how to read until i find the End of Image marker that is FF D9.
plese tell me
|
|
|
|
|
Hello,
I would like to ask, how can I implement the CRichEditView with CRichEditDoc in my SDI application with multiple views. All the view are connected to the document class. Adding CRichEditView is not a problem, but I am not able to create CRichEditDoc a connect it to the view. I thought I can create a CRichEditDoc class member in my document, and when creating the view change the CCreateContext document pointer to that class member. The problem is, that CRichEditDoc is a abstract class, so I don't know hhow to make it work.
Thank you for your advise, Tomas
|
|
|
|
|
I display 5 CWebBrowser2 on one dialog.
They are all shown only if I didn't Navigate() pages to them.
but when I set links to them, only first one is visible and web page is displayed properly, last 4 are invisible.
I try to use ShowWindow() to show last 4, but exceptions are thrown.
why?
|
|
|
|
|
Debugging may be the key to your problem. Try it out!
You need to google first, if you have "It's urgent please" mentioned in your question.
_AnShUmAn_
|
|
|
|
|
right, problem is ShowWindow(SW_HIDE), CWebBrowser2 may not be allowed to hide? and CWebBrowser2::SetVisible() is not working.
|
|
|
|