|
I am not getting your problem are u using
the class CScrollView ?
what was ur problem exactly ?
Vikas Amin
Embin Technology
Bombay
vikas.amin@embin.com
|
|
|
|
|
I derived from CWnd, and want to make it scrollable, and find ScrollWindow is not enough.
|
|
|
|
|
If u r using the CWnd class then u
need to do lots of coding (as far asi know )
I have used the CScrollView in MDI
applications only , this class handles
all the scrolling code overhead
[thats benifit of inheritance]Use this class
to derive your view class .
Vikas Amin
Embin Technology
Bombay
vikas.amin@embin.com
|
|
|
|
|
According to the MSDN documentation for ScrollWindow you have to call UpdateWindow immediately after calling ScrollWindow .
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" - mYkel - 21 Jun '04
"There's not enough blatant self-congratulatory backslapping in the world today..." - HumblePie - 21 Jun '05
Within you lies the power for good - Use it!
|
|
|
|
|
I want to create a new view that is able to scroll
in my MDI application whose base view class is CView.
I tired to create a new class from the Scroll view
and by using the create function i created the view
on a DialogBox .
After making some changes everthing is fine .
but when i click the scroll bars then i get error,on debugging
the viewcore.cpp is opend and in
int CView::OnMouseActivate(CWnd* pDesktopWnd, UINT nHitTest, UINT message)
{.....}
probable the problem is due to the New view is a child to main ?
How do i avoid that ? or is there any other solution
for this.
Thanks
Vikas Amin
Embin Technology
Bombay
vikas.amin@embin.com
|
|
|
|
|
vikas amin wrote:
i created the view
on a DialogBox .
That might be you problem right there. Views (any window derived from CView ) is meant to be used in a CFrameWnd window.
vikas amin wrote:
when i click the scroll bars then i get error,on debugging
the viewcore.cpp is opend and in
int CView::OnMouseActivate(CWnd* pDesktopWnd, UINT nHitTest, UINT message)
{.....}
What error? What line? What does the debug output window tell you? What are the values of the various variables on the line that gave you the error?
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" - mYkel - 21 Jun '04
"There's not enough blatant self-congratulatory backslapping in the world today..." - HumblePie - 21 Jun '05
Within you lies the power for good - Use it!
|
|
|
|
|
Thank you Arends
i have anyhow solved the problem by
displaying the view on the Mainframe .
Thank you for bring to my notice that
view are ment for CFrameWnd
Vikas Amin
Embin Technology
Bombay
vikas.amin@embin.com
|
|
|
|
|
Hi,
I am planning to write a common library to be used in two projects, but not everything in the common library will be used in both the projects.
does anyone know if the individual project binaries will bloat due to unnecessary inclusion of functions in the common library that they will not be using?
Thanks
/f
|
|
|
|
|
Usually the linker's clever enough to not include functions that aren't used. For more details, see the options on MSDN, specifically /OPT:REF (which is the default in release builds).
Matt Godbolt
Engineer, ProFactor Software
StyleManager project
|
|
|
|
|
Except that I am pretty sure all code for all members and functions of C++ classes are included. This is what can lead to bloat - your C++ classes are huge.
Stand-alone library functions - the linker only includes the ones you call or are directly called by other functions.
|
|
|
|
|
I am new VB programming and using vb6. I want to fill grid for some records from my database. I am using msflexgrid for displaying data and managing rows and columns in loop by code for that but by doing so, it slow the speed of application when records exceed about 50 - 60, is there any other alternative for that, also i m in search of any good input grid control
|
|
|
|
|
If m_Flex is the control variable connected to the control:
m_Flex.SetRedraw(FALSE);<br />
<br />
<br />
m_Flex.SetRedraw(TRUE);
And this is not a VBee forum.
this is this.
|
|
|
|
|
Hi,
try this one.
Regards
Achim Klein
We can do no great things, only small things with great love. - Mother Theresa
|
|
|
|
|
hi
i wanted to know how should i handle other Application's Messages?
something like what a Spys or KidControllers Applications do. for example getting the other applications keystrokes. or getting other applications Window position.
thx
-- modified at 5:50 Saturday 24th September, 2005
|
|
|
|
|
Here is a keyboard hook (Global hook):
http://www.codeproject.com/dll/keyboardhook.asp[^]
To know the other windows position:
1- ::EnumChildWindows(...) can be used.
First get the desktop window, then enumerate its children. That gives you HWND 's for all windows.
2- ::FindWindow(...)
You can give it the window title text, and it will return the HWND .
Then use ::GetWindowRect(...) . That will give you the left and top.
this is this.
|
|
|
|
|
hi all
ive made a dialog based application with MFC appwizard .
i wanted to handle the keyboard enteries so i used wm_keydown
but the problem is that when i hit The Arrows (up down ..) it doesnt call the function onKeyDown(). and also when i press enter the program exits.(i delete the OK and CANCEL default keys)
what should i do?? how should i handle arrow an enter keys??
|
|
|
|
|
Look here for handling keys:
http://www.codeproject.com/dialog/pretransdialog01.asp[^]
As for the Enter key, put a button on the dialog with ID:
IDOK .
(Change the default from IDC_BUTTON1 to IDOK)
Handle the click event:
OnOK()<br />
{<br />
}
Then delete the new button you put there.
this is this.
|
|
|
|
|
|
hi
i wanted to know how should i scale a bitmap.
can i use SetMapMode() ?? and then bitblt the bitmap??
|
|
|
|
|
|
Hi,
here is some copy-and-paste code:
CBitmap* CMyDialog::ZoomBitmap(CBitmap* pBitmap, const CRect& FitInto)
{
if (FitInto.IsRectEmpty()) return 0;
CRect bmpRect = doGetBitmapRect(pBitmap);
if (bmpRect.IsRectEmpty()) return 0;
CRect zoomedRect = doGetZoomedBitmapRect(pBitmap, FitInto);
if (zoomedRect.IsRectEmpty()) return 0;
CDC* pDC = GetDC();
if (pDC == 0) return 0;
CDC* memDC1 = new CDC;
if (memDC1->CreateCompatibleDC(pDC) == 0)
{
delete memDC1;
ReleaseDC(pDC);
return 0;
}
CDC* memDC2 = new CDC;
if (memDC2->CreateCompatibleDC(pDC) == 0)
{
delete memDC1;
delete memDC2;
ReleaseDC(pDC);
return 0;
}
CBitmap* zoomed = new CBitmap;
if (zoomed->CreateCompatibleBitmap(pDC, zoomedRect.Width(), zoomedRect.Height()) == 0)
{
delete memDC1;
delete memDC2;
delete zoomed;
ReleaseDC(pDC);
return 0;
}
ReleaseDC(pDC);
CBitmap* old1 = memDC1->SelectObject(pBitmap);
CBitmap* old2 = memDC2->SelectObject(zoomed);
memDC2->SetStretchBltMode(HALFTONE);
BOOL result = memDC2->StretchBlt
(
0,
0,
zoomedRect.Width(),
zoomedRect.Height(),
memDC1,
0,
0,
bmpRect.Width(),
bmpRect.Height(),
SRCCOPY
);
if (result == FALSE)
{
delete zoomed;
zoomed = 0;
}
memDC2->SelectObject(old2);
memDC1->SelectObject(old1);
delete memDC2;
delete memDC1;
return zoomed;
}
Regards
Achim Klein
We can do no great things, only small things with great love. - Mother Theresa
|
|
|
|
|
Looks good! But you should eliminate all thoses unneeded news. The only new required by your code is that used to allocate zoomed. If any one of the news (except the first one) was to throw an exception, your code would leak memory.
If you modified the code to take another CBitmap argument to store the results, then you could elimimate all allocation. That way the user of the ZoomBitmap function would not need to know that they are responsible for deleting the returned pointer via delete, unles they had allocated it themselfs.
Exmaple:
BOOL ZoomBitmap(Bitmap& zoomed, Bitmap& srcBitmap, const CRect& FitInto )
{...}<br>
void OnZoom()
{
CBitmap zoomed;
if( ZoomBitmap(zoomed,srcBitmap,FitInto) )
}
Oh well, just some minor observations...
INTP
Every thing is relative...
|
|
|
|
|
hi
how to search for a specific file in folder using VC++?
i have searched CFile class but didn't get the idea.
Thanx in advance
|
|
|
|
|
|