|
Hi,
Why am getting this exception
KERNEL32! 7c59bcb1()
MSVCRTD! _CxxThrowException@8 + 57 bytes
COleDispatchDriver::InvokeHelperV(long 26, unsigned short 2, unsigned short 12, void * 0x053afeac, const unsigned char * 0x00000000, char * 0x053afe60) line 407
COleControlSite::InvokeHelperV(long 26, unsigned short 2, unsigned short 12, void * 0x053afeac, const unsigned char * 0x00000000, char * 0x053afe60) line 976
CWnd::InvokeHelper(CWnd * const 0x0042a5a8 {CMSComm hWnd=0x00c302f0}, long 26, unsigned short 2, unsigned short 12, void * 0x053afeac) line 354
CMSComm::GetInput() line 347 + 21 bytes
CNgpptDialog::SerialDataUpdate() line 613 + 15 bytes
ReadResponse() line 171
KERNEL32! 7c57b3bc()
Thanks
|
|
|
|
|
shir_k wrote: Why am getting this exception
KERNEL32! 7c59bcb1()
MSVCRTD! _CxxThrowException@8 + 57 bytes
COleDispatchDriver::InvokeHelperV(long 26, unsigned short 2, unsigned short 12, void * 0x053afeac, const unsigned char * 0x00000000, char * 0x053afe60) line 407
COleControlSite::InvokeHelperV(long 26, unsigned short 2, unsigned short 12, void * 0x053afeac, const unsigned char * 0x00000000, char * 0x053afe60) line 976
CWnd::InvokeHelper(CWnd * const 0x0042a5a8 {CMSComm hWnd=0x00c302f0}, long 26, unsigned short 2, unsigned short 12, void * 0x053afeac) line 354
CMSComm::GetInput() line 347 + 21 bytes
CNgpptDialog::SerialDataUpdate() line 613 + 15 bytes
ReadResponse() line 171
KERNEL32! 7c57b3bc()
Because the MSCOMM control doesn't seem to be happy with the parameters it is provided.
I don't know what version of the control you're using, but since IMSComm is a published dual interface, it should not have changed.
By looking at the parameters provided to CWnd::InvokeHelper() it seems like you're calling the Input method (long 26 ) as a DISPATCH_PROPERTYGET (unsigned short 2 ) and expecting a VARIANT in return (unsigned short 12 ).
If you still want to use the MSCOMM control I suggest you declare a VARIANT and set it up prior to calling the control.
Create a SAFEARRAY with SafeArrayCreate() containing an array of unsigned char (VT_UI1) , let the pArray member of the VARIANT union point to the safearray and set the vt member of the VARIANT to VT_UI1 | VT_ARRAY .
Look up the documentation for SafeArrayCreate() in MSDN and you'll find how to set it up.
If you're willing to give the MSCOMM control up (since it's really bad in many ways) and do the serial communication yourself, which I really urge you to, you should have a look at this[^] great article.
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
hi,
This how am getting data from serial port
CString SerialData
CComVariant vIn;
vIn.Clear();
vIn = CMSCommPtr ->GetInput();
SerialData = vIn.bstrVal;
U see any problem in the above code.
|
|
|
|
|
shir_k wrote: CString SerialData
CComVariant vIn;
vIn.Clear();
vIn = CMSCommPtr ->GetInput();
SerialData = vIn.bstrVal;
U see any problem in the above code.
All COM interfaces returns a HRESULT, which is a 32-bit integer value that is an error code that equals zero if everything was OK. The ability to return any other type is disguised when using dispatch interfaces. In your case the VARIANT that is supposed to be returned is a temporary object in the wrapper for the MSComm server. The wrapper was created by the wizard when you added the ActiveX component to your project. A pointer to this temporary VARIANT is provided in the parameter list when the interface method is called. For some reason the MSComm server doesn't like how that temporary object is set up, or you may be calling it from the wrong context.
This can happen if you're calling the server from a different thread than the one that created the server without marshalling the interface.
I suggest that you continue with one of the following depending on whether you're using multiple threads or not:
1. If you're using multiple threads you have to know how to cross apartment boundaries the correct way. Read Lim Bio Liong's excellent articles to get the basics down. You'll find them here[^], starting with part 1.
2. If you're only using one single thread, I suggest you use the other implementation of the Input() method that takes a VARIANT in the parameter list according to my first post in this forum thread. This way you have the control over the VARIANT.
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
Ok Thanks
Ours is multi threaded.I will go through the article.
Our project gets hanged or crashed when i try to any multi media or graphics related file.
Thanks
|
|
|
|
|
Um, it might help if you said *when* you get that exception, and in what context?
Does it appear on the LCD screen on your toothbrush when you use it?
Is it on your toaster? Only when you try and heat poptarts?
Iain.
|
|
|
|
|
Pop-Tart exceptions are UNACCEPTABLE!
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi,
Am placing the pressure data continously in CListCtrl after reading from serial port(Am reading every 10 ms with the help of timer).Am also deleting data placed in CListCtrl after displaying 150 pressure outputs on the control(am deleting only one data using m_ctrl.delete(0)) so buffer does not overflow.
Flow of the program is
1) Timer interrupt occurs every 10 ms
2)Read the serial port and place it in CListCtrl at every 10 ms.
This is working for some time lated above exception occurs.
|
|
|
|
|
|
Customizing a scrollbar is no easy thing to do. The scrollbar is a single control which contains no child windows. The buttons and thumb use the same paint methods that normal controls use when they call DefWindowProc(). When DefWindowProc handles WM_PAINT, unless the paint is a simple FillRect it calls internal functions to do the complicated painting. By subclassing you don't have access to these functions unless you call DefWindowProc() from your WM_PAINT handler and paint over what has been done. In the case of a scrollbar this is difficult since you don't know the dimensions of the buttons and Thumb.
IMHO the easiest way to do this is to rebuild the scrollbar from scratch. Create a custom control, add the two scrollbuttons and a window for the thumb. Then all you need to do is subclass those new windows and add handlers for whatever scrollmessages you want to use.
Trust me, I have done both! The scrollbar is by far the most complicated window to skin.
Waldermort
|
|
|
|
|
What you're asking is pretty difficult. But there is at least one article here on CP about skinning the scrollbar. Should be fairly simple to search for it.
Just be warned, it wasn't a two line coding effort.
Iain.
|
|
|
|
|
Another thought...
Things like the scrollbar have a standard look for a *reason*. You;d better have some very strong logic as to why yours will look different, or your end users will curse you for making their lives harder.
Iain.
|
|
|
|
|
1/ People who read the replies have no diea what they were in reply to.
2/ Noone can now answer with - "Ah, you need to look at my does-it-all library which will solve all your problems".
So, it's rude and not in your self interest even.
Iain.
|
|
|
|
|
In my programm if i add "MainFrm.h" in a cpp file of my thread procedure i get number of errors but whenever i remove "Mainfrm.h" i dont get that errors. But i have to add "MainFrm.h" in a cpp file of thread procedure bcoz i want to get a pointer of MainFrame class to access it. what to do? is this the case that we can not add "MainFrm.h" in cpp file of thread procedure? can anybody help me plz?
Thanks & Regards
Anay Kulkarni
|
|
|
|
|
Consider to add the error textes to your posting if you want an answer.
Greetings from Germany
|
|
|
|
|
I think that you have included "ThreadProcedure.h" in "MainFrm.h" and now are trying to include "MainFrm.h" in "ThreadProcedure.h".
To get rid of it, either use #pragma once in both files, and include after it
or you can put both files include statements in stdafx.h, and include stdafx.h where needed.
Hope this will help 
|
|
|
|
|
Though MSDN explains the following error it doesn't give any solution,any pointers on this
Expression Evaluator Error CXX0069
Send Feedback
variable needs stack frame
The expression evaluator cannot evaluate the variable because it does not occur in a stack frame.
This can be caused by variables declared as part of an inline function.
Thanks
|
|
|
|
|
Check out [^]
Yes U Can ...If U Can ,Dream it , U can do it ...ICAN
|
|
|
|
|
I am getting this error in file afxcoll.inl in the following function and the code is breaking here,i am using Visual Studio 2005:
AFXCOLL_INLINE INT_PTR CPtrArray::Add(void* newElement)
{ INT_PTR nIndex = m_nSize;
SetAtGrow(nIndex, newElement);
return nIndex; }
The link you gave doesn't seem to be of any help.
Regards,
Mayank
|
|
|
|
|
Pls send me ur code. bcoz this is #include file.pls debug it properly.
are u using some add function in ur code ? please check it.
Yes U Can ...If U Can ,Dream it , U can do it ...ICAN
|
|
|
|
|
Can u pls check that the variable u declared locally is exceeded a bound.
Yes U Can ...If U Can ,Dream it , U can do it ...ICAN
|
|
|
|
|
Unless the program being debugged is currently executing in the scope of the variable, the variable value will display said error.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
hi all
i want to know that how can i know the system port number
as i need it for socket programming
thanks
|
|
|
|
|
p_ wrote: the system port number
If you want to know the standard ports (aka "well known ports"), you can find a list here[^]
Alcohol. The cause of, and the solution to, all of life's problems - Homer Simpson
|
|
|
|
|
thanks for ur answer sir
i use this code on a button but port which is in bold does not work
so please tell me what port number i should use
CAsyncSocket m_sListener, m_sConnected;
UpdateData(TRUE);
m_sListener.Create(port);
if(m_sListener.Listen()==FALSE)
{
AfxMessageBox("Unable to Listen on that port,please try another port");
m_sListener.Close();
return;
}
m_sConnected.Create();
m_sConnected.Connect("10.179.22.75",port);
if( m_sListener.Listen()== FALSE)
{
AfxMessageBox("Unable to Listen ,please try another port");
m_sListener.Close();
return;
}
thanks
|
|
|
|