|
Bummer, I was hoping I could avoid that Ah well. And the 'cool' part was referring to 'using IE as user interface', not so much to my user interface itself It's a frontend for geological modelling software, not very interesting for us software guys, but if you're really interested I can send you some screenshots when it's done
|
|
|
|
|
There may well be another way, but that's the only suggestion I have.
Yep screenshots would be of interest.
Neville Franks, Author of ED for Windows. www.getsoft.com
Make money with our new Affilate program
|
|
|
|
|
need example or document about how to unzip a zipped file programmatically.
thx
includeh10
|
|
|
|
|
|
I've succeded in writing into an excelfile from c-application
My problem ist that i want to write an formula into an excelcell.
Many Excel-formulas like =LN(C9) or =PI() do their work
But wenn i use e.g. =Summe(A9:A11) it only writes the text into the cell but it doesn't calculate the sum.
codeexample:
pExcel->Range["Tabelle1!C7"]->Formula="=SUMME(A9:A11)"; //this doesn't work
pExcel->Range["Tabelle1!C7"]->Formula="=LN(C9)"; //this does the job
any ideas why this doesn't work with summe?
|
|
|
|
|
I don't think that "=SUMME(A9:A11)" is an Excel function. Its not listed in the help file.
Try =SUM(A9:A11)
|
|
|
|
|
oh sorry i've got the german version of excel
in your case your right
but its not only a problem of Summe (or Sum) the same problem with Varianz and some other funktions.
if i open the excelfile klick to edit the formula and klick then enter without editing it works
but this is no acceptable solution
the file which i want to create has over 1000 lines and formulas.
i can't klick every cell
who to fix it?
|
|
|
|
|
Sorry.
Have you tried changing the cell format to "General" if it is "Text" it may not calculate. I doubt that is the problem though. This got over my head real quick . If I think of anything else I will let you know.
|
|
|
|
|
yes i've tried changing cell format but without succes
If he(excel) would think it is text then there would be a ' in front of the text but there isn't.
He writes #Name? (i don't know what he would write in the english version)in the cell until i click it then it works
other ideas?
|
|
|
|
|
#Name? is what I got with the English version of Excel.
|
|
|
|
|
The reason will be that "Name" is in english and in german the same word
|
|
|
|
|
I browsed through "Excel Developers Kit" book from Microsoft Press, I did not see anything. Sorry
|
|
|
|
|
@kjessee
Doesn't matter. One could not know anything. Thanks for your tips
Perhaps another one has an idea
|
|
|
|
|
|
I am trying to write a DLL to be called from VB. Thus I had to use SAFEARRAY.
I have a problem that when I am accessing all the elements in the array I can change their values but when I try to access a specific element it seems not to accept the new value I try to assign.
For example, I have these functions:
void Set2DSafeArrayPtr(SAFEARRAY * psaiInOut, long val)
{
long ai[2];
int x,y;
LRESULT hres;
int xMin = psaiInOut->rgsabound[0].lLbound;
int xMax = xMin + (int)psaiInOut->rgsabound[0].cElements - 1;
int yMin = psaiInOut->rgsabound[1].lLbound;
int yMax = yMin + (int)psaiInOut->rgsabound[1].cElements - 1;
// Set up dimension array and pointer to receive value.
long * piInOut;
if (hres = SafeArrayLock(psaiInOut)) throw hres;
for (x = xMin; x <= xMax; x++) {
ai[0] = x;
for (y = yMin; y <= yMax; y++) {
ai[1] = y;
hres = SafeArrayPtrOfIndex(psaiInOut, ai, (void **)&piInOut);
if (hres) throw hres;
// Equivalent to: aiInOut(x, y) = aiInOut(x, y) + 1.
(*piInOut) = val;
}
}
if (hres = SafeArrayUnlock(psaiInOut)) throw hres;
}
void SetElementPtr(SAFEARRAY * psaiInOut, int x, int y, long val)
{
LRESULT hres;
long * piInOut;
long ai[2];
if (hres = SafeArrayLock(psaiInOut)) throw hres;
ai[0] = x;
ai[1] = y;
hres = SafeArrayPtrOfIndex(psaiInOut, ai, (void **)&piInOut);
if (hres) throw hres;
(*piInOut) = val;
if (hres = SafeArrayUnlock(psaiInOut)) throw hres;
}
my program
void main{
...
SAFEARRAYBOUND bDim[2];
bDim[0].lLbound = 0;
bDim[0].cElements = 6;
bDim[1].lLbound = 0;
bDim[1].cElements = 6;
psaiNew = SafeArrayCreate(VT_I4, 2, bDim);
if(psaiNew == NULL){
cout << "Unable to initialize array. Not enough memory" << endl;
return;
}
hres = SafeArrayLock(psaiNew);
Set2DSafeArrayPtr(psaiNew, 15);
SetElementPtr(psaiNew, 1,2,30);
hres = SafeArrayUnlock(psaiNew);
...
}
The Set2DSafeArrayPtr seems to work fine but the SetElementPtr doesn't seem to work.
Any idea why? What am I doing wrong?
I'd also like to know of a good place I can find references/examples (other then MSDN)...
|
|
|
|
|
I added a menu to a dialog application, and can't seem to get the UPDATE_COMMAND_UI behavior to work. If I break on my OnUpdate... handler, it's called after the menu item has been selected, not before. I've been poking around on Code Project, and I'm starting to get the "impression" that it might not be possible.
Is that true, or is there a way to update a menu item in a dialog app?
|
|
|
|
|
One solution is to implement OnInitMenuPopup().
-----
void CDlgApp::OnInitMenuPopup(CMenu* pPopupMenu, UINT nIndex, BOOL bSysMenu)
{
// Enables this dialog based app to handle ON_UPDATE_COMMAND_UI messages.
// For updating items in menu.
CDialog::OnInitMenuPopup(pPopupMenu, nIndex, bSysMenu);
CCmdUI cmdUI;
cmdUI.m_pMenu = pPopupMenu;
cmdUI.m_nIndexMax = pPopupMenu->GetMenuItemCount();
for (cmdUI.m_nIndex = 0; cmdUI.m_nIndex < cmdUI.m_nIndexMax; cmdUI.m_nIndex++)
{
cmdUI.m_nID = pPopupMenu->GetMenuItemID(cmdUI.m_nIndex);
if (cmdUI.m_nID == 0)
continue;
cmdUI.DoUpdate(this, FALSE);
}
}
-----
Kuphryn
|
|
|
|
|
Thanks, I'll give it a try.
|
|
|
|
|
I get an Access Violation when executing pPopupMenu->GetMenuItemCount()
in your example.
Here's where it occurs...
_AFXWIN_INLINE UINT CMenu::GetMenuItemCount() const
{ ASSERT(::IsMenu(m_hMenu)); return ::GetMenuItemCount(m_hMenu); }
|
|
|
|
|
It looks like pPopupMenu is not setup properly prior to the call to OnInitMenuPopup. I tried executing the following command...
pPopupMenu->GetMenuState(0,MF_BYPOSITION);
and it also results in an access violation.
Oh Well.
An Ideas?
|
|
|
|
|
Add a handler for WM_KICKIDLE . In the handler, call UpdateDialogControls(this, false); You'll need to #include <afxpriv.h> for the definition of WM_KICKIDLE
--Mike--
Yeah, payin' the bills with my mad programming skillz.
Defraggin' my hard drive for thrills.
Homepage | RightClick-Encrypt | 1ClickPicGrabber
"You have Erica on the brain" - Jon Sagara to me
|
|
|
|
|
Seems like a losing battle... The ON_UPDATE_COMMAND_UI message handler is still never called.
Oh well.
|
|
|
|
|
Look for 'Q242577' in MSDN, there is an example 80 lines of code overriding the OnInitMenuPopup function and it worked for me.
|
|
|
|
|
Hey! That did the trick, thanks.
|
|
|
|
|
I am working on a project where I need to set the region of numerous windows not owned by my application. This works great on 2000 but in testing on a 98se box, I found it gives an "invalid parameter" error(87) when the winow handle passed into setwindowrgn is no associatd with the application calling the function. I cannot find any documentation from MS that eludes to the fact this is not allowed and only occurs on 9x boxes. Does anyone know of a workaround or way to correct this issue. To test - create an app that sets a window region and use FindWindow to get the handle of a running instance of Notepad and try to change the shape of notepad. Keep in mind this works fine on 2000 but not on my 98se machine.
Thanks in Advance.....
|
|
|
|