Click here to Skip to main content
15,892,517 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
SuggestionRe: How to hanle header click & prevent of a list control Pin
David Crow24-Mar-12 12:29
David Crow24-Mar-12 12:29 
QuestionHow to set focus on an activeX? Pin
Member 875345022-Mar-12 18:48
Member 875345022-Mar-12 18:48 
AnswerRe: How to set focus on an activeX? Pin
Randor 23-Mar-12 7:27
professional Randor 23-Mar-12 7:27 
QuestionSubclassed CListCtrl Pin
David Crow22-Mar-12 11:18
David Crow22-Mar-12 11:18 
AnswerRe: Subclassed CListCtrl Pin
Jochen Arndt22-Mar-12 22:36
professionalJochen Arndt22-Mar-12 22:36 
GeneralRe: Subclassed CListCtrl Pin
David Crow23-Mar-12 2:09
David Crow23-Mar-12 2:09 
GeneralRe: Subclassed CListCtrl Pin
Jochen Arndt23-Mar-12 2:26
professionalJochen Arndt23-Mar-12 2:26 
QuestionSerial Port / Windows Sockets clash Pin
ad_robot22-Mar-12 2:07
ad_robot22-Mar-12 2:07 
Hey Guys,

I ran into a frustrating problem yesterday. I've been using winsock2.h and Afxwin.h to create asynchronous TCP/IP sockets in C++ for awhile (I'm using Visual Studio).

I've also been using Arduinos to deliver sensor data over serial to C++ programs via the Arduino SerialClass (http://arduino.cc/playground/Interfacing/CPPWindows).

I tried combing the two functions yesterday into something that could send serial data over TCP/IP but soon discovered that adding afxwin.h library to my existing serial port reader led to the following error:

fatal error C1189: #error : WINDOWS.H already included. MFC apps must not #include <windows.h>

If I remove the windows.h definition from the arduino class I get 81 errors describing things like missing semicolons and undeclared identifiers in the serialclass (the library works fine normally).

I've tried changing the MFC settings in visual studio to work with windows libraries, but I get this error instead:

fatal error C1189: #error : Building MFC application with /MD[d] (CRT dll version) requires MFC shared dll version. Please #define _AFXDLL or do not use /MD[d]

I've tried #define _AFXDLL, which gives the 'windows.h already included' error again.

Does anyone know a way to make these two headers work with each other so I can integrate the functionality? If not I guess I need to find a way to either
1) Read the serial port without the Arduino SerialClass and windows.h (is that possible?)
2) Broadcast TCP/IP messages without winsock2.h & AFxwin.h

Any help appreciated, I'm rather stuck! Confused | :confused:

I also can't switch operating system due to the nature of numerous other components in this project.

Thanks,

Ad
AnswerRe: Serial Port / Windows Sockets clash Pin
Jochen Arndt22-Mar-12 2:55
professionalJochen Arndt22-Mar-12 2:55 
QuestionRe: Serial Port / Windows Sockets clash Pin
ad_robot22-Mar-12 7:39
ad_robot22-Mar-12 7:39 
AnswerRe: Serial Port / Windows Sockets clash Pin
Jochen Arndt22-Mar-12 8:07
professionalJochen Arndt22-Mar-12 8:07 
GeneralRe: Serial Port / Windows Sockets clash Pin
ad_robot22-Mar-12 10:03
ad_robot22-Mar-12 10:03 
GeneralRe: Serial Port / Windows Sockets clash Pin
Jochen Arndt22-Mar-12 21:41
professionalJochen Arndt22-Mar-12 21:41 
GeneralRe: Serial Port / Windows Sockets clash Pin
ad_robot23-Mar-12 2:21
ad_robot23-Mar-12 2:21 
GeneralRe: Serial Port / Windows Sockets clash Pin
Jochen Arndt23-Mar-12 2:43
professionalJochen Arndt23-Mar-12 2:43 
Questiondebug dll not working Pin
appollosputnik21-Mar-12 6:05
appollosputnik21-Mar-12 6:05 
AnswerRe: debug dll not working Pin
Chris Losinger21-Mar-12 6:16
professionalChris Losinger21-Mar-12 6:16 
AnswerRe: debug dll not working Pin
Rajesh R Subramanian21-Mar-12 6:26
professionalRajesh R Subramanian21-Mar-12 6:26 
AnswerRe: debug dll not working Pin
Albert Holguin21-Mar-12 7:43
professionalAlbert Holguin21-Mar-12 7:43 
AnswerRe: debug dll not working Pin
Malli_S21-Mar-12 20:09
Malli_S21-Mar-12 20:09 
AnswerRe: debug dll not working Pin
Stephen Hewitt22-Mar-12 3:41
Stephen Hewitt22-Mar-12 3:41 
QuestionvCard Pin
wangxiaodong21-Mar-12 1:55
wangxiaodong21-Mar-12 1:55 
AnswerRe: vCard Pin
Code-o-mat21-Mar-12 2:38
Code-o-mat21-Mar-12 2:38 
Questionload dll on remote PC Pin
lolyckan20-Mar-12 22:30
lolyckan20-Mar-12 22:30 
AnswerRe: load dll on remote PC Pin
Code-o-mat20-Mar-12 23:15
Code-o-mat20-Mar-12 23:15 

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.