다이얼로그 기반의 투명한 윈도우는 세련되고 구현이 쉽다.
간단한 생활 어플리케이션은 이 기능으로 예쁘게 만들 수 있다.

1. 윈도우 스타일에 WS_EX_LAYERED를 추가

2. 투명도 설정

SetWindowLong(hwnd, GWL_EXSTYLE,GetWindowLong(hwnd, GWL_EXSTYLE) | WS_EX_LAYERED);
SetLayeredWindowAttributes( 0, (255 * 30) / 100, LWA_ALPHA );

MFC8 에서는 SetLayeredWindowAttributes가 기본으로 include, link되지만
VC6 에선 user32.dll에서 직접 로드해야하고, 함수 기본형도 다르다.
VC6 에서는 아래와 같이 한다.

// 함수 선언
BOOL SetLayeredWindowAttributes(
    HWND hwnd,           // handle to the layered window
    COLORREF crKey,      // specifies the color key
    BYTE bAlpha,         // value for the blend function
    DWORD dwFlags        // action
);

// 상수 선언
#define WS_EX_LAYERED 0x00080000
#define LWA_ALPHA     0x00000002

// DLL에서 함수를 호출하기 위한 함수 선언
typedef BOOL(WINAPI *SLWA)(HWND, COLORREF, BYTE, DWORD);

// 함수포인터 선언
SLWA pSetLayeredWindowAttributes = NULL;

// DLL을 로드하여 함수에 대한 포인터를 가져옴
HINSTANCE hmodUSER32 = LoadLibrary("USER32.DLL");
pSetLayeredWindowAttributes =
(SLWA)GetProcAddress(hmodUSER32,"SetLayeredWindowAttributes");

HWND hwnd = this->m_hWnd; //다이얼로그의 핸들
// 다이알로그의 스타일 변경
SetWindowLong(hwnd, GWL_EXSTYLE,GetWindowLong(hwnd, GWL_EXSTYLE) | WS_EX_LAYERED);
// 다이알로그의 투명도를 30%로 변경
pSetLayeredWindowAttributes(hwnd, 0, (255 * 30) / 100, LWA_ALPHA);

[출처] [MFC] 투명한 다이알로그 |작성자 견우


이렇게 하면 ㅇㅋ
Posted by 배트
,
간접출처
http://overegoz.tistory.com/669

References

[1] http://4ellene.net/tt/1075


This revised trace support is backwards compatible with the old trace formatting and can be enabled by the following command:


$ns use-newtrace


This command should be called before the universal trace command $ns trace-all trace-fd. Primitive use-newtrace sets up new format for wireless tracing by setting a simulator variable called newTraceFormat. Currently this new trace support is available for wireless simulations only and shall be extended to rest of in the near future.




Event type : 이벤트

In the traces above, the first field (as in the older trace format) describes the type of event taking place at the node and can be one of the four types:

S : send / r : receive / d : drop / f : forward


General tag

The second field starting with "-t" may stand for time or global setting

-t : time / -t : * (global setting)


Node property tags

This field denotes the node properties like node-id, the level at which tracing is being done like agent, router or MAC. The tags start with a leading "-N" and are listed as below:

-Ni: node id

-Nx: node's x-coordinate

-Ny: node's y-coordinate

-Nz: node's z-coordinate

-Ne: node energy level

-Nl: trace level, such as AGT, RTR, MAC

-Nw: reason for the event. The different reasons for dropping a packet are given below:

"END" DROP_END_OF_SIMULATION

"COL" DROP_MAC_COLLISION

"DUP" DROP_MAC_DUPLICATE

"ERR" DROP_MAC_PACKET_ERROR

"RET" DROP_MAC_RETRY_COUNT_EXCEEDED

"STA" DROP_MAC_INVALID_STATE

"BSY" DROP_MAC_BUSY

"NRTE" DROP_RTR_NO_ROUTE i.e no route is available.

