|
I have switched from Office 2003 to Office 2007 (Excel 2007). After moving InterpX function call arguments to column IW and beyond, it returns a "#VALUE!". I know Excel 2003 has a limit of IV columns so I'm guessing the Interp32.xll addin (InterpX function) must have a column limitation. Is there a version of this addin that can be used in Excel 2007?
Thanks,
Michael
michael.slipper@navy.mil
modified on Thursday, September 18, 2008 2:12 PM
|
|
|
|
|
|
|
I want to be able to shut down my MFC SDI application from within CMainFrame::~CMainFrame if needed. What is the method I should use to do this.
|
|
|
|
|
This is a bit puzzling to me. If your main window's destructor is running, your program is all but gone already. The WM_DESTROY has already been handled, your window are gone. Unless you've added a lot of stuff to be done in CMyApp::~CMyApp (), there's only a few more lines of code left...
Iain.
|
|
|
|
|
I made a mistake, I want to be able to shut down in CMainFrame::OnCreate(). I am initializing a serial port there and if it fails I want to be able to shut down the app. I tried using PostMessage(WM_DESTROY) but I get an error on closing.
|
|
|
|
|
What happens when you just return -1?
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Okay, that produces a message box "Failed to create empty document", and shuts down when OK is clicked, which is okay with me, but is there a way to do away with that message and just close down?
|
|
|
|
|
Damn MFC document interface stuff...
How about PostMessage(WM_CLOSE);
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I found that exit(0), usually does the trick. But be VERY carefull about what you log under 'onexit()'. BTW are you letting the User know why this happens? (Or do you write particulars to a Log File?, ifso, say that in a MessageBox.) Also, is there any User data to be saved? (Probably Not...).
Otherwise you may end up with an App that under Obscure Circumstances refuses to Start, without any visual effects. (Doubleclick 'exe', Hourglass Appears, Hourglass Dies, Nothing Happens. (Been there, have several teeshirts).
What I found usefull, was to write a Global Termination procedure:
void Terminate(DWORD ErrCode=MYERR_SUCCESS){
if(ErrCode==MYERR_SUCCESS)exit(0);
CString ErrMsg=GetErrMsg(ErrCode)
AfxMessageBox(ErrMsg,MB_ICONSTOP);
CErrorLog::LogError(ErrCode);
exit(ErrCode);
}
Hope this is Usefull
Bram van Kampen
|
|
|
|
|
FWIW I created a quick MFC SDI app and put PostMessage(WM_CLOSE);
at the end of the OnCreate() function of the main window class.
The app closed cleanly.
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi
I am using some propety pages in wizard mode, on one of my pages i am using a toolbar
The first time you use the wizard it all works fine
if you run the wizard again, the toolbar fails to load correctly
The toolbar appears to be there, but there are no images shown on any of the buttons
I am creating the toolbar in the oninitdialog() of the property page using
if(!m_toolBar2.Create(this) || !m_toolBar2.LoadToolBar(IDR_TOOLBAR2))
AfxMessageBox("Failed");
Can anyone help at all ?
thanks
Simon
|
|
|
|
|
Hi all,
I made an ActiveX Control in VB 6.0 which uses region functions to give the control an irregular look, I mean, not a plain square or rectangle. The control looks as it should when placed on a VB Form at design time. However, when I put the same control on a dialog box in VC++ 6.0, it gets a square shape, though at run time the control appears how it should. Is there a difference in the ways VB and VC initalize the same control at design time? Or is there an issue with using the region functions? Please help. Thanks.
Henry.
|
|
|
|
|
Is it good to have a public struct in a class? If its private, is there any way to use getter to get the struct?
|
|
|
|
|
you mean, the definition of the type ? or an instance of such a struct ?
|
|
|
|
|
|
so that doesn't make sense to have a getter to access a type definition.
a getter would be to retrieve a member of the class, which type could be of a defined struct...
so yes, either define your struct outside, or if inner, do it publically (unless it's for the class internal use only)
|
|
|
|
|
thank you for replying my noob questions, regards.
|
|
|
|
|
I'm not sure what you're doing but perhaps you want something fun like this
<br />
<br />
class CSomething<br />
{<br />
<br />
public:<br />
<br />
struct MyInterface<br />
{<br />
public:<br />
int Increment( void );<br />
};<br />
<br />
MyInterface* QueryInterface()<br />
{<br />
return dynamic_cast<myinterface*>(&aHiddenInstance);<br />
}<br />
<br />
private:<br />
<br />
struct stHidden : public CSomething::MyInterface<br />
{<br />
int Increment( void )<br />
{<br />
iHiddenStructMember++;<br />
}<br />
<br />
int iHiddenStructMember;<br />
};<br />
<br />
stHidden aHiddenInstance;<br />
};<br />
<br />
Geek points obvously to the first person who points out that this is fairly pointless and double to anyone who can guess which old MS technology I'm playing with today
"The secret of happiness is freedom, and the secret of freedom, courage."
Thucydides (B.C. 460-400)
|
|
|
|
|
I am trying to draw something into memory DC and then copy it to screen or printer DC. I get the correct output drawing on screen or when directly taking the print out on printer. BUt while viewing print preview, it does not show any output.
CMyView::OnDraw(CDC* pDC)
{
CTestDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
if (!pDoc)
return;
CRect rcClient;
if (pDC->IsPrinting())
{
rcClient = m_rcPrintRect;
}
else
{
GetClientRect(&rcClient);
}
CBitmap bmp;
CDC memDC;
memDC.CreateCompatibleDC(pDC);
bmp.CreateCompatibleBitmap(pDC, rcClient.Width(), rcClient.Height());
memDC.SelectObject(&bmp);
memDC.DrawText(L"Hello", &rcClient, DT_CENTER | DT_VCENTER);
pDC->BitBlt(0,0,rcClient.Width(), rcClient.Height(), &memDC, 0, 0, SRCCOPY);
bmp.DeleteObject();
memDC.DeleteDC();
return;
}
I suspect something is wrong with creating compatible DC. pDC represents printer dc but the display is on screen. How to remove this problem?
|
|
|
|
|
What is the value of rcClient when it fails?
I'm not seeing anything wrong with your DC creation...
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I checked it in debug mode. the program does not fail in print preview. BitBlt also completes successfully. only I do not get any output. I can initialize rcClient to (0,0,0,0) but that does not make a difference.
Thanks.
|
|
|
|
|
ok....and the answer to my question is?
From the debugger, what is the left/top/right/bottom values of the rect?????
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
oh sorry...
in print preview, top=0, bottom=6400, left = 0, right=4900 (size of A4 sheet in pixels @600 dpi)
in print, height= 6300, widht=4800...(because of different margin settings?)
the fruits of your success will be in direct ratio to the honesty and sincerity of your own efforts in keeping your own records, doing your own thinking and, reaching your own conclusions.
..surviving in autumn..in love with spring..
|
|
|
|
|
Arghh I'm drawing a blank here LOL
What happens if you do
pDC->MoveTo(rcClient.left, rcClient.top);
pDC->LineTo(rcClient.right, rcClient.bottom);
Do you get a diagonal line?
Also is the bitmap creation succeeding?
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|