C++Builder Programming Forum
C++Builder  |  Delphi  |  FireMonkey  |  C/C++  |  Free Pascal  |  Firebird
볼랜드포럼 BorlandForum
 경고! 게시물 작성자의 사전 허락없는 메일주소 추출행위 절대 금지
C++빌더 포럼
Q & A
FAQ
팁&트릭
강좌/문서
자료실
컴포넌트/라이브러리
메신저 프로젝트
볼랜드포럼 홈
헤드라인 뉴스
IT 뉴스
공지사항
자유게시판
해피 브레이크
공동 프로젝트
구인/구직
회원 장터
건의사항
운영진 게시판
회원 메뉴
북마크
볼랜드포럼 광고 모집

C++빌더 Q&A
C++Builder Programming Q&A
[18267] Re:USB를 CreateFile할때 다른 프로그램에서 CreateFile할수 없도록...
유영인 [Chris] [cuperido] 2710 읽음    2002-05-08 12:52
답변이 좀 늦었네요. 다들 세번째 인자가 0 이면, 공유를 할 수 없다는 말이던데요..
쩝.. 공유를 할 수 없다는 부분이 지배적이던데.. 장치가 없으니 실험해 볼수도 없구요.. :)

아무튼.. 저도 Good Luck 입니다요~


I'd be curious whar other program is currently sharing the USB port.  If
that other program has already opened the port for exclusive access then I
think there's not much you can do other than to close that other program.

I'm also not sure about the exclusive access for comm ports in the case of
USB.  Are USB ports considered comm ports?  Or only Com1 and Com2, etc.?
Perhaps search the internet for USB information.  I'll bet someone has
posted more on this topic.  Good luck.
Rgs,
sjc


> I wrote some program that uses USB port. I used following command, but USB
> port was shared by another program.
>
> hCom = CreateFile(\\\\.\\USB002,
>     GENERIC_READ | GENERIC_WRITE,
>       0, // comm devices must be opened w/exclusive-access <------ is it effectable?
>       NULL, // no security attrs
>       OPEN_EXISTING, // comm devices must use OPEN_EXISTING
>       0, // not overlapped I/O
>       NULL // hTemplate must be NULL for comm devices
>       );
>
> My machine may not share with another program. So, I've tried open USB port
> with exclusive mode, But, It seems be no effect.
>
> Do I have to process another work~?
>
> Thank you
>
> Chris You
>
>
> Chris You Software Engineer - Man & Tech
> 6F SamhwanCamus B/D, 17w/3 Youido, YoungDung-Po Ku Seoul, Korea.
> Phone : +82 (0)2 761-6560 (241) Fax : +82 (0)2 761-6561 Mobile : +82 (0)11
> 729-6449
> e-mail : cuperido@mail.com homepage : http://www.cuperido.pe.kr/

김형덕 님이 쓰신 글 :
: 자체 개발한 USB보드를 사용하여
: 현재 프로젝트가 진행중입니다.
: 근데 이런 프로그램을 2개 띄워도 CreateFile을 하면 프로그램
: 2개다 핸들을 얻습니다.
: CreateFile에 있는 각종 옵션 Share를 0으로 해도 핸들을 얻어
: 하나의 장치를 두 프로그램이 공유를 해버립니다.
: 그러면 안돼는 장비인데...
: 어떻게 하면 장치하나당 하나의 CreateFile할수 있도록
: Lock할수 있을까요
: 살려주세요

+ -

관련 글 리스트
18204 USB를 CreateFile할때 다른 프로그램에서 CreateFile할수 없도록... 김형덕 1389 2002/05/06
30024     Re:USB를 CreateFile할때 다른 프로그램에서 CreateFile할수 없도록... 주한용 1213 2002/05/07
18267     Re:USB를 CreateFile할때 다른 프로그램에서 CreateFile할수 없도록... 유영인 [Chris] 2710 2002/05/08
Google
Copyright © 1999-2015, borlandforum.com. All right reserved.