|
|
I have created a view which need to be printed
by a printer , The base class for the view is
the CScrollView.
How can i print all the data, i also want to
ensure that if data is long enought not to
fit on one page then there should be some
blank space left at the starting and ending
of every page.
Vikas Amin
Embin Technology
Bombay
vikas.amin@embin.com
|
|
|
|
|
Hi,
I have created a custom window with only WS_POPUP style. That is it does not have border and caption. A special border and caption are drawn in its client area. It is supposed to use a virtual client area, which is less than the actual client area.
In this case the parent or any other window calls myWnd.GetClientRect( &rt ), it will get the actual client area, not the area defined by me. I need to give the virtual client area rather than the actual.
Is there any method to supply the virtual client area to GetClientRect() function call?
Thanks in advance!
- NS -
|
|
|
|
|
You can overload GetClientRect(LPRECT lpRect);
In your implementation, Use ::GetClientRect(hWnd, &rect);
Then rect.DeflateRect(10,10,10,10);
It will make the rect smaller by 10 pixels each side. Change that to taste.
this is this.
|
|
|
|
|
Ok it will be fine for CMyWnd::GetClientRect(...).
But what about the call like this...
::GetClientRect( myWnd.GetSafeHwnd(), &rt );
or
myWnd.CWnd::GetClientRect( &rt );
In these case the hWnd is directly used for getting the client rect. I need to manage these types of calls also.
Thank you!
- NS -
|
|
|
|
|
Then don't overload GetClientRect().
Use DeflateRect() with every call, I guess.
this is this.
|
|
|
|
|
I'm sorry to say that it is not fine as you think. The custom client area is not a fixed one.
Also I think it is not good to calculate the client area by the caller after the call to GetClinetRect than doing it automatically when the call occurs.
Could you suggest a better method?
Thank you!
- NS -
|
|
|
|
|
The easiest way is to give your window a border, and do the border drawing in the WM_NCPAINT handler. You can adjust the size of the borders and client area using the WM_NCCALCSIZE message.
"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.
This is a very good idea. And I think it will be fit for my need.
- NS -
|
|
|
|
|
hi
how can i make a user defined resource??
i want to get a MIDI in the .exe file.
-- modified at 4:34 Monday 26th September, 2005
|
|
|
|
|
Import the resource file. It asks for a 'Resouce type'. You can give it any name, like, IDR_MIDI .
Hope that helps.
this is this.
|
|
|
|
|
See if this article is of any help.
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
I create a dll for a c# program. In main program, c# call this dll by DllImport.
But the dll doesn't work, I try to debug the dll with c# program as command. But to my surprise, the break point in dll is useless. The C# program will run the line to call the dll but never enter into its code. We can watch the output window, and find it load some dlls but not the one to bedebugged.
Does c# program don't load dll which is called by DllImport?
Can anybody tell me how to debug in this situation?
Thank you!
|
|
|
|
|
Hi
I have a dialog based MFC application which in which i need to show a GIF animation file.
I want total control of at which position to show the GIF file.
Is there any source file or demo available using which I can show my GIF animaiton file.
Or is there any ActiveX control availabe to show this GIF file
Thankx in advance
Amarelia Maehsh
Gujarat
India
|
|
|
|
|
u can get some idea at
http://www.codeproject.com/staticctrl/gifanimation.asp
Vikas Amin
Embin Technology
Bombay
vikas.amin@embin.com
|
|
|
|
|
Hi vikas,
You are right, I have used the same example you stated. But when I used my animation file which is littlebit larger in size, it doesn't fits into the given Static Control.
How to move the GIF image at exactly 0,0 postion and show my animation properly.
Thankx advance..
Amarelia Maehsh
Gujarat
India
|
|
|
|
|
Amarelia wrote:
I have a dialog based MFC application which in which i need to show a GIF animation file.
Try this Cbitmap derived Class :-
http://www.codeproject.com/bitmap/extendedbitmap2.asp[^]
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
Gdiplus::DrawImage function may be useful for you.good luck
Her şey güzel olacak
|
|
|
|
|
hi canu please tell me h ow to connect to a database created in microsoft access and acces data sign CDatabase class.
|
|
|
|
|
tejaswi_teja wrote:
tell me h ow to connect to a database created in microsoft access and acces data sign CDatabase class.
Have a look here :-
Access Database using CDatabase class[^]
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
Here is a small code from a project for u
CDatabase database;<br />
CString SqlString;<br />
CString sDeviceID,sDeviceName,sStatus;<br />
CString sDriver = "MICROSOFT ACCESS DRIVER (*.mdb)";<br />
CString sDsn;<br />
CString sFile = "D:\\PMR\\vc++\\conndevices.mdb"; <br />
<br />
sDsn.Format("ODBC;DRIVER={%s};DSN='';DBQ=%s",sDriver,app_path);<br />
<br />
database.Open(NULL,false,false,sDsn);<br />
<br />
CRecordset recset( &database );<br />
<br />
<br />
SqlString="SELECT DeviceName FROM conndevices ";<br />
<br />
<br />
Vikas Amin
Embin Technology
Bombay
vikas.amin@embin.com
|
|
|
|
|
This might help.
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
|
If anyone has done a project on
voip ,then please tell he how to go for that
Is ther any code availabe for PC-to-PC in vc++.
Vikas Amin
Embin Technology
Bombay
vikas.amin@embin.com
|
|
|
|
|
how do you do a refresh event using MFC? thanks
|
|
|
|