|
I need to use the Automation to export data from
a VC++ application into an Excel document.
I also need to manage the Excel sheet in oder to
add, remove and move cells, colums and rows.
Does someone know where I can find some samples
or information ??
I know nothing about it and I need help!!!
|
|
|
|
|
Visual C++ comes with COMEXCEL sample. You may use it as a starting point.
Tomasz Sowinski -- http://www.shooltz.com
** Putt knot yore thrust inn spel chequers. **
|
|
|
|
|
|
Your sample are very interesting !!!!
Do you know where can I find some documentation
about Office methods ??
Now I think that the main difficult is to find
the appropriate method to use and to supply the
right parameters to it !!!
|
|
|
|
|
Normaly, you should have all the doc needed on your machine.
Look into Microsoft Office/Office/1033/vbaxl9.chm. It's the visual basic excel reference, but you can use it to invoke methods and propertyget/put.
btw. the 9 in vbaxl9.chm can be another number, defining the version of excel.
[VISUAL STUDIO 6.0] [MFC] [WIN98/2]
Bluute tette!
|
|
|
|
|
You have suggested me all I was looking for !!!!
Thank you very much !!!
|
|
|
|
|
I already said that I did some excel automatisation in c++. It's a long and hard way (especially if you're going to catch the excel events too).
So don't hesitate to ask in the future, it can save you a lot of time.
[VISUAL STUDIO 6.0] [MFC] [WIN98/2]
Bluute tette!
|
|
|
|
|
Suppose there is a function having some local variables and local objects. This function calls some other function. Now at this stage do we say that local variables/objects goes out of scope. Does the destructors of local objects called here ??
OR
Do we say that local variables/objects goes out of scope when a certain function returns ??
|
|
|
|
|
They are still in scope untill the function they were declared in exits or when they reach the end bracket from which they were declared.
{
int poo;
{
//poo still in scope
}
} <-- poo out of scope and deleted.
Asim Hussain
e: asim@jawache.net
w: www.jawache.net
|
|
|
|
|
I have a dialog that I invoke with a button press on a Propertypage. From within the Dialog I want to acces certain propertypage member variables.
This is the way I do it.
m_List = ((CParameterPage*) GetParent())->m_ParList;
But it seems that all variables I acces are uninitialized eventhough they have correct values before I invoke the dialog!
What am I doing wrong?
|
|
|
|
|
Actually, a dialog invoked from property page isn't a child window. So you can't use GetParent; add the pointer as a memmber of CYourDialog class. If you only need to access the list, add the pointer/reference to the list instead.
Tomasz Sowinski -- http://www.shooltz.com
** Putt knot yore thrust inn spel chequers. **
|
|
|
|
|
Thank you,
And the compiler couldn't tell me that
Arjan.
If every fool wore a crown, we would all be king - Lard
|
|
|
|
|
I have to draw some measurepoints in the view of a CScrollView. So, have anyone a idea how to make this (FLICKERFREE!!!) on a pocket pc (no directdraw...).
Should I draw the measurepoints in a mem dc and blit that in the view?
--
Nice greets, Daniel.
|
|
|
|
|
Daniel S. wrote:
Should I draw the measurepoints in a mem dc and blit that in the view?
Exactly.
Tomasz Sowinski -- http://www.shooltz.com
** Putt knot yore thrust inn spel chequers. **
|
|
|
|
|
Hello,
exists there an api-function in c++ that i can use to determine the user-rights of the current user logged in in winnt (i need to know if the user has administrator-rights)?
Best regards
tabor25
|
|
|
|
|
KB article Q118626 "HOWTO: Determine Whether a Thread Is Running in User Context of Local Administrator Account" has the answer.
Tomasz Sowinski -- http://www.shooltz.com
** Putt knot yore thrust inn spel chequers. **
|
|
|
|
|
There are a whole bunch of functions that you can use to test for permission to perform
various activities. Below is a chunk of code from an install tool I was writing. I got
fed up and unsed InstallShield once I realised I was being silly reinventing the wheel,
but the code pasted worked just fine!
Good luck!
Iain.;)
if (m_bIsWinnt)<br />
{<br />
TRUSTEE Trustee;<br />
ACCESS_MASK AccessMask;<br />
::BuildTrusteeWithName (&Trustee, "CURRENT_USER");<br />
<br />
PSECURITY_DESCRIPTOR pSecDesc= NULL;<br />
PACL pAcl = NULL;<br />
if (::GetNamedSecurityInfo (<br />
"MACHINE\\SYSTEM\\CurrentControlSet\\Services",<br />
SE_REGISTRY_KEY,<br />
DACL_SECURITY_INFORMATION,<br />
NULL,<br />
NULL,<br />
&pAcl,<br />
NULL,<br />
&pSecDesc) == ERROR_SUCCESS)<br />
{<br />
if (::GetEffectiveRightsFromAcl (pAcl, &Trustee, &AccessMask) == ERROR_SUCCESS)<br />
{<br />
if (AccessMask & STANDARD_RIGHTS_REQUIRED)<br />
m_bIsAdministrator = TRUE;<br />
}<br />
::LocalFree (pSecDesc);<br />
}<br />
<br />
char buf [MAX_PATH];<br />
if (!GetSystemDirectory (buf, MAX_PATH))<br />
m_bIsAdministrator = FALSE;<br />
else<br />
::lstrcat (buf, "\\drivers");<br />
<br />
if (m_bIsAdministrator && ::GetNamedSecurityInfo (<br />
buf,<br />
SE_FILE_OBJECT,<br />
DACL_SECURITY_INFORMATION,<br />
NULL,<br />
NULL,<br />
&pAcl,<br />
NULL,<br />
&pSecDesc) == ERROR_SUCCESS)<br />
{<br />
if (::GetEffectiveRightsFromAcl (pAcl, &Trustee, &AccessMask) == ERROR_SUCCESS)<br />
{<br />
if (AccessMask & STANDARD_RIGHTS_REQUIRED)<br />
m_bIsAdministrator = TRUE;<br />
}<br />
::LocalFree (pSecDesc);<br />
} else<br />
m_bIsAdministrator = FALSE;<br />
}
|
|
|
|
|
Yes, there is even one simple function in the "Settlement API" as they call it.
IsUserAnAdmin()[^]
int x=1, y=5;
x^=y^=x^=y;
<a href="http://www.codeproject.com/tips/StupidXORTrick.asp" target="_blank">ClickHereForHelp();</a>
|
|
|
|
|
are there any another better tools like Visual Assist?
|
|
|
|
|
|
|
Hi, everyone!
Such is my view about memory release and allocate of
OS, that is, when a block of memory is marked unuse in
a process (maybe by free), it is not released to the system (OS) immediately.
On the contrary, when the number of the unused memory is
large enough, then all of the memory is released to system (OS).
Am I correct?
I still have a question. Suppose in a case, when process P has
freed a memory block M, but M has not released to system (OS)
yet. Then process P is going to allocate another memory
block. Can the new memory block use the space of memory clock M?
If it is so, I think it is more faster and efficient to use memory
this way than to allocate a memory block directly from memory.
Is that so?
Cheers,
George
|
|
|
|
|
the only bit i can contribute to, relates to the reuse of memory by the OS.
i have definitely come across Windows re-using a memory address immediately after that address was freed by delete.
at the time it really confused me because i was not resetting my previous pointer to null.
ie.
myob1* pOb1 = new myob1;
:
:
delete pOb1; // forgot to reset to null. doh!
myob2* pOb2 = new myob2; // pOb2 may share the same address as pOb1 did.
pOb1->somefunc(); // things go crazy here because the momory is valid but the object type is different.
|
|
|
|
|
Thanks, DanG pal!
I still have a question. In your example,
What is the difference between the two
statements?
1. delete pOb1;
2. pOb1=NULL;
A further question, if I want to set a pointer NULL,
need I delete it before I set it NULL?
Cheers,
George
|
|
|
|
|
pOb1=NULL will not free the memory => memory leak.
if the object was created using 'new' then at some point, some where, some code should call 'delete' on it else memory keeps on being allocated and not freed and the system will degrade until it crashes (if the momory leak is large enough).
i'm being a little vague on where or who does the de-allocation because this is a big subject in itself.
|
|
|
|