"LOOP" DROP_RTR_ROUTE_LOOP i.e there is a routing loop

"TTL" DROP_RTR_TTL i.e TTL has reached zero.

"TOUT" DROP_RTR_QTIMEOUT i.e packet has expired.

"CBK" DROP_RTR_MAC_CALLBACK

"IFQ" DROP_IFQ_QFULL i.e no buffer space in IFQ.

"ARP" DROP_IFQ_ARP_FULL i.e dropped by ARP

"OUT" DROP_OUTSIDE_SUBNET i.e dropped by base stations on receiving routing updates from nodes outside its domain.

Packet information at IP level

The tags for this field start with a leading "-I" and are listed along with their explanations as following:

-Is: source address.source port number

-Id: dest address.dest port number

-It: packet type

-Il: packet size

-If: flow id

-Ii: unique id

-Iv: ttl value

Next hop info

This field provides next hop info and the tag starts with a leading "-H".

-Hs: id for this node

-Hd: id for next hop towards the destination.

Packet info at MAC level

This field gives MAC layer information and starts with a leading "-M" as shown below:

-Ma: duration

-Md: dst's ethernet address

-Ms: src's ethernet address

-Mt: ethernet type

Packet info at "Application level"

The packet information at application level consists of the type of application like ARP, TCP, the type of adhoc routing protocol like DSDV, DSR, AODV etc being traced. This field consists of a leading "-P" and list of tags for different application is listed as below:

-P arp

Address Resolution Protocol. Details for ARP is given by the following tags:

-Po: ARP Request/Reply

-Pm: src mac address

-Ps: src address

-Pa: dst mac address

-Pd: dst address

-P dsr

This denotes the adhoc routing protocol called Dynamic source routing. Information on DSR is represented by the following tags:

-Pn: how many nodes traversed

-Pq: routing request flag

-Pi: route request sequence number

-Pp: routing reply flag

-Pl: reply length

-Pe: src of srcrouting->dst of the source routing

-Pw: error report flag ?

-Pm: number of errors

-Pc: report to whom

-Pb: link error from linka->linkb

-P cbr

Constant bit rate. Information about the CBR application is represented by the following tags:

-Pi: sequence number

-Pf: how many times this pkt was forwarded

-Po: optimal number of forwards

-P tcp

Information about TCP flow is given by the following subtags:

-Ps: seq number

-Pa: ack number

-Pf: how many times this pkt was forwarded

-Po: optimal number of forwards

This field is still under development and new tags shall be added for other applications as they get included along the way.


s -t 0.267662078 -Hs 0 -Hd -1 -Ni 0 -Nx 5.00 -Ny 2.00 -Nz 0.00 –Ne -1.000000 -Nl RTR -Nw --- -Ma 0 -Md 0 -Ms 0 -Mt 0 –Ii 20 -Is 0.255 -Id -1.255 –It


-S : 이벤트 ex) sent

-t 0.267662078 : 시간

-Hs 0 : 소스 노드(Hs) 0 에서

-Hd -1 : 목적지 노드(Hd) 1

-Ni 0 : 소스 노드 ID 는 0

-Nx 5.00 : x-co-ordinate는 5.00

-Ny 2.00 : s y-co-ordinate 은 2.00

-Nz 0.00 : z-co-ordinate은 0.00

–Ne -1.000000 : 에너지 레벨은 1.000000

-Nl RTR : 트레이스 레벨은 RTR

-Nw --- : 노드 이벤트는 없음

-Ma 0 : The MAC level information is given by duration (Ma) 0

-Md 0 : 목적지 이더넷 주소 (Md)0

-Ms 0 : 발신지 이더넷 주소(Ms)0

-Mt 0 : 이더넷 종류 0

–Ii 20 : The IP packet level information like packet id (Ii)

-Is 0.255 : 발신자 주소.발신자 포트번호

-Id -1.255 : 목적지 주소.목적지 포트번호

