Click here to Skip to main content
15,902,112 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Library Error Pin
sweep12318-Dec-03 4:32
sweep12318-Dec-03 4:32 
GeneralRe: Library Error Pin
John M. Drescher18-Dec-03 5:42
John M. Drescher18-Dec-03 5:42 
QuestionAFX_MANAGE_STATE(AfxGetStaticModuleState()) problem??? Pin
YaronNir16-Dec-03 22:35
YaronNir16-Dec-03 22:35 
QuestionHow to access Cell Phone (ie: Nokia) via Irda from PC ? Pin
Ivan Budiono16-Dec-03 22:12
Ivan Budiono16-Dec-03 22:12 
AnswerRe: How to access Cell Phone (ie: Nokia) via Irda from PC ? Pin
Peter Molnar17-Dec-03 12:50
Peter Molnar17-Dec-03 12:50 
GeneralRe: How to access Cell Phone (ie: Nokia) via Irda from PC ? Pin
cofst26-Dec-03 16:17
cofst26-Dec-03 16:17 
GeneralRe: How to access Cell Phone (ie: Nokia) via Irda from PC ? Pin
cofst28-Dec-03 20:50
cofst28-Dec-03 20:50 
GeneralRe: How to access Cell Phone (ie: Nokia) via Irda from PC ? Pin
Peter Molnar29-Dec-03 9:52
Peter Molnar29-Dec-03 9:52 
Hi Ivan,

sorry for not answering for a long time but I was away from my desk.

As for porting C++ code to VB.NET, I am not familiar it but I definetaly know -just as you write- that it is possible to call Win32 API functions from VB.NET code.

Comments on your code:
1.The first param of CreateFile is a string like "COM1" or any other string describing the communication device's name. Inspite of the function name NO file is actually created. Use GENERIC_READ | GENERIC_WRITE access flags.

2.CreateFile returns a handle which identifies the opened communication port. Using this handle you can call WriteFile to send AT commands to the device and later on ReadFile to check for response.

3.In order to not block your channel forever, and receive your info you should poll the port for answer (of course only after you have successfully sent to it an AT command) in a loop with ReadFile for a pre-defined, device specific period of time. You should collect the returned info in a buffer.

4.A successfully opened device that you communicate with ALWAYS returns a response regardless of whether the given AT command is understood by the device or not.
Possible responses are "\r\nERROR\r\n" if the AT command is not known to the device, or "\r\nSOME INFORMATION\r\n\r\nOK\r\n" if the sent AT command is supported, where \r\n is 0x0d and 0x0a.



Peter Molnar
GeneralRe: How to access Cell Phone (ie: Nokia) via Irda from PC ? Pin
cofst4-Jan-04 16:14
cofst4-Jan-04 16:14 
GeneralRe: How to access Cell Phone (ie: Nokia) via Irda from PC ? Pin
Peter Molnar4-Jan-04 18:41
Peter Molnar4-Jan-04 18:41 
GeneralCalling C++ code from C Pin
peterchen16-Dec-03 22:04
peterchen16-Dec-03 22:04 
GeneralRe: Calling C++ code from C Pin
Prakash Nadar16-Dec-03 23:49
Prakash Nadar16-Dec-03 23:49 
GeneralRe: Calling C++ code from C Pin
peterchen17-Dec-03 8:12
peterchen17-Dec-03 8:12 
GeneralRe: Calling C++ code from C Pin
Anthony_Yio17-Dec-03 0:39
Anthony_Yio17-Dec-03 0:39 
GeneralRe: Calling C++ code from C Pin
John M. Drescher17-Dec-03 4:21
John M. Drescher17-Dec-03 4:21 
GeneralRe: Calling C++ code from C Pin
Prakash Nadar17-Dec-03 16:03
Prakash Nadar17-Dec-03 16:03 
GeneralRe: Calling C++ code from C Pin
Dinesh Ahuja17-Dec-03 16:45
Dinesh Ahuja17-Dec-03 16:45 
Generalid3 tag for wma file Pin
qdping16-Dec-03 22:01
qdping16-Dec-03 22:01 
GeneralDerived CFrameWnd and attaching a View with it. Pin
Dinesh Ahuja16-Dec-03 21:59
Dinesh Ahuja16-Dec-03 21:59 
GeneralI really need help here! guru plz help Pin
YaronNir16-Dec-03 21:48
YaronNir16-Dec-03 21:48 
GeneralRe: I really need help here! guru plz help Pin
sam India16-Dec-03 22:06
sam India16-Dec-03 22:06 
GeneralRe: I really need help here! guru plz help Pin
YaronNir16-Dec-03 22:13
YaronNir16-Dec-03 22:13 
GeneralRe: I really need help here! guru plz help Pin
sam India16-Dec-03 22:48
sam India16-Dec-03 22:48 
GeneralRe: I really need help here! guru plz help Pin
YaronNir16-Dec-03 22:54
YaronNir16-Dec-03 22:54 
GeneralRe: I really need help here! guru plz help Pin
sam India16-Dec-03 23:58
sam India16-Dec-03 23:58 

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.