|
After a few minutes, a messagebox comes up saying: "Microsoft excel is waiting for another application to complete an OLE action."
I've implemented everything I've found on the msdn example (automating excel using vc++), so they must have forgotten something?
[VISUAL STUDIO 6.0] [MFC] [WIN98/2]
Bluute tette!
|
|
|
|
|
Hi,
I start an Embedded Ms Word instance from my application, all goes ok but the Ms Word window is shown in the bottom of the Z-Order, I would like to bring it top, how can I make that using the App, Doc and that Ms Word stuff ?
Thanks in advance, greetings
Braulio
|
|
|
|
|
I have just started "playing" around with VS.NET. I have created a new project - added an Icon resource. The 32x32 icon is displayed but could somebody please tell me how I create the 16x16 icon - the "Device" field in the properties is disabled and I cannot for the life of me work out where the 16x16 Device has gone or how to add it.
I am certain that it is right there under my nose and that a visit to the optician may be coming up - but i would sure appreciate theh loan of a white stick right now!
TIA
|
|
|
|
|
Doh! - I found out how to do it - must learn to RTFM before making a complete fool of myself
|
|
|
|
|
After using the following command
_crtBreakAlloc = 1884; (this was a tip given by Chris in a previous thread), I discovered that this piece of code causes a memory leak :
if(Map!=NULL) delete[] Map;
Map=NULL;
Map=new I_int[Cor_Node->Parents.Nb_Elems()];
Exact position is the Map=new ... line (of course).Cor_Node->Parents.Nb_Elems() is equl to 4.
Any idea about what happened ? Is there a better way to do this ?
~RaGE();
|
|
|
|
|
hi,
It does not mean that the piece of code is causing the memory leak,
but rather that the memory allocated at this point has not been freed.
Also you should be careful abt tracking the leaks with this
method because the number only indicates that the n-th allocation is
leaked-->this may change if you change the sequence of the actions when
testing or debugging.
|
|
|
|
|
Thanks for the help ...
Prem Kumar wrote:
this may change if you change the sequence of the actions when
testing or debugging.
Is that meaning I have to do exactly the same operations when Debbugging (press same buttons in same order in my app ?) ...
~RaGE();
|
|
|
|
|
You got it! you have to have the same sequence.
|
|
|
|
|
Well, OK. I have implemented Chris´ macros too (supposed to show info about the line where not freed memory is overwritten), but it did not change anything in the debug output, and i cannot spot where something wrong occurs ... any idea how to do that ? (Problem is, i have to take over the bugged code from somebody else =/)
~RaGE();
|
|
|
|
|
Hi,
Check your code that you are properly freeing up Map
at your app exit.
|
|
|
|
|
I've tried all of the macros too and they didn't work. I finally did what was suggested, buy Bounds Checker, after wasting 8 hours trying to get VC++ to show me line number and filename of leak.
As an aside the 40+ leaks identified from the C++ runtime library (STL's list, vector and iostream calls) weren't really leaks. Turns out I just needed to link a library (MFC42D.LIB) in to get rid of those reported leaks.
|
|
|
|
|
How do i release the memory after reading from the CList from the head position.If i run the folowing code i get Debug assertion failed at the delete statement.
void CPLayerApp::LockIt()
{
unsigned char data[10], mCnt,mMid;
CMessage* pMess;
CSingleLock singleLock(&m_SyncLock.m_mutex);
CString str="";
while(1)
{
if(m_messList.GetCount() != 0)
{
singleLock.Lock();
pMess = &m_messList.GetAt(m_messList.GetHeadPosition());//m_messList is a CList pointer
mCnt = pMess->m_cnt;
mMid = pMess->m_mid;
pMess->GetData(data);
POSITION pos = m_messList.GetHeadPosition();
m_messList.RemoveHead();
delete pos;
singleLock.Unlock();
if(data[0] == 0x10)
{
str.Format("%0x",data[0]);
AfxMessageBox(str);
break;
}
}
Sleep(200);
}
Rsh
|
|
|
|
|
I do not see the point of your code Why using a POSITION if you delete it two lines after ?
~RaGE();
|
|
|
|
|
Actually the statement of 'delete pos' doesnt make sense !!
pos is just a stack variable and its value is not necessarily
a pointer.
|
|
|
|
|
Ok. If POSITION and pos r not required can u pls. suggest how to release the memory associated with the element in the CList after you read that? Cause RemoveHead()is not doing that.
Rsh
|
|
|
|
|
how abt 'delete pMess' ???
|
|
|
|
|
No Prem,
even that doesn't work.Just now i tried with that also. Its giving the same error.
Rsh
|
|
|
|
|
As far as I know (but I may be wrong) if you delete an Item with RemoveHead(), itreturns a pointer on the deleted item. So let´s use this to delete the already-deleted-in-the-list Item ... no ?
~RaGE();
|
|
|
|
|
Are you just trying to iterate through the list? If so, there are easier ways, I will elaborate if needed.
Otherwise, just remove the line that says 'delete pos;'. As was stated this is a variable declared on the stack. Trying to delete it will cause debug assertion errors. (Worse yet in release mode)
|
|
|
|
|
what exactly i want is, to read the elemnts from the headposition in Clist and immediately after reading,would like to delete the already read element from the list & also release the memory that was associated with the deleted element.
Can anybody pls. elaborate on this
The code is as follows
void CPLayerApp::LockIt()
{
unsigned char data[10],mCnt,mMid;
unsigned char *ptr;
CMessage* pMess;
CMessage* delMess;
CSingleLock singleLock(&m_SyncLock.m_mutex);
CString str="";
while(1)
{
if(m_messList.GetCount() != 0)
{
singleLock.Lock();
pMess = &m_messList.GetAt(m_messList.GetHeadPosition());
mCnt = pMess->m_cnt;
mMid = pMess->m_mid;
pMess->GetData(data);
//POSITION pos = m_messList.GetHeadPosition();
m_messList.RemoveHead();
delMess= &m_messList.RemoveHead();
//pMess=(CMessage*)m_messList.RemoveHead();
delete delMess;
singleLock.Unlock();
if(data[0] == 0x10)
{
str.Format("%0x",data[0]);
AfxMessageBox(str);
break;
}
}
Sleep(200);
}
Rsh
|
|
|
|
|
hi, anyone can help me?
I have a MDI app, now need to make all the CMDIchildWnd windows floating outsite the MDI frame, like a dialog. i tried to call SetParent(CWnd::GetDesktopWindow()). it seens work, but bring me two new issues: the child window get a icon in task bar, and it crash when i tried to resize or close it, the error exist in CMDIChildWnd::GetMDIFrame(). what is going on? does CMDIChildWnd limit its parent to CMDIFrameWnd?
Any proficients can help me? thanks a lot.
->
|
|
|
|
|
I find that by creating a new frame and loading it wil the OnNew() event works. Its not a child frame in the true sense but it loads in a new external window. However I do not know if this is what u want.
"If at first you don't succeed.....you must be installing Windows..."
Windoze CP - Windows without the cr*p (Now with automatic bug eliminator!)
Hey so what if I'm a geek! Byte me!
|
|
|
|
|
sorry, Jonny. i didn't catch your mean. "not a child frame in the true sense but it loads in a new external window"?
|
|
|
|
|
Write a new cpp file with a new Window in it. Then call it from the OnNew() function with ShowWindow()
"If at first you don't succeed.....you must be installing Windows..."
Windoze CP - Windows without the cr*p (Now with automatic bug eliminator!)
Hey so what if I'm a geek! Byte me!
|
|
|
|
|
A VARIANT which is an array of VARIANT's, surely ?
If you have 50-60 global variables, you're bound to burn in hell anyhow. Globals are rarely necessary, almost always a bad design, and 50-60 is just an incredible achievement IMO.
Christian
I am completely intolerant of stupidity. Stupidity is, of course, anything that doesn't conform to my way of thinking. - Jamie Hale - 29/05/2002
Half the reason people switch away from VB is to find out what actually goes on.. and then like me they find out that they weren't quite as good as they thought - they've been nannied. - Alex, 13 June 2002
|
|
|
|