Click here to Skip to main content
15,917,005 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: ANSI -> UTF8 Pin
Nemanja Trifunovic21-Sep-07 4:54
Nemanja Trifunovic21-Sep-07 4:54 
GeneralRe: ANSI -> UTF8 Pin
Jörgen Sigvardsson21-Sep-07 4:59
Jörgen Sigvardsson21-Sep-07 4:59 
GeneralRe: ANSI -> UTF8 Pin
Gary R. Wheeler22-Sep-07 3:07
Gary R. Wheeler22-Sep-07 3:07 
QuestionProblem in HotKey Pin
GauranG Shah21-Sep-07 4:13
GauranG Shah21-Sep-07 4:13 
AnswerRe: Problem in HotKey Pin
nbugalia21-Sep-07 4:30
nbugalia21-Sep-07 4:30 
GeneralRe: Problem in HotKey Pin
GauranG Shah21-Sep-07 19:54
GauranG Shah21-Sep-07 19:54 
AnswerRe: Problem in HotKey Pin
Iain Clarke, Warrior Programmer21-Sep-07 5:02
Iain Clarke, Warrior Programmer21-Sep-07 5:02 
GeneralRe: Problem in HotKey Pin
GauranG Shah21-Sep-07 19:55
GauranG Shah21-Sep-07 19:55 
GeneralRe: Problem in HotKey Pin
Iain Clarke, Warrior Programmer23-Sep-07 22:13
Iain Clarke, Warrior Programmer23-Sep-07 22:13 
QuestionCommunication between C++ DLL and VB6 window. Pin
BubbaGeeNH21-Sep-07 3:07
BubbaGeeNH21-Sep-07 3:07 
AnswerRe: Communication between C++ DLL and VB6 window. Pin
toxcct21-Sep-07 3:19
toxcct21-Sep-07 3:19 
AnswerRe: Communication between C++ DLL and VB6 window. Pin
BubbaGeeNH21-Sep-07 7:18
BubbaGeeNH21-Sep-07 7:18 
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 

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.