Click here to Skip to main content
15,888,816 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionCWnd pointer Pin
josip cagalj21-Sep-07 1:53
josip cagalj21-Sep-07 1:53 
AnswerRe: CWnd pointer Pin
bob1697221-Sep-07 2:03
bob1697221-Sep-07 2:03 
GeneralRe: CWnd pointer Pin
josip cagalj21-Sep-07 2:13
josip cagalj21-Sep-07 2:13 
GeneralRe: CWnd pointer Pin
bob1697221-Sep-07 2:16
bob1697221-Sep-07 2:16 
GeneralRe: CWnd pointer Pin
Mark Salsbery21-Sep-07 8:22
Mark Salsbery21-Sep-07 8:22 
GeneralRe: CWnd pointer Pin
josip cagalj23-Sep-07 22:55
josip cagalj23-Sep-07 22:55 
QuestionException Pin
shir_k21-Sep-07 1:43
shir_k21-Sep-07 1:43 
AnswerRe: Exception Pin
Roger Stoltz21-Sep-07 3:47
Roger Stoltz21-Sep-07 3:47 
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

GeneralRe: Exception Pin
shir_k23-Sep-07 20:04
shir_k23-Sep-07 20:04 
AnswerRe: Exception Pin
Roger Stoltz23-Sep-07 21:56
Roger Stoltz23-Sep-07 21:56 
GeneralRe: Exception Pin
shir_k24-Sep-07 0:35
shir_k24-Sep-07 0:35 
AnswerRe: Exception Pin
Iain Clarke, Warrior Programmer21-Sep-07 4:54
Iain Clarke, Warrior Programmer21-Sep-07 4:54 
GeneralRe: Exception Pin
Mark Salsbery21-Sep-07 8:24
Mark Salsbery21-Sep-07 8:24 
GeneralRe: Exception Pin
shir_k23-Sep-07 19:17
shir_k23-Sep-07 19:17 
Question[Message Deleted] Pin
padpras21-Sep-07 1:17
padpras21-Sep-07 1:17 
AnswerRe: problem with customizing scrollbar Pin
Waldermort21-Sep-07 4:39
Waldermort21-Sep-07 4:39 
AnswerRe: problem with customizing scrollbar Pin
Iain Clarke, Warrior Programmer21-Sep-07 4:56
Iain Clarke, Warrior Programmer21-Sep-07 4:56 
AnswerRe: problem with customizing scrollbar Pin
Iain Clarke, Warrior Programmer21-Sep-07 4:57
Iain Clarke, Warrior Programmer21-Sep-07 4:57 
AnswerPlease don't delete your question. Pin
Iain Clarke, Warrior Programmer23-Sep-07 22:10
Iain Clarke, Warrior Programmer23-Sep-07 22:10 
Questionproblem in thread calling Pin
AnayKulkarni21-Sep-07 0:23
AnayKulkarni21-Sep-07 0:23 
AnswerRe: problem in thread calling Pin
KarstenK21-Sep-07 0:34
mveKarstenK21-Sep-07 0:34 
AnswerRe: problem in thread calling Pin
nbugalia21-Sep-07 0:35
nbugalia21-Sep-07 0:35 
QuestionSolution ot the following error Pin
Maynka20-Sep-07 23:51
Maynka20-Sep-07 23:51 
AnswerRe: Solution ot the following error Pin
ShilpiP21-Sep-07 0:47
ShilpiP21-Sep-07 0:47 
GeneralRe: Solution ot the following error Pin
Maynka21-Sep-07 1:07
Maynka21-Sep-07 1:07 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.