|
who is kyle ? and whose pussy r u talking about...is that your mom ?
You are a dirty guy, in all my post i have written nicely and you have some problem with yourself...Go and see a doctor m8.
|
|
|
|
|
Software_Specialist,
I think that you need another hobby. Code Project is now place for 11 year old boys, who cant get a girl to keep them busy ... or better yet bro, get a job, or try to stay in school.
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
|
|
|
|
|
Software_Specialist wrote: who is kyle ?
a troll like you
Software_Specialist wrote: and whose pussy r u talking about
not whose, but who ?
Software_Specialist wrote: in all my post i have written nicely
we have different meaning of nicely. abusing the forums, just because you're hidden behind your nickname don't allow your to talk as you do.
Software_Specialist wrote: Go and see a doctor m8
man, i've been registering codeproject for more than 3 years now, i became CP MVP, so i think i know far better than you the rules to follow on this site.
either comply, or get out of here. if you don't want to grow up, nobody want you here.
|
|
|
|
|
Hi everybody,
i use a Frame within a View, which is created via this->CreateView(CreateContext*)
if i open a CDialog in modal-state, i have an error if this dialog closes:
CWnd* CWnd::GetTopLevelParent() const
{
if (GetSafeHwnd() == NULL) // no Window attached
return NULL;
ASSERT_VALID(this); <<< Asserts here because ASSERT(::IsWindow(m_hWnd)); fails
In other Views it works fine in other not
Does anyone has an idea?
Big thanks
-- modified at 10:26 Wednesday 28th February, 2007
// in case of modeless dialogs, last chance route through main
// window's accelerator table
if (pMainWnd != NULL)
{
CWnd* pWnd = CWnd::FromHandle(pMsg->hwnd);
if (pWnd->GetTopLevelParent() != pMainWnd)
return pMainWnd->PreTranslateMessage(pMsg);
}
the message is a 100h ( WM_KEYDOWN ) which should be redirected
-- modified at 10:49 Wednesday 28th February, 2007
With a ShowWindow(SW_SHOW) i don't have this kind of error
|
|
|
|
|
Do you assign a parent to your dialog box? If so, are you sure the parent is created when you call CDialog::DoModal()?
There are two things that one must get used to or one will find life unendurable: the damages of time and injustices of men
Fold with us! ¤ flickr
|
|
|
|
|
Thanks for your reply.
Yes, i open the CDialog like this :
FPopUpListe Liste(this,"GetCustomers",&tbEntry,kunde);
Liste.DoModal();
the view is already created and the user decides when the FPopUpListe opens ( by pressing F2 on the tbEntry-Textbox )
In non-modal state, it works fine
|
|
|
|
|
So you are sure that the window corresponding to 'this' has a valid HWND before opening the dialog box... that's really weird, even if it reminds me something, something foggy but something.
I see you override CDialog's default constructor. Could you please show this ovveride?
|
|
|
|
|
Yes, the HWND is correct (i see a pointer).
It must be correct, because the user uses already this view and
opens the dialog if he wishes
FPopUpListe::FPopUpListe(CWnd* pParent_t,CString Funktion_t,CWnd *Komp_t,void *Value_t)
: CDialog(FPopUpListe::IDD, pParent_t)
{
Funktion = Funktion_t;
Parent = pParent_t;
Komp = Komp_t;
Value= Value_t;
Liste = NULL;
}
I send pParent_t to the Dialog Constructor.
Parent is a class-variable which i use to get/see faster the Parent of the control
|
|
|
|
|
baerten wrote: Yes, the HWND is correct (i see a pointer).
The view object may be instantiated but the corresponding window may not be created. To ensure the window is created, you could use something like
<br />
ASSERT((pView != NULL) && (pView->GetSafeHwnd() != NULL);<br />
baerten wrote: Parent is a class-variable which i use to get/see faster the Parent of the control
Why don't you use CWnd::GetParent() when you need it?
I'm searching for ideas, I'll come back as soon as I get one.
There are two things that one must get used to or one will find life unendurable: the damages of time and injustices of men
Fold with us! ¤ flickr
|
|
|
|
|
ASSERT((pView != NULL) && (pView->GetSafeHwnd() != NULL); --> ok, no Assertion
Big thanks ! Thats very nice
Merci, très gentil de vous.
|
|
|
|
|
I use VS2005 since few days....
I need to modify the status of a menu item (enabled/not enabled)
when the user opens the menu. In VS6 I used OnUpdate method for
any menu item. That method was called before showing the menu item
so I was able to modify its status.
Now in VS2005 the OnUpdate method is called when I click on the
menu item and not when I open it.
What is changed ? can someone help me ?
thank a lot !
|
|
|
|
|
ilgale wrote: In VS6 I used OnUpdate method for
any menu item.
Is there any reason, for not using ON_UPDATE_COMMAND_UI ?
|
|
|
|
|
This[^] is the preferred way to set the status of a menu item.
/ravi
|
|
|
|
|
how can i display the bitmap on ListView using CreateBitmap function?
<br />
void CThumbBmpView::OnPaint()<br />
{<br />
CPaintDC dc(this);
<br />
<br />
CRect r;<br />
GetClientRect(&r);<br />
<br />
CXTPBufferDC memDC(dc, r);<br />
memDC.FillSolidRect(r, (RGB(255,255,255)));<br />
<br />
OnPrepareDC(&memDC);<br />
OnDraw(&memDC);<br />
<br />
<br />
<br />
}<br />
<br />
<br />
<br />
void CThumbBmpView::OnDraw(CDC* pDC)<br />
{<br />
<br />
HANDLE hFile;<br />
DWORD dwNumberOfBytesToRead;<br />
DWORD dwNumberOfBytesRead;<br />
<br />
<br />
<br />
hFile = CreateFile( "D:\\preview.bmp",<br />
GENERIC_READ, <br />
FILE_SHARE_READ,<br />
NULL,<br />
OPEN_EXISTING,<br />
FILE_ATTRIBUTE_NORMAL,<br />
NULL );<br />
<br />
if( hFile == INVALID_HANDLE_VALUE )<br />
{ <br />
MessageBox( "Invalid Handle", "ERROR", MB_ICONERROR);<br />
<br />
}<br />
else<br />
{<br />
BYTE *Buffer;<br />
DWORD p=SetFilePointer( hFile, 0x000, NULL, FILE_BEGIN );<br />
<br />
Buffer = new BYTE [2363392+1];<br />
<br />
BOOL bResult = ReadFile( hFile,<br />
Buffer,<br />
2363392,<br />
&dwNumberOfBytesRead,
NULL<br />
);<br />
<br />
if(!bResult)<br />
MessageBox("Error");<br />
<br />
<br />
<br />
<br />
<br />
if(!bitmap.CreateBitmap(1000,500,1,32,Buffer))<br />
MessageBox("cant Create Bitmap");<br />
<br />
}<br />
CDC dcCompatible;<br />
if ( !dcCompatible.CreateCompatibleDC( pDC ) )<br />
{<br />
return;<br />
}<br />
CBitmap* pOld = dcCompatible.SelectObject( &bitmap );<br />
<br />
BITMAP bmInfo;<br />
if ( bitmap.GetObject( sizeof( bmInfo ), &bmInfo ) != 0 )<br />
{<br />
pDC->BitBlt( 0,0, bmInfo.bmWidth, bmInfo.bmHeight, &dcCompatible, 0,0, SRCCOPY );<br />
<br />
}<br />
<br />
dcCompatible.SelectObject( pOld );<br />
<br />
}<br />
<br />
<br />
Regards,
Srinivas
|
|
|
|
|
vasu_sri wrote: CDC dcCompatible;
if ( !dcCompatible.CreateCompatibleDC( pDC ) )
this will not work. Yous should pass the pointer of original device context. it can be modified as follows
CClientDc dc(this)<br />
CDC dcCompatible;<br />
if ( !dcCompatible.CreateCompatibleDC( &dc ) )
nave
|
|
|
|
|
I don't think this is the problem. Actually I don't think it is a problem.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
I bet itwill not work unless you change it.
nave
|
|
|
|
|
And why?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
|
Good (though empirical) point. I will try...
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
In addition to the above post, you must bitblit the content from memdc to dc in the CThumbBmpView::OnPaint()function after the statement OnDraw(&memDC);
nave
|
|
|
|
|
I agree only on this (see my reply above). Additionally, the OP have to first select the bitmap inside the memDC. To summarize, the OP has to:
(1) Create a compatible (memory) DC
(2) Select the bitmap inside the memory DC.
(3) Preform Perform BitBlt from the MemDC to the actual one.
Hope that helps
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
CPallini wrote: (1) Create a compatible (memory) DC
(2) Select the bitmap inside the memory DC.
I think the CXTPBufferDC will be hadling this.
nave
|
|
|
|
|
i did all what u asked me to do. i converted CDC to CClientDc. But still it doesn't work. i am doing this for the first time and so can u please explain me a little more clearly?? or can u give me any related link that can help me???
Regards,
Srinivas
|
|
|
|
|
if(!bitmap.CreateBitmap(1000,500,1,32,Buffer))
The bitmap file not only contains the pixel data information. It also contain a file header. But the CreateBitmap funtion only need bufffer information. So you must remove the header information from the buffer before passing it to CreateBitmap function.
But still I dont understand why you directly read the bitmap. My suggestion is to use the LoadImage() instead of this.
nave
|
|
|
|