|
HenrikO wrote:
I've read some articles about this but everyone is avoiding this bit.
because that's the hard bit.
you essentially have to measure the page, then measure the string. if the string is too long, break it somewhere (by breaking and measuring in a loop, usually). then print the first part, page break, print the next part (or, as much of it that fits on the page) and so on.
i'm sure someone will correct me if i'm wrong... but that's the way i've always seen it done.
-c
Garbage collection, making life better - for weenies!
|
|
|
|
|
Thanks for your response.
Excuse me for the stupid question's I'm asking, but how to I make a page break
regards
Henrik
|
|
|
|
|
CDC::StartPage and CDC::EndPage control where a page starts and ends. CDC::StartDoc and CDC::EndDoc control the overall document.
-c
Garbage collection, making life better - for weenies!
|
|
|
|
|
Thank You I Think this will help me alot!!!!
Best Regards
Henrik
|
|
|
|
|
I just posted an article about this. You can find it in the printing section.
Roger Allen
Sonork 100.10016
If I had a quote, it would be a very good one.
|
|
|
|
|
i want to call the main window of my sdi from a custom dialoge .. is there any way for doing it..
secondly i want to make a check such that every time when i run my software it could check the values in the database .if the data base is all empty it should call the secondary dlg first with displaying the main dlg. and if the data base has some entries then the main dlg should be called.
thanks for ure help
looking forward from all the gurus of code
|
|
|
|
|
This is not what you're asking for, but maybe you can solve your problem by calling the secondary dialog directly when needed in your app's InitInstance , right before the main window initialization.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
I've developed an ATL service which offers an interface.
I observed the number of threads the service handles is as big as the number of CoCreateInstance/Release calls for a pointer of that interface.
It seems like the number of threads is only increasing and never decreasing. Is this true or there is a timeout for any thread?
Is it possible to have bugs in my application, despite of the fact that i didn't create any thread?
rechi
|
|
|
|
|
I have some code in a button event. When i push the button an unhandled exception appears saying "Stack overflow". If i put a breakpoint in the first sentence in the button event the Stack overflow message appears anyway so it hasn't executed any code when i comes with the Stack overflow message. If i remove all the code from the button event nothing happens... what's wrong?
|
|
|
|
|
This is truly weird... Could you post the relevant code (the handler itself as well as the macros inserted by the MFC wizard related to it)?
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
I found out what it was, i created a very large COLORREF array [1600][1200], but it didn't reach to that sentence before the stack overflow message appeared.
|
|
|
|
|
Hi!
Is there any way to make windows execute an app on shutdown? (something like HKCU\Software\Microsoft\Windows\Current Version\Run but for shutdown)
..or do I need to have an app running in background trapping the WM_ENDSESSION message?
Cheers, Marc Click to see my *real* signature
|
|
|
|
|
This is dependent on OS version.
For NT5+ you can do this using gpedit.msc.
|
|
|
|
|
How do you dynamically set menu item text? I am looking at all the ContextMenu methods, but there is no text setting methods. Any ideas?
thanks
|
|
|
|
|
MFC example:
CMenu *pMenu = GetMenu()->GetSubMenu(0);
pMenu->ModifyMenu(2,MF_BYPOSITION | MF_STRING, NULL,"New menu item text");
|
|
|
|
|
You will need to use ModifyMenu().. look up your documentation on CMenu
"When a friend hurts us, we should write it down in the sand, where the winds of forgiveness get in charge of erasing it away, and when something great happens, we should engrave it in the stone of the memory of the heart, where no wind can erase it" Nish on life [methinks]
"It's The Soapbox; topics are optional" Shog 9
|
|
|
|
|
i am using the odbcrecordset class from the threat:
www.codeproject.com/database/odbcrecordset.asp
but i don't know how i can delete a recordset in my database?
someone has an idea???
thanx for help!!!
tom.
|
|
|
|
|
What do you mean by recordset? Do you mean you want to delete all of the data that is contained in your recordset? Or do you want to delete an entire table or view?
CRecordset (which ODBCRecordset is based on) has a Delete() function, which will delete the currently selected record. You could just loop through each record and delete it from the database.
If you want to drop an entire table or view, you should use the CDatabase class. Look at the ExecuteSQL() function.
|
|
|
|
|
int horzres = GetDeviceCaps(GetDC(GetDesktopWindow()), HORZRES);
int vertres = GetDeviceCaps(GetDC(GetDesktopWindow()), VERTRES);
COLORREF *pCol = new COLORREF[horzres][vertres];
VC++ says "non-constant expression as array bound". Why can i use a non-constant expression to create a one-dimensional array but i can't use a non-constant expression to create a two-dimensional array?
Thanks in advance.
|
|
|
|
|
ain't C++ great?
you'll have to do it something like this:
COLORREF ** pCol = new COLORREF *[horzres];
for (int i=0;i<horzres;i++)
pCol[i] = new COLORREF[vertres];
-c
Garbage collection, making life better - for weenies!
|
|
|
|
|
The reason is that vertres must be a compile-time constant. Eg. the following would work:
int horzres = GetDeviceCaps(GetDC(GetDesktopWindow()), HORZRES);
const int vertres = 600;
COLORREF (*pCol)[vertres] = new COLORREF[horzres][vertres]; But of course this is not what you want. Solutions:- Follow Chris' advice and construct an array of arrays. This complicates the destruction code, though.
- Use a one-dimensional array and index it like follows:
COLORREF *pCol = new COLORREF[horzres*vertres];
pCol[h*vertres+v]; - Use a
std::vector<std::vector<COLORREF> > .The construction code is as complicated as in 1, but at least you get automatic cleanup.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
wait a min
|
|
|
|
|
Does somebody know whatfor is LPDWORD lpThreadId in Win32 CreateThread() ?
MSDN says: lpThreadId, Pointer to a variable that receives the thread identifier.
I wonder, I get back a handle from CreateThread() which I use for closing/suspending etc, why do I need an additional identifier?
|
|
|
|
|
If you you're not going to need it, just set the parameter to null. I don't know much about it, but maby in some functions you need a "thread identifier" instead of a thread id.
|
|
|
|
|
thx! you brought more light into the dark.
I will do - or using _beginthreadex() instead.
|
|
|
|