|
This is totally useless as you will need to link to a specific library and that won't work probably. Instead, take a look at word automation (that is the way to go). There is some usefull articles here[^]
|
|
|
|
|
Thank you both for your answers. I am not an experienced programmer and the reason I wanted to use the other files is, beacause I cannot find a good, simple example on how to do what I need with Word automation.
|
|
|
|
|
Hi all,
When I print a document, I use the CPrinterDialog class. This works fine when I want to show the user the dialog and then het the printer's device context using "GetPrinterDC ()". But when the user clicks the print icon on the toolbar, I want to print without asking for the relevant printer, i.e. using the default printer.
However, when I call "CPrintDialog::CreatePrinterDC ()", I do not get a DC. Microsoft's doc says that you then still need to initialise the dialog by DoModal, but I do not want that, since I do not want to show the user this dialog.
Any bright ideas on how to get the default printer directly?
Thanks in advance
William
|
|
|
|
|
Found the solution meanwhile (in case anybody is interested)
call the printDialog's "GetDefaults ()" function will do the job. If there is no default printer, the function will return FALSE, in which case a print dialog should be shown anyway.
Regards,
WIlliam
|
|
|
|
|
Is GetDefaultPrinter good?
|
|
|
|
|
I want to Know the height from the bottom of the tool bar to the top of main window
Can any body help me out
|
|
|
|
|
There are two ways:
1:
RECT ToolRect;
RECT WndRect;
CToolBar::GetWindowRect (&ToolRect);
GetWindowRect (&WndRect);
ToolRect.left -= WndRect.left;
ToolRect.right -= WndRect.left;
ToolRect.top -= WndRect.top
ToolRect.bottom -= WndRect.top;
This will give you the positions relative to the upper-left corner of the main window. Usually however, you will need the co-ordinates relative to the upperleft corner of the window's client area. This is done by
2:
RECT ToolRect;
RECT WndRect;
CToolBar::GetWindowRect (&ToolRect);
GetClientRect (&WndRect);
ClientToScreen (&WndRect);
ToolRect.left -= WndRect.left;
ToolRect.right -= WndRect.left;
ToolRect.top -= WndRect.top
ToolRect.bottom -= WndRect.top;
Success,
WIlliam
|
|
|
|
|
Hi all,
I've written an ActiveX control that automates MS Word When I call the Method PrintPreview I get the print preview window up but instead of the document being shown I get the web page it resides in, minus the document contents.
I've gone right through the type library header and haven't found another route (it is huge though).
|
|
|
|
|
Automation is a hassle in any case. However, I have found it usefull to generate a word macro doing the things you want done, and then edit that macro to see what exactly happens. Usually you will have to call the same procedures from your automation with the same variables to get the job done.
Success.
William
|
|
|
|
|
Nice idea.
Thanks
Tom
|
|
|
|
|
Hi william,
I used your technique and unfortunately it agreed with what I was already trying. Which is comforting to know, as it means I wasn't on the wrong track. Moreover, it's made me think now that the PrintPreview call is going to IE's PrintPreview engine. Basically, it depicts everything on the page except the Word document, something the Word Print Preview engine would be very unlikely to do.
Looks like I may have to get my hands dirty.;)
Tom
|
|
|
|
|
How can i receive data on my pc from microcontroller using acessspoint.
My microcontroller has TCP/IP stack.
do i have to use TCP protocol as well for receiving the data.
thanks
|
|
|
|
|
yes
~RaGE();
I think words like 'destiny' are a way of trying to find order where none exists. - Christian Graus
|
|
|
|
|
I want color to the controls and and also to the window.
How can i color to it?
|
|
|
|
|
Can you be more specific do you need to set color to controls
|
|
|
|
|
SetBkColor and SetTextColor??
If these do not do the job, you will have to subclass the relevant controls and override the OnPaint function.
William
|
|
|
|
|
To paint the control you can use the WM_CTLCOLOR message.
Then in the OnCtlColor method you can Identify the Control using pwnd.
Then use the SetTextColor and SetBkColor method using pDc(Device context reference).
Hope this will help you.
Bye.
The secret of life is not enjoyment
but education through experience.
- Swami Vivekananda.
|
|
|
|
|
I know we can replace the floating mini frame class for toolbars and other control bars with something like :
m_pFloatingFrameClass = RUNTIME_CLASS(MyFloatingBarFrame);
That changes all mini frames for the application; is there a way to replace the frame for only a few select frames ?
I need to do some customized handling for one controlbar ( when it closes ) that I don't want to do on the other toolbars.
Thanks.
M.
|
|
|
|
|
Hi,
I've just downloaded a delaunay triangulation program from internet and reading the source code. I stumble upon this code:
struct memorypool {
VOID **firstblock, **nowblock;
VOID *nextitem;
VOID *deaditemstack;
VOID **pathblock;
VOID *pathitem;
int alignbytes;
int itembytes;
int itemsperblock;
int itemsfirstblock;
long items, maxitems;
int unallocateditems;
int pathitemsleft;
};
it seems that the program is doing it's own memory management. I wonder why people want to do their own memory management, we have new/delete for C++ and malloc/free for C. What are the advantages/disadvantages of doing our own memory management?
Thanks.
regards,
tep
|
|
|
|
|
In short, knowledge of allocation usage patterns can lead to (significantly) optimized memory allocation/recovery routines.
In general though these optimized routines only shine when you are allocating/freeing many blocks (10's or 100's of thousands at least) repeatedly in a short period of time.
The current malloc/free use lookaside lists and are fairly performant compared with those of the past. There is little _need_ to go beyond these for most programs out there.
...cmk
Save the whales - collect the whole set
|
|
|
|
|
From personal experience in production code, managing your own memory pool can greatly reduce memory fragmentation - we had a process that was only using about 200mb of memory, yet constantly crashed due to running out of memory. We eventually tracked this down to major memory fragmentation - at one stage the largest free chunk of memory dropped to about 15mb!
Implementing memory pooling in the key areas that were constantly allocating and reallocating thousands of tiny objects pretty much eliminated this heavy fragmentation.
|
|
|
|
|
I have a problem using a combobox. I am using SDK, not MFC, but basically the combobox updates and I can use the data in it but the drop down functionality of the combobox does not work. I press the arrow at the right of the combobox and nothing happens - I have to use the arrow keys to select the item I want within the combobox data set.
Do I have to enable the drop down functionality?
Any help would be great
u6ik
|
|
|
|
|
in the resource editor, enlarge the dropdown list to a size bigger than 0
|
|
|
|
|
And even this is tricky ... I do not know how many people just falled in that trap.
~RaGE();
I think words like 'destiny' are a way of trying to find order where none exists. - Christian Graus
|
|
|
|
|
microsoft joke
|
|
|
|