|
|
I have looked through all the postings on this website and no one seems to have a reasonable answer to the question of using a container and microsoft word. And I am going to post the question, hopefully someone will have a useful idea. I am using VC++ 6.0 and I am trying to create a COM exe or dll. This is what I am doing: I am creating a frame window and automatically opening an ms word document so basically, it is a container window for microsoft word. This part I can get to work but there are some problems. Why are there several toolbar buttons disabled? How can I enabled them? Why does the print/print preview not work? I am not using ATL (and I prefer not too). Also, if I add a menu option of my own, how do I know when the user has selected my menu option? I have researched this through this website and MSDN and I am doing everything that was suggested. But it still isn't working. I have seen similar posting but all the answers have been things like "have you tried to record a macro through VB." and such, things that really don't help. CAN ANYONE OUT THERE HELP ME??????? IS THIS AN INFINITE PROBLEM THAT ONLY MICROSOFT CAN SOLVE??????? IS IT HOPELESS????
|
|
|
|
|
I wouldn't think print preview would work when word in embeded. That should be up to the main application.
Todd Smith
|
|
|
|
|
Actually, MSDN and a few posting suggest doing this:
BOOL CXOfficeView::OnPreparePrinting(CPrintInfo* pInfo)
{
if (!CView::DoPreparePrinting(pInfo))
return FALSE;
if (!COleDocObjectItem::OnPreparePrinting(this, pInfo))
return FALSE;
return TRUE;
}
According to most of the documentation, this should work because print preview would call the print. This doesn't work.
Also, what about the standard print, it doesn't work. And the toolbar buttons!
|
|
|
|
|
Please, how can I detect if my network card works in full or half duplex mode?
|
|
|
|
|
I need to add an Outlook toolbar to a .NET form? Does .NET come with such a feature? If not is there a free way to do this or must a component be purchased? If a componentmust be purchased does anyone recommend one for C++ .NET forms?
Many Thanks,
Derek
|
|
|
|
|
|
I've created a resource with the resource editor inside vc6. A resource.h has also been created. It contains several ID's used by the dialog.
My question is this: can I safely move all those ID's to another header file and completely remove (delete) resource.h ? Will the resource editor still work after that? Or do I have to change something somewhere in the project's preferences (most likely)?
btw. It's obvious that I have to change all the resource.h includes
using: [VISUAL STUDIO 6.0] [WIN98/2]
|
|
|
|
|
the resources are in a .rc file, and you'll need to change the include in there also! I don't know how VC will react to that!
Max.
|
|
|
|
|
I'm assuming you're playing with VC6; there's 'Resource includes' option in view menu which allows you to specify other resource ID header. If you just delete resource.h, .rc file probably won't load.
Tomasz Sowinski -- http://www.shooltz.com
*** Vodka. Connecting people. ***
|
|
|
|
|
But I can move the definitions and still open the resource editor if I keep an empty resource.h?
If you open the rc-file with a text editor, resource.h is in it 2 times. Maybe deleting that will do it.
Better to make a copy now
using: [VISUAL STUDIO 6.0] [WIN98/2]
|
|
|
|
|
Grote Smurf wrote:
But I can move the definitions and still open the resource editor if I keep an empty resource.h?
I don't think so.
Tomasz Sowinski -- http://www.shooltz.com
*** Vodka. Connecting people. ***
|
|
|
|
|
Did it, removed resource.h and it works fine.
using: [VISUAL STUDIO 6.0] [WIN98/2]
|
|
|
|
|
You've removed resource.h from project *and* from disk as well?
Tomasz Sowinski -- http://www.shooltz.com
*** Vodka. Connecting people. ***
|
|
|
|
|
yep
using: [VISUAL STUDIO 6.0] [WIN98/2]
|
|
|
|
|
that worked?
|
|
|
|
|
yep again
This is what I did:
- created the resource dialog using resource editor inside vc6
- build the resource
- closed the workspace
- opened .rc-file in external editor
- changed all the references pointing to resource.h (2) to else.h
- copied the definitions to else.h
- opened the workspace again
- rebuild the whole thing
... works just fine
using: [VISUAL STUDIO 6.0] [WIN98/2]
|
|
|
|
|
I've changed all the references inside the rc-file to another header file and guess what ... It works!!!
using: [VISUAL STUDIO 6.0] [WIN98/2]
|
|
|
|
|
The question remains: Why do you want to do this? Anyone else maintaining your program will want to find the resource symbols, and will look for resource.h. Another problem with this is you will be tempted to put other symbols or definitions in else.h (treating it like any other header file). DevStudio tends to get cranky when resource.h (or whatever you've named it) contains anything in it other than the stuff it puts there.
I'm not meaning to sound critical, this is just the voice of experience.
Gary R. Wheeler
|
|
|
|
|
Can anyone tell me about a simple function that copies all files from one folder in a remote location to a local folder?
For example:
Move all files located in \\Remote\Folder to c:\localfolder
Thanks!
Cintch
|
|
|
|
|
|
Hi, for 3 days i'm trying to make my form resizable.
Well, in desing mode, as my form has the VScroll property true, i increase the bottom of the form and then when i run it the scrollbar appears and works.
I want to do that but by code, to increase the form's bottom as i'm going to dinamically filling it with objects, i'm doing like:
CRect myRect;
for (int i=0;i<100;i++)
{
caramba[i] = new CStatic;
g.Format("%d", i);
caramba[i]->Create(g, WS_CHILD|WS_VISIBLE|SS_CENTER|WS_BORDER, CRect(10, i*10, 120, i*10+50), this);
myRect.bottom+=20;
}
MoveWindow(myRect.left, myRect.top, myRect.right, myRect.bottom);
this->GetParentFrame()->RecalcLayout();
The objects are drawn in the form until number 65, well until the regular size of the form, and the scrollbar do not appear.
How can i make the VScrollbar to appear as the form size increases?
Thank you in advance
|
|
|
|
|
I think you need to set the scroll size. Try this function:
SetScrollSizes()
|
|
|
|
|
Thank you Lucy, i tried your suggestion, i did like:
CRect myRect;
CSize mySiz e;
this->GetClientRect(&myRect);
mySize=myRect.Size();
for (int i=0;i<100;i++)
{
caramba[i] = new CStatic;
g.Format("%d", i);
caramba[i]->Create(g, WS_CHILD|WS_VISIBLE|SS_CENTER|WS_BORDER, CRect(10, i*10, 120, i*10+50), this);
myRect.bottom+=20;
}
MoveWindow(myRect.left, myRect.top, myRect.right, myRect.bottom);
this->GetParentFrame()->RecalcLayout();
this->SetScrollSizes(MM_TEXT, mySize);
this->ShowScrollBar(SB_VERT, TRUE);
this->SetScaleToFitSize(mySize);
Even using SetScrollSizes and ShowScroll after RecalcLayout, it apears for half a second or something, and then disapears again.
I tried SetScaleToFitSize and it did not improve
Why does this appends?
Thank you in advance
|
|
|
|
|
I am not sure. But I think you need to give the total size to SetScrollSize. that is, the size of your document.
Excuse me for my poor English, let me give you an example.
Say you are opening a document which will occupy a 800x600 screen. But your window is only 400x200 big. So you set the scroll size to be 800x200. And the vertical scroll bar and horizontal scroll bar will appear for your to scroll to see the other part of the contents.
If you are using this->GetClientRect() to set scroll size, you are telling Windows that the screen needed is of the same size as the screen allocated. So, no scroll is necessary.
Hope this helps.
|
|
|
|