|
In OnInitDialog()
GetParent()->EnableWindow(TRUE);
|
|
|
|
|
Hi, I was wondering how to change a listview control so that the blue selection is not shown.
Does anyone have an idea?
Thx, Joep
|
|
|
|
|
My guess is that you'd have to ownerdraw the control.
/ravi
"There is always one more bug..."
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Yeah, that's what I'm afraid for ...
Joep Oude Veldhuis
|
|
|
|
|
Joep,
Check out http://www.codeproject.com/listctrl/lvcustomdraw.asp for list control custom draw stuff, if you haven't already. HTH,
/ravi
"There is always one more bug..."
http://www.ravib.com
ravib@ravib
|
|
|
|
|
This seems like a simple question. I want to print multiple pages of text. I am using Stringer's fantastic printing class library. Let's say I want to print 2 pages of text.
The user clicks File/Print and a dialog box comes up. I called:
CPrintPages PrintPages;
PrintPages.DoModal();
The user can click from a bunch of check boxes which pages they want to print. Let's say they check m_page1 and m_page2. I do:
void CFormOptions::OnPrint(CDC* pDC, CPrintInfo* pInfo)
{
CPage* pPage = new CPage(pInfo->m_rectDraw,pDC);
if (PrintPages.m_page1)
{
void PrintPage1(CPage* pPage);
PrintPage1(pPage);
}
if (PrintPages.m_page2)
{
void PrintPage2(CPage* pPage);
PrintPage2(pPage);
}
...
But it print two (2) pages, with both pages on top of each other. How can I programmatically make it print page 1 and then print page 2? I tried
pInfo->m_curPage ++;
and other things, but nothing I try works. Please, please, any response any one can give me will be greatly appreciated.
Sincerely,
Danielle (an overworked graduate student)
|
|
|
|
|
Hi Danielle,
Printing multiple pages is basically using a loop like this:
CDC dc; // Correctly initialized of course ...
CPrintInfo info; // Correctly initialized of course ...
OnBeginPrinting(&dc, &info);
if (info.m_bContinuePrinting)
{
for (UINT page = info.GetFromPage();
page <= info.GetToPage() && bPrintingOK;
page++)
{
dc.StartPage();
info.m_nCurPage = page;
OnPrint(&dc, &info);
bPrintingOK = (dc.EndPage() > 0);
}
}
OnEndPrinting(&dc, &info);
if (bPrintingOK) dc.EndDoc(); else dc.AbortDoc();
HTH,
Joep
|
|
|
|
|
Howdy,
Is it possible to make a dialog type application stay the same size so if a user changes their desktop settings to "Large Fonts" the dialog would still remain the same size.
I have a dialog type app that uses a bmp for the background/dialog.. everything is cool except for if I change my desktop settings to use large fonts.. then the bitmap stays the same size and my dialog gets much larger causing the app to look terrible.
Any ideas?
Rob
|
|
|
|
|
Well, just resize it in OnInitDialog(), but if there are some controls on it you would need to adjust them too.
You can use GetBitmap() to get the bitmap's size, then MoveWindow() or SetWindowPos() to adjust the dialog's size.
Paolo
------
"airplane is cool, but space shuttle is even better" (J. Kaczorowski)
|
|
|
|
|
Thanks Paolo for the info!
I used Set WindowPos() and was able to define the dialog size.. but the controls are still getting enlarged.. do you know the functions that I could use to pre-define the size of the controls or at least keep the size of the controls consistant?
Thanks for you help man!
Rob
|
|
|
|
|
hello
i have this com function (using ATL):
STDMETHODIMP Cmanager::iniGetString(BSTR sSectionName, BSTR sKeyName, BSTR sFileName, BSTR *sRetVal)
{
AFX_MANAGE_STATE(AfxGetStaticModuleState())
char sTemp[MAX_PATH];
memset(sTemp, '\0', MAX_PATH);
GetPrivateProfileString (_BSTR_t(sSectionName), _BSTR_t (sKeyName), "none", sTemp, MAX_PATH, _BSTR_t(sFileName));
sRetVal = SysAllocString ((OLECHAR *)sTemp);
return S_OK;
}
the sRetVal return nothing.
I have tried some examples from MSDN but it didn't work
how can i return sTemp?
pls help me.
|
|
|
|
|
is there a value in sTemp?
try sRetVal = _bstr_t(sTemp).copy();
|
|
|
|
|
You should change
sRetVal = SysAllocString ((OLECHAR *)sTemp);
to
*sRetVal = SysAllocString ((OLECHAR *)sTemp);
Your code has sRetVal as a BSTR*, so all you need to do is work on the item the pointer is pointing to. You should also make sure sRetVal is non-null to avoid future crashes & stuff.
Oh, and an OLECHAR is commonly a wide character - you really should convert it instead of typecasting it from a char. Look into a few ATL helpers in "atlconv.h" such as USES_CONVERSION, A2OLE, OLE2T, ect... as well as CComBSTR, they will make your life easier.
|
|
|
|
|
use
*sRetVal = _bstr_t(sTemp);
|
|
|
|
|
I writting a project using MFC and
I need to connect to a (SQL server) but
I don't know how to do it in VC++
so I need to know the object I need and
how to use them.
one Byte can hold some information but not all
MR.Byte
|
|
|
|
|
there are many ways for database conectivity in VC++ , eg ADO, DAO, etc.
ADO is a COM based solution and is more efficient than other technique. ...U have to create a DSN name for this bu using ODBC.....Go to control Panel and Find "Data Sources (ODBC)" , it would help u in creating DSN Name...
Now in MSDN Help find "ADO" the microsoft gang has already provided the sample code for this....;P
|
|
|
|
|
|
Hi Everybody,
i have porblem guys. I have a Window which consists of a TabCtrl and a ListCtrl. ListCtrl is Placed on TabCtrl. And the Main window posseses the ClipChildren property of windows. When I am loading another window or dialog on the ListCtrl and dragging or moving the loaded window it is painting the list with its backcolor and the list is erased . Will anybody give the solution as soon as possible. Its really urgent..
bye then,
Thanking u inanticipation..
aleem.
|
|
|
|
|
Some ideas:
- the Tab control should have the WS_CLIPSIBLINGS style
- the Tab control should be the last in the tab-order (or play with it)
- try to remove the WS_CLIPCHILDREN style from the main window
Hope this helps,
Paolo
------
"airplane is cool, but space shuttle is even better" (J. Kaczorowski)
|
|
|
|
|
Hi,
Did you come up with a solution cause I have the same problem?
Thx,
/Tommy
|
|
|
|
|
Hi, All.
========
Does anyone know how can I read/write data from the bios?
for example:
a) How can I get the time from the bios?
b) How can I set the time ?
c) How can I get the number of local hardrives from the bios ?
d) and a lot of more HOWs
thanks
BTW: come to #CodeProject on DalNet (mIRC)
|
|
|
|
|
I'm curious, Any particular reason to read the data from the bios rather than letting Windows handle the hard work?
Michael
|
|
|
|
|
No reason.
just FUN
BTW: come to #CodeProject on DalNet (mIRC)
|
|
|
|
|
I know how to do this with IE but I don't have a clue for others (Netscape, Opera, etc.)
Can someone enlight me?
Thanks!
|
|
|
|
|
somthing like:
<br />
window.url
BTW: come to #CodeProject on DalNet (mIRC)
|
|
|
|