–It

Here, we see that a packet was sent (s) at time (t) 0.267662078 sec, 
from source node (Hs) 0 to destination node (Hd) 1.
The source node id (Ni) is 0, it's x-co-ordinate (Nx) is 5.00,
it's y-co-ordinate (Ny) is 2.00, it's z-co-ordinate (Nz) is 0.00,
it's energy level (Ne) is 1.000000, the trace level (Nl) is
RTR and the node event (Nw) is blank. The MAC level information is
given by duration (Ma) 0, destination Ethernet address (Md) 0,
the source Ethernet address (Ms) is 0 and Ethernet type (Mt) is 0.
The  IP packet level information like packet id (Ii), 
source address.source port number is given by (Is) while the destination address.
destination port number is (Id).
Posted by 배트
,
MAC_802_11: accessing MAC cache_ array out of range

이 에러가 날 경우에는
create-god으로 god 객체를 생성한다.
인자는 시뮬레이션 할 노드의 개수다.
또는 의도보다 많은 노드를 생성하지 않았나 검사한다. <- 본인이 이랬어요..

set god_ [create-god $val(nn)]
or
set god_ [create-god 4]
Posted by 배트
,
1. WinInet을 사용하는 경우
    InternetOpen에서 설정한다.
    OS(즉, Internet Explorer)에 설정된 프록시 설정을 그대로 사용할 수 있고.
    프로그램에서 독자적으로 프록시 설정을 할 수도 있다.

2. WinHTTP를 사용하는 경우
    SetProxy 메소드를 통해서 프록시 설정을 할 수 있다.
    WinInet과 마찬가지로 시스템 설정, 사용자 설정 둘 다 가능하다.

3. Internet Explorer 컨트롤을 사용하는 경우
    Proxy 설정을 별도로 하는 메소드나 방법을 찾지 못했다.
    시스템 설정만을 따르는 것 같다.

※ 시스템의 프록시 설정을 변경하는 방법
    1. Internet Explorer의 옵션에서 변경
    2. 레지스트리의 키를 수정 직접 수정
       Software\Microsoft\Windows\CurrentVersion\Internet Settings\ProxyServer
       Software\Microsoft\Windows\CurrentVersion\Internet Settings\ProxyEnable
       실행 중인 어플리케이션에 적용하기 위해선 아래 함수 콜이 필요하다.
       InternetSetOption(NULL, INTERNET_OPTION_SETTINGS_CHANGED, NULL, 0);
       InternetSetOption(NULL, INTERNET_OPTION_REFRESH, NULL, 0);
    3. WMI의 SetProxySetting API를 이용
       아마 레지스트리의 키를 직접 변경하는 것과 다를 바가 없을 듯

결론
Internet Explorer ActiveX를 사용하는 어플리케이션은
동시에 여러 어플리케이션을 실행하면서
각각 다른 프록시 설정을 하는 것이 어렵다.
다른 편법을 동원해야 할 듯 하다.

ps. 특정 어플리케이션에 강제로 프록시 세팅을 해주는 유틸리티를 본 것 같다.
     하지만 지금은 찾을 수도, 어떻게 동작하는 지도 모르겠다.
     프록시 서버 리스트, 자동으로 구성 같은 내용도 알아봐야 한다.


프록시 설정 자세히


[ 레지스트리 경로 ]
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings

[ 프록시 서버 사용(X) ]
    종류 : REG_DWORD
    ProxyEnable => 0x00000000(0) => 사용안할때
    ProxyEnable => 0x00000001(1) => 사용할때

[ 로컬 주소에 프록시 서버 사용 안함(B) ]
    종류 : REG_SZ
    ProxyOverride => <local> => 체크시 레지스트리에 생성됨
    비체크시에는 레지스트리에서 이름과 값이없어짐.
   
[ 프록시 서버명과 포트번호 ]
    종류 : REG_SZ
    ProxyServer => http=localhost:8000

