Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
Windos
win32.3rdparty
win32.directx.audio
win32.directx.ddk
win32.directx.graphics
win32.directx.input
win32.directx.managed
win32.directx.misc
win32.directx.networking
win32.directx.sdk
win32.directx.video
win32.dirx.grap.shaders
win32.gdi
win32.international
win32.kernel
win32.messaging
win32.mmedia
win32.networks
win32.ole
win32.rtc
win32.tapi
win32.tapi.beta
win32.tools
win32.ui
win32.wince
win32.wmi
windows.mediacenter
winfx.aero
winfx.announcements
winfx.avalon
winfx.collaboration
winfx.fundamentals
winfx.general
winfx.indigo
winfx.sdk
winfx.winfs
  
 
date: Thu, 22 Dec 2005 22:37:01 -0800,    group: microsoft.public.win32.programmer.directx.networking        back       


Using kernel32.dll for serial port connection   
Hi everybody,
   I am new in creating serial port connection. How do you create a serial 
port connection using this following api functions? I will use this serail 
port connection to communicate with a gprs modem operating in Widnows XP 
Embedded. Can you provide some simple codes, the serial port is fixed. I used 
C# and VB.Net.

[DllImport("kernel32.dll")]

private static extern Boolean GetCommProperties(IntPtr hFile, out COMMPROP 
cp);

[DllImport("kernel32.dll")]

private static extern Boolean GetCommModemStatus(IntPtr hFile, out UInt32 
lpModemStat);

[DllImport("kernel32.dll")]

private static extern Boolean GetCommState(IntPtr hFile, ref DCB lpDCB);

[DllImport("kernel32.dll")]

private static extern Boolean SetCommState(IntPtr hFile, [In] ref DCB lpDCB);

[DllImport("kernel32.dll", SetLastError=true)]

private static extern IntPtr CreateFile(String lpFileName, UInt32 
dwDesiredAccess, UInt32 dwShareMode, IntPtr lpSecurityAttributes, UInt32 
dwCreationDisposition, UInt32 dwFlagsAndAttributes, IntPtr hTemplateFile);

[DllImport("kernel32.dll")]

private static extern Boolean CloseHandle(IntPtr hObject);

[DllImport("kernel32.dll", SetLastError=true)]

private static extern Boolean ReadFile(IntPtr hFile, [Out] Byte[] lpBuffer, 
UInt32 nNumberOfBytesToRead, out UInt32 nNumberOfBytesRead, IntPtr 
lpOverlapped);

[DllImport("kernel32.dll", SetLastError=true)]

private static extern Boolean WriteFile(IntPtr fFile, Byte[] lpBuffer, 
UInt32 nNumberOfBytesToWrite, out UInt32 lpNumberOfBytesWritten, IntPtr 
lpOverlapped);

[DllImport("kernel32.dll")]

private static extern Boolean CancelIo(IntPtr hFile);

[DllImport("kernel32.dll")]

private static extern Boolean TransmitCommChar(IntPtr hFile, Byte cChar);

[DllImport("kernel32.dll")]

internal static extern Boolean SetupComm(IntPtr hFile, UInt32 dwInQueue, 
UInt32 dwOutQueue);

den2005
-- 
MCP Year 2005, Philippines
date: Thu, 22 Dec 2005 22:37:01 -0800   author:   den 2005

Re: Using kernel32.dll for serial port connection   
den 2005 wrote:

> Hi everybody,
>    I am new in creating serial port connection. How do you create a serial 
> port connection using this following api functions? I will use this serail 
> port connection to communicate with a gprs modem operating in Widnows XP 
> Embedded. Can you provide some simple codes, the serial port is fixed. I used 
> C# and VB.Net.

This has nothing to do with DirectPlay, so it is the wrong group for this 
question. Please ask in a C# and/or .net group.

-- 
Phil Frisbie, Jr.
Hawk Software
http://www.hawksoft.com
date: Fri, 23 Dec 2005 09:30:21 -0800   author:   Phil Frisbie, Jr.

Re: Using kernel32.dll for serial port connection   
Hi Phil,
  Do you know anything about how to change the Brightness of a Monitor (LCD 
or not)? Uisng api or otehr methods?

dennis
-- 
MCP Year 2005, Philippines


"Phil Frisbie, Jr." wrote:

> den 2005 wrote:
> 
> > Hi everybody,
> >    I am new in creating serial port connection. How do you create a serial 
> > port connection using this following api functions? I will use this serail 
> > port connection to communicate with a gprs modem operating in Widnows XP 
> > Embedded. Can you provide some simple codes, the serial port is fixed. I used 
> > C# and VB.Net.
> 
> This has nothing to do with DirectPlay, so it is the wrong group for this 
> question. Please ask in a C# and/or .net group.
> 
> -- 
> Phil Frisbie, Jr.
> Hawk Software
> http://www.hawksoft.com
>
date: Mon, 26 Dec 2005 18:26:01 -0800   author:   den 2005

Re: Using kernel32.dll for serial port connection   
den 2005 wrote:

> Hi Phil,
>   Do you know anything about how to change the Brightness of a Monitor (LCD 
> or not)? Uisng api or otehr methods?

Still the wrong group!

-- 
Phil Frisbie, Jr.
Hawk Software
http://www.hawksoft.com
date: Tue, 27 Dec 2005 08:39:40 -0800   author:   Phil Frisbie, Jr.

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us