|
Christian,
not sure how to get started. I know a wee bit of UNIX from a 3 week class and no C++. The assignment seems so hard for a first assignment.
C++ Virgin
|
|
|
|
|
C++ Virgin wrote:
The assignment seems so hard for a first assignment.
Could you reduce the suspense a little bit by telling us what it's about?
Nish
Regards,
Nish
Native CPian.
Born and brought up on CP.
With the CP blood in him.
|
|
|
|
|
Nish - Native CPian wrote:
Could you reduce the suspense a little bit by telling us what it's about?
LOL. Nice line Nish.
Michael
|
|
|
|
|
Michael P Butler wrote:
Nice line Nish.
That's what I thought too. But I didn't anticipate what happened later
Nish
Regards,
Nish
Native CPian.
Born and brought up on CP.
With the CP blood in him.
|
|
|
|
|
Please reduce the suspense. What happened later?
|
|
|
|
|
Ed Gadziemski wrote:
Please reduce the suspense. What happened later?
He emailed me his assignment question docs
Regards,
Nish
Native CPian.
Born and brought up on CP.
With the CP blood in him.
|
|
|
|
|
I'm trying to save the current file i'm working on in a visual studio file from an Addin.
I can not get the save command to work. How do you use the command?
Examples, Suggestions?
Here is the code
STDMETHODIMP CCommands::FileFavoritesCommandMethod()
{
AFX_MANAGE_STATE(AfxGetStaticModuleState())
//Get the current file working on
CString csCurrentFile;
CComPtr<idispatch> pActiveDocument;
m_pApplication->get_ActiveDocument(&pActiveDocument);
if(pActiveDocument)
{
CComQIPtr<itextdocument,&iid_itextdocument> spActDoc(pActiveDocument);
if(spActDoc)
{
spActDoc->Save();
BSTR bstrName;
spActDoc->get_FullName( &bstrName );
}
}
}
|
|
|
|
|
how do you know that it is not working?
|
|
|
|
|
It's not compiling.
I'm not sure On what to pass in on the parameters, It wants
::Save(THIS_ VARIANT vFilename, VARIANT vBoolPrompt, DsSaveStatus FAR* pSaved)
I've tried
DsSaveStatus saved;
Save(NULL, TRUE, &saved);
return
--cannot convert parameter 1 from 'const int' to 'struct tagVARIANT
Pluss plenty more and they all say they cannot convert parameter 1 to struct tagVARIANT
Scott
|
|
|
|
|
Use the following code
VARIANT vtErr;
vtErr.vt = VT_ERROR;
vtErr.scode = DISP_E_PARAMNOTFOUND;
VARIANT vtPrompt;
vtPrompt.vt = VT_BOOL;
vtPrompt.boolVal = VARIANT_TRUE;
spDoc->Save(vtErr, vtPrompt, &saved);
This would work but life would be much cool if you use CComVariant or _variant_t.
|
|
|
|
|
that worked, thanks.
I tried using _variant_t but it gave an error when compiling. How do you use CComVariant and _variant_t.
thanks
Scott
|
|
|
|
|
#include <comdef.h>
.
.
.
spDoc->Save(vtMissing, _variant_t(true), &status);
|
|
|
|
|
That gave me the linking errors
Commands.obj : error LNK2001: unresolved external symbol "class _variant_t vtMissing" (?vtMissing@@3V_variant_t@@A)
Commands.obj : error LNK2001: unresolved external symbol "void __stdcall _com_issue_error(long)" (?_com_issue_error@@YGXJ@Z)
|
|
|
|
|
You need to have comsupp.lib linked
|
|
|
|
|
|
How can I replace the scrollbars in a CEdit derived edit control with my own, derviced from CScrollBarCtrl? I've tried all sorts of wierd and wonderful methods, but none seem to work. Also, how would I go about doing the same for list boxes, list controls and combo boxes?
____________________
David Wulff
hu·mour Pronunciation Key (hymr)
n. & v. Chiefly British
Dave's Code Project Screensaver and Wallpaper page.
|
|
|
|
|
Have a look at this article. There is a brief discussion of this question.
Please let us know if you can pull it off.
|
|
|
|
|
|
You shoule be able to override the windows CWnd::GetScrollBarCtrl() virtual function for the window that contains the scroll bars. You can then return pointers to your replacement scrollbars for the horizontal and vertical scrollers.
If you take a look at the base class code you will see what you need to do.
Roger Allen
Sonork 100.10016
If I had a quote, it would be a very good one.
|
|
|
|
|
Well that is the first thing I thought of after browsing through the documentation, but it, well, doesn't seem to work. It is of course possible that I approached it wrong, so I will have a go with a new test app later just to make one hundred percent sure.
Thanks.
____________________
David Wulff
hu·mour Pronunciation Key (hymr)
n. & v. Chiefly British
Dave's Code Project Screensaver and Wallpaper page.
|
|
|
|
|
Hi does anyone know of any free cda to wav (or mp3!) freeware mfc classes ?
Bryce
|
|
|
|
|
I am trying to see under what practical circumstances a virtual base class is needed. I know there are lot of experienced programmers here. I am curious to know whether anyone used virtual base classes in real life. If yes for what?
|
|
|
|
|
I wrote a paint program in MFC, and the mainframe class carried a pointer to a PaintTool class, which was a virtual base for all the different tools in the program. It had methods like Draw and Preview, and also methods such as OnLeftButtonUp, so that I could code the behaviour of the tool entirely in the tool, and MFC called them via the pointer to the base class instance.
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
And you don't spend much time with the opposite sex working day and night, unless the pizza delivery person happens to be young, cute, single and female. I can assure you, I've consumed more than a programmer's allotment of pizza, and these conditions have never aligned. - Christopher Duncan - 18/04/2002
|
|
|
|
|
Did you have something like this :-
class MainFrame
{
private:
PaintTool* m_pTool;
}
class PaintTool
{
...
};
class PaintTool1 : PaintTool
{
};
class PaintTool2 : PaintTool
{
};
Where does multiple inheritance figure in this?
|
|
|
|
|
I don't see how you were asking about multiple inheritance, I thought you wanted to know about virtual base classes ? Did you mean to emphasise the plural, i.e. more than one virtual base ?
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
And you don't spend much time with the opposite sex working day and night, unless the pizza delivery person happens to be young, cute, single and female. I can assure you, I've consumed more than a programmer's allotment of pizza, and these conditions have never aligned. - Christopher Duncan - 18/04/2002
|
|
|
|