인터넷 옵션에서 고급탭 설정 방법.
[ HTTP 1.1 설정 ]
         종류 : REG_DWORD
    프록시 연결을 통해 HTTP 1.1 사용
    ProxyHttp1.1 => 0x00000001(1) => 사용할때
    ProxyHttp1.1 => 0x00000000(0) => 사용안할때

    HTTP 1.1 사용
    EnableHttp1_1 => 0x00000001(1) => 사용할때
    EnableHttp1_1 => 0x00000000(0) => 사용안할때

출처 : 데비피아 C++ Q&A
Posted by 배트
,
사용자 삽입 이미지
Posted by 배트
,
사용자 삽입 이미지
Hidden node(terminal) problem
Wireless networking에서, AP와 통신이 가능한 다른 두 노드가 서로 통신이 불가능한 경우 발생한다.











Exposed node(terminal) problem

Wireless networking에서, 두 개의 이웃한 송신 노드가 서로 다른 수신 노드에게 전송을 시도할 때 서로 방해받는 현상. 이웃한 송신 노드 송신 노드 A가 다른 수신 노드 B에게 전송을 시도를 할 때, 이웃한 송신 노드 C가 A의 권외(out of range)인 수신 노드 D에게 이미 전송을 하고 있다면, A와 D는 권외임에도 불구하고 A의 전송은 방해를 받는다.
사용자 삽입 이미지












RTS/
CTS
Request to Send / Celar to Send
802.11에서, 송신을 원하는 노드는 RTS를 보내고, 수신 노드는 CTS로 회답하여 연결을 초기화한다.
RTS/CTS로 초기화가 되면 두 노드는 통신 가능으로 간주하여 전송을 시작하고(AP의 정보에 의존하지 않음, Hidden node problem 해결), RTS/CTS를 모두 수신한 이웃 노드는 전송을 방해 받지만, RTS/CTS 중 하나만 수신한 노드는 다른 노드와 전송이 가능하다.(Exposed node problem 해결)


이미지 출처 : 위키피디아
Posted by 배트
,

익히는 것

斷想 - Note 2008. 1. 23. 12:57

익히는 것에 대해서...

실상 어떤 기술의 '감'을 익히는 일에는 그리 많은 시간이 필요하지 않다. 특히나 이전 단계에서 머무른 시간이 길다면 다음 단계에서 '감'을 잡는 시간은 더 짧아지기 마련이다. 하지만 모든 단계를 충실히 성실히 밟아가는 것은 그다지 효율적이지 않다.

내 교수님께서 말씀하시기를, 한 분야에서 여러가지를 배우는 것은 마치 직소퍼즐을 짜맞추는 것과 같다고 하셨다. 지금은 이 퍼즐 조각과 저 퍼즐 조각의 관계를 모르지만, 퍼즐이 완성에 가까워질 수록 퍼즐의 완성된 모습을 알 수 있다는 것이다. 퍼즐 조각 하나에 몰입하는 것보다 큰 그림을 볼 수 있는 것이 중요하다는 말씀이었다.

그렇다면 다음에 익혀야 할 것을 재빠르게 파악하고 현재 단계에서 적절한 시간을 할애한 다음, 최적의 시기에 다음 단계로 넘어가는 지혜가 필요하다. 가르쳐주는 사람이 없는 경우에는 더더욱 이렇게 해야한다.

하지만 기초가 튼튼해야 다음 단계를 안정적으로 익힐 수 있기 때문에 바짝 가속할 때와 늦출 때를 잘 구분해야 한다. 특히 그림의 뎃생력 처럼 기초 중의 기초라고 부를 수 있는 것은 처음에도 단단히 익혀야하고, 그 후로도 계속 갈고 닦아야만 한다.

모든 면에서 계속 자신을 돌아보고, 점검하고, 계획을 세우고, 수정하고, 실천해야 한다.

Posted by 배트
,