You could open the SNL file in any text editor (Notepad, etc.) and simpley change the project path there.

'Development > visual studio' 카테고리의 다른 글

[LINK에러시 가능한 해결법 한 가지]  (0) 2012.08.20
[MFC 트레이아이콘으로 만들기]  (0) 2012.08.19
[error C2146: 구문 오류]  (0) 2012.08.19
[MFC 트레이아이콘으로 만들기]  (0) 2012.08.18
[error LNK2005]  (1) 2012.08.18
Posted by cyj4369
,

/FORCE 옵션을 사용하면 링커에서는 기호가 참조되어 있지만 정의되어 있지 않은 경우나 여러 번 정의되어 있는 경우에도 올바른 .exe 파일 또는 DLL을 만듭니다.

/FORCE 옵션에는 다음과 같이 선택적 인수를 사용할 수 있습니다.

  • /FORCE:MULTIPLE을 사용하면 LINK에서 기호에 대한 정의를 하나 이상 찾더라도 출력 파일을 만들 수 있습니다.

  • /FORCE:UNRESOLVED를 사용하면 LINK에서 정의되지 않은 기호를 찾더라도 출력 파일을 만들 수 있습니다. 진입점 기호가 확인되지 않으면 /FORCE:UNRESOLVED는 무시됩니다.

/FORCE에 인수를 사용하지 않으면 MULTIPLE과 UNRESOLVED를 모두 의미합니다.

이 옵션을 사용하여 만든 파일이 예상대로 실행되지 않을 수도 있습니다. 링커에서는 /FORCE 옵션이 지정된 경우 증분 링크를 수행하지 않기 때문입니다.

/clr를 사용하여 모듈을 컴파일하는 경우 /FORCE를 지정해도 이미지가 생성되지 않습니다.

Posted by cyj4369
,

주석을 제거하면 트레이아이콘이 나오고 주석을 넣으면 아무 창도 안뜨고 백그라운드에서 실행



//NOTIFYICONDATA  nid;

// nid.cbSize = sizeof(nid);

// nid.hWnd = m_hWnd; // 메인윈도우핸들

// nid.uID = IDR_MAINFRAME;  // 아이콘리소스ID

// nid.uFlags = NIF_MESSAGE | NIF_ICON | NIF_TIP; // 플래그설정

// nid.hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME); // 아이콘로드

// CString Title = _T("초보자를위한작곡프로그램");   // 트레이위에커서가올라갔을때표시되는프로그램명

// lstrcpy(nid.szTip, Title); 

// Shell_NotifyIcon(NIM_ADD, &nid);


ModifyStyleEx (WS_EX_APPWINDOW, WS_EX_TOOLWINDOW);


MoveWindow(-100,-100,0,0,1);



======아래는 퍼온글======


음....

프로그램 시작과 동시에 다이얼로그를 안보이게 할때면,(ShowWindow(SW_HIDE);를 쓰던지 우주 넘어로 날려버리던지(MoveWindow(0,0,0,0,1);)  그 와 동시에 작업표시줄에서도 그 다이얼로그의 흔적을 없애햐 한다..

 

너무너무 쉬운작업

그냥 초기화 함수에서

ModifyStyleEx(WS_EX_TOOLWINDOW, WS_EX_APPWINDOW);

호출하면 끗!

(혹시 안되면)

DWORD dwStyle = GetWindowLong(m_hWnd, GWL_EXSTYLE);

dwStyle &= ~WS_EX_APPWINDOW;
dwStyle |= WS_EX_TOOLWINDOW; 

SetWindowLong(m_hWnd, GWL_EXSTYLE, dwStyle);
(이거 사용ㅋ)

 

설명하자면,

함수의 원형은

BOOL ModifyStyleEx(
   DWORD dwRemove,   //제거할 항목
   DWORD dwAdd,      //추가할 항목
   UINT nFlags = 0 
);

이렇게 된다..

속에 들어갈 윈도우 속성 인자들은

아래와 같고..ㅋ

  • WS_EX_ACCEPTFILES   Specifies that a window created with this style accepts drag-and-drop files.
  • WS_EX_APPWINDOW   Forces a top-level window onto the taskbar when the window is visible.
  • WS_EX_CLIENTEDGE   Specifies that a window has a 3D look — that is, a border with a sunken edge.
  • WS_EX_CONTEXTHELP   Includes a question mark in the title bar of the window. When the user clicks the question mark, the cursor changes to a question mark with a pointer. If the user then clicks a child window, the child receives a WM_HELP message.
  • WS_EX_CONTROLPARENT   Allows the user to navigate among the child windows of the window by using the TAB key.
  • WS_EX_DLGMODALFRAME   Designates a window with a double border that may (optionally) be created with a title bar when you specify the WS_CAPTION style flag in the dwStyle parameter.
  • WS_EX_LEFT   Gives window generic left-aligned properties. This is the default.
  • WS_EX_LEFTSCROLLBAR   Places a vertical scroll bar to the left of the client area.
  • WS_EX_LTRREADING   Displays the window text using left-to-right reading order properties. This is the default.
  • WS_EX_MDICHILD   Creates an MDI child window.
  • WS_EX_NOPARENTNOTIFY   Specifies that a child window created with this style will not send theWM_PARENTNOTIFY message to its parent window when the child window is created or destroyed.
  • WS_EX_OVERLAPPEDWINDOW   Combines the WS_EX_CLIENTEDGE and WS_EX_WINDOWEDGE styles
  • WS_EX_PALETTEWINDOW   Combines the WS_EX_WINDOWEDGE and WS_EX_TOPMOST styles.
  • WS_EX_RIGHT   Gives a window generic right-aligned properties. This depends on the window class.
  • WS_EX_RIGHTSCROLLBAR   Places a vertical scroll bar (if present) to the right of the client area. This is the default.
  • WS_EX_RTLREADING   Displays the window text using right-to-left reading order properties.
  • WS_EX_STATICEDGE   Creates a window with a three-dimensional border style intended to be used for items that do not accept user input.
  • WS_EX_TOOLWINDOW   Creates a tool window, which is a window intended to be used as a floating toolbar. A tool window has a title bar that is shorter than a normal title bar, and the window title is drawn using a smaller font. A tool window does not appear in the task bar or in the window that appears when the user presses ALT+TAB.
  • WS_EX_TOPMOST   Specifies that a window created with this style should be placed above all nontopmost windows and stay above them even when the window is deactivated. An application can use the SetWindowPosmember function to add or remove this attribute.
  • WS_EX_TRANSPARENT   Specifies that a window created with this style is to be transparent. That is, any windows that are beneath the window are not obscured by the window. A window created with this style receivesWM_PAINT messages only after all sibling windows beneath it have been updated.
  • WS_EX_WINDOWEDGE   Specifies that a window has a border with a raised edge.


그러나...

중요한건 이게 아니었다능..

나는 작업표시줄을 없애야 할땐, ModifyStyleEx(WS_EX_TOOLWINDOW, WS_EX_APPWINDOW); 이렇게 쓰는걸 외우고만 써서..

다시 생성할라니깐, 생각이 안나더라능...ㅡ.ㅡㅋ

 

난 왜이리 멍청한가 하는 자괴감과, 한심함이 멈먹이 된 바보인증 후에(어떻게 해야 하나..고민한지 5분후에..)

ModifyStyleEx( WS_EX_TOOLWINDOW,0 ); 

그냥 이렇게 쓰면, 다시 생겨난다...

당연한거....ㅡ.ㅡㅋ 속성을 제거 했으니, 다시 살리면 되잖아..ㅡ.ㅡㅋ

 

교훈..도대체 뭐하는 함수인지는 알고서나 함수를 쓰자..제길

Posted by cyj4369
,

선언 하는 헤더 파일들 순서가 바뀌어 있어서 발생 할 수 있다.

다음과 같이 처리해 준다.


//오류 발생

#include <winioctl.h>

#include "stdafx.h"

 

//정상 동작

#include "stdafx.h"

#include <winioctl.h>

'Development > visual studio' 카테고리의 다른 글

[LINK에러시 가능한 해결법 한 가지]  (0) 2012.08.20
[MFC 트레이아이콘으로 만들기]  (0) 2012.08.19
[MFC 트레이아이콘으로 만들기]  (0) 2012.08.18
[error LNK2005]  (1) 2012.08.18
[fatal error LNK1169]  (0) 2012.08.18
Posted by cyj4369
,



'Development > visual studio' 카테고리의 다른 글

[MFC 트레이아이콘으로 만들기]  (0) 2012.08.19
[error C2146: 구문 오류]  (0) 2012.08.19
[error LNK2005]  (1) 2012.08.18
[fatal error LNK1169]  (0) 2012.08.18
[MS-SQL Server 2008 R2 (2010. 12월 기준 최신버전) 설치]  (0) 2011.11.03
Posted by cyj4369
,

증상 1.

 

이런 에러가 나온건.. CRT때문이라고 그러는데.. ATL이나 MFC를 사용하게되면
msvcrtd에서 이미 선언되었기때문에 그런거란다...

 

해결방법은 간단하다...
Project Setting에가서 Link탭에 Input으로 가면 ignore에가서 
LIBCMT.lib만 넣어주면된다...

----------------------------------------------------------------------------
LIBCMT.lib(crt0dat.obj) : error LNK2005: _exit already defined in msvcrtd.lib(MSVCRTD.dll)
LIBCMT.lib(crt0dat.obj) : error LNK2005: __exit already defined in msvcrtd.lib(MSVCRTD.dll)
LIBCMT.lib(winxfltr.obj) : error LNK2005: __XcptFilter already defined in msvcrtd.lib(MSVCRTD.dll)
LIBCMT.lib(atox.obj) : error LNK2005: _atoi already defined in msvcrtd.lib(MSVCRTD.dll)
LIBCMT.lib(getenv.obj) : error LNK2005: _getenv already defined in msvcrtd.lib(MSVCRTD.dll)
LIBCMT.lib(crt0init.obj) : error LNK2005: ___xc_z already defined in msvcrtd.lib(cinitexe.obj)
LIBCMT.lib(crt0init.obj) : error LNK2005: ___xc_a already defined in msvcrtd.lib(cinitexe.obj)
LIBCMT.lib(crt0init.obj) : error LNK2005: ___xi_z already defined in msvcrtd.lib(cinitexe.obj)
LIBCMT.lib(crt0init.obj) : error LNK2005: ___xi_a already defined in msvcrtd.lib(cinitexe.obj)
LIBCMT.lib(strcat.obj) : error LNK2005: _strcpy already defined in msvcrtd.lib(MSVCRTD.dll)
msvcrtd.lib(MSVCRTD.dll) : error LNK2005: __strdup already defined in LIBCMT.lib(strdup.obj)
msvcrtd.lib(MSVCRTD.dll) : error LNK2005: __setmbcp already defined in LIBCMT.lib(mbctype.obj)
LIBCMT.lib(crt0dat.obj) : warning LNK4006: _exit already defined in msvcrtd.lib(MSVCRTD.dll); second definition ignored
LIBCMT.lib(crt0dat.obj) : warning LNK4006: __exit already defined in msvcrtd.lib(MSVCRTD.dll); second definition ignored
LIBCMT.lib(winxfltr.obj) : warning LNK4006: __XcptFilter already defined in msvcrtd.lib(MSVCRTD.dll); second definition ignored
LIBCMT.lib(atox.obj) : warning LNK4006: _atoi already defined in msvcrtd.lib(MSVCRTD.dll); second definition ignored
LIBCMT.lib(getenv.obj) : warning LNK4006: _getenv already defined in msvcrtd.lib(MSVCRTD.dll); second definition ignored
LIBCMT.lib(crt0init.obj) : warning LNK4006: ___xc_z already defined in msvcrtd.lib(cinitexe.obj); second definition ignored
LIBCMT.lib(crt0init.obj) : warning LNK4006: ___xc_a already defined in msvcrtd.lib(cinitexe.obj); second definition ignored
LIBCMT.lib(crt0init.obj) : warning LNK4006: ___xi_z already defined in msvcrtd.lib(cinitexe.obj); second definition ignored
LIBCMT.lib(crt0init.obj) : warning LNK4006: ___xi_a already defined in msvcrtd.lib(cinitexe.obj); second definition ignored
LIBCMT.lib(strcat.obj) : warning LNK4006: _strcpy already defined in msvcrtd.lib(MSVCRTD.dll); second definition ignored
msvcrtd.lib(MSVCRTD.dll) : warning LNK4006: __strdup already defined in LIBCMT.lib(strdup.obj); second definition ignored
msvcrtd.lib(MSVCRTD.dll) : warning LNK4006: __setmbcp already defined in LIBCMT.lib(mbctype.obj); second definition ignored
Creating library Debug/RealImageConvert.lib and object Debug/RealImageConvert.exp
LINK : warning LNK4098: defaultlib "msvcrtd.lib" conflicts with use of other libs; use /NODEFAULTLIB:library
LINK : warning LNK4098: defaultlib "LIBCMT" conflicts with use of other libs; use /NODEFAULTLIB:library
LIBCMT.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
Debug/RealImageConvert.exe : fatal error LNK1120: 1 unresolved externals

출처 : http://kudak.egloos.com/

 

----------------------------------------------------------------------------

LIBC.lib(crt0init.obj) : error LNK2005: ___xc_z already defined in msvcrtd.lib(cinitexe.obj)
LIBC.lib(crt0init.obj) : error LNK2005: ___xc_a already defined in msvcrtd.lib(cinitexe.obj)
LIBC.lib(crt0init.obj) : error LNK2005: ___xi_z already defined in msvcrtd.lib(cinitexe.obj)
LIBC.lib(crt0init.obj) : error LNK2005: ___xi_a already defined in msvcrtd.lib(cinitexe.obj)
LIBC.lib(atox.obj) : error LNK2005: _atoi already defined in msvcrtd.lib(MSVCRTD.dll)
LIBC.lib(strtol.obj) : error LNK2005: _strtoul already defined in msvcrtd.lib(MSVCRTD.dll)
LIBC.lib(strcat.obj) : error LNK2005: _strcpy already defined in msvcrtd.lib(MSVCRTD.dll)
LIBC.lib(crt0init.obj) : warning LNK4006: ___xc_z already defined in msvcrtd.lib(cinitexe.obj); second definition ignored
LIBC.lib(crt0init.obj) : warning LNK4006: ___xc_a already defined in msvcrtd.lib(cinitexe.obj); second definition ignored
LIBC.lib(crt0init.obj) : warning LNK4006: ___xi_z already defined in msvcrtd.lib(cinitexe.obj); second definition ignored
LIBC.lib(crt0init.obj) : warning LNK4006: ___xi_a already defined in msvcrtd.lib(cinitexe.obj); second definition ignored
LIBC.lib(atox.obj) : warning LNK4006: _atoi already defined in msvcrtd.lib(MSVCRTD.dll); second definition ignored
LIBC.lib(strtol.obj) : warning LNK4006: _strtoul already defined in msvcrtd.lib(MSVCRTD.dll); second definition ignored
LIBC.lib(strcat.obj) : warning LNK4006: _strcpy already defined in msvcrtd.lib(MSVCRTD.dll); second definition ignored
   Creating library Debug/SCID.lib and object Debug/SCID.exp
LINK : warning LNK4098: defaultlib "msvcrtd.lib" conflicts with use of other libs; use /NODEFAULTLIB:library
LINK : warning LNK4098: defaultlib "LIBC" conflicts with use of other libs; use /NODEFAULTLIB:library
LIBC.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
D:\Projects\sf\ServiceServerDialog\Debug\Services\SCID\1.0\SCID.dll : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.

----------------------------------------------------------------------------

내경우에는 앞에 충돌나는 라이브러리가 달라서 LIBC.lib를 제외시켜 주었다

 

증상 2.

 

내가 작성한 함수인데도 에러가 났을경우에

 

1. 헤더 파일에 선언과 정의를 동시에 할때 발생 할 수 있다. obj 링크 중복!!

해결법1.

( 프로젝트 속성 - 링커 - 명령줄 - /FORCE:MULTIPLE 입력 ) 무시하기-_-..

less..

/FORCE:[MULTIPLE|UNRESOLVED]

/FORCE 옵션을 사용하면 링커에서는 기호가 참조되어 있지만 정의되어 있지 않은 경우나 여러 번 정의되어 있는 경우에도 올바른 .exe 파일 또는 DLL을 만듭니다.

/FORCE 옵션에는 다음과 같이 선택적 인수를 사용할 수 있습니다.

  • /FORCE:MULTIPLE을 사용하면 LINK에서 기호에 대한 정의를 하나 이상 찾더라도 출력 파일을 만들 수 있습니다.
  • /FORCE:UNRESOLVED를 사용하면 LINK에서 정의되지 않은 기호를 찾더라도 출력 파일을 만들 수 있습니다. 진입점 기호가 확인되지 않으면 /FORCE:UNRESOLVED는 무시됩니다.

/FORCE에 인수를 사용하지 않으면 MULTIPLE과 UNRESOLVED를 모두 의미합니다.

이 옵션을 사용하여 만든 파일이 예상대로 실행되지 않을 수도 있습니다. 링커에서는 /FORCE 옵션이 지정된 경우 증분 링크를 수행하지 않기 때문입니다.

/clr를 사용하여 모듈을 컴파일하는 경우 /FORCE를 지정해도 이미지가 생성되지 않습니다.

Visual Studio 개발 환경에서 이 링커 옵션을 설정하려면

  1. 프로젝트의 속성 페이지 대화 상자를 엽니다.
  2. 링커 폴더를 클릭합니다.
  3. 명령줄 속성 페이지를 클릭합니다.
  4. 추가 옵션 상자에 옵션을 입력합니다.

http://msdn2.microsoft.com/ko-kr/library/72zdcz6f(VS.80).aspx

 

해결법2.

헤더파일에 선언을 소스파일에 정의를 나누면 댄다.

 

해결법3.

헤더파일에 있는 함수를 inline 예약어를 붙여준다.



또 다른 원인


1.링크하는 모든 라이브러리들을 디버그 모드 또는 릴리즈 모드로 통일시키지 않았거나 
2.런타임 라이브러리가 일치하지 않아서 생기는 경우가 대부분입니다. 

예를 들어, 작업중인 프로젝트는 릴리즈인데 디버그 모드로 컴파일된 라이브러리를 링크하는 경우, 
작업중인 프로젝트는 싱글 쓰레드인데 멀티 쓰레드로 컴파일된 라이브러리를 링크하는 경우, 
두가지 경우가 뒤섞인 경우가 있을 수 있겠습니다. 

간혹 위에서처럼 특정 라이브러리 무시 옵션을 주고 링크할 수는 있으나 
임시 방편일 뿐입니다. 
무시 옵션없이도 깨끗이 링크되어야 합니다. 
그렇지 않으면 나중에 문제가 발생할 수 있습니다. 
링크하는 라이브러리와 현재 작업중인 프로젝트 간의 설정(빌드 모드, 런타임라이브러리)이 일치하는 지 꼼꼼히 살펴보시기 바랍니다.


http://www.gpgstudy.com/forum/viewtopic.php?p=24947


또 다른 원인


MFC 공유 라이브러리 사용, MFC 정적 라이브러리 사용



또 다른 원인

Visual C++에서 CRT 라이브러리와 MFC 라이브러리가 잘못된 순서로 링크되면 LNK2005 오류가 발생

Posted by cyj4369
,

프로젝트 속성 -> 링커 ->명령줄 -> 하단에 추가옵션


/FORCE:multiple


Posted by cyj4369
,

1. www.microsoft.com/express 접속 (다음과 같이 창이 뜹니다.)

 

 

 

2. web 탭을 선택합니다.

 

 

3. 보라색으로 된 Install 버튼 클릭 (2번 화면에도 보입니다.~~)

 

 

4. 웹플랫폼 설치 관리자 2.0 창 실행 (Install을 클릭하여 다운 받은 wpilauncher_n.exe 더블클릭하여 실행)

 

5. 새로운기능에 있는 전체 선택(본인의 취향에 따라 설치하실 것만 하면 되지만 저는 전체 선택하여 인스톨 합니다.)

 

 

6. 설치 클릭(5번 그림에 설치 보이시지요??)

 

7. SQL Server Express 설치계획 감지..

 - 혼합 모드 인증(응용 프로그램 개발 권장)  선택 (XP는 있었지만, Vista는 없더군요)

 

 

 

8. 암호는 설정하되 3가지 이상(영소,영대,숫자,특문 중 3개를 적용) 하여 설정한다.

비밀번호는 앞으로도 로긴할때마다 자주 쓰이므로 비밀번호 대충적지 마시고 혼합해서 적으시길 권장합니다.

 

 

 

그 후에 설치가 진행 됩니다.(설치 시간이 꽤 깁니다..)

 

 

 

9. 설치도중 메시지가 뜨면 재시작 하세요~ (재부팅후에 알아서 자동 설치됩니다.)

이렇게 한 3번정도를 해주셔야 됩니다.(설치할때 은근히 시간이 좀 길어요)

 

 

 

10. 설치 후 데이터베이스 -> 사용자지정 에서 웹플랫폼 데이터베이스 사용자 지정에 체크항목 중 3,4번째 선택

 



 

SQL Server 2008 R2 Management Studio Express 와 Management Objects(영어) 를 설치하면 저희는 MS-SQL Server 2008 R2가 전부 다 설치되어서 다음과 같은 메시지가 뜹니다. 이제 정상적으로 나머지 세부 IP주소와 방화벽 설정만 해주시면 됩니다.

 

 

 

 

11. 설치 완료 후 확인할 것

- Microsoft SQL Server 2008 R2 구성도구 폴더 안에 구성관리자가 있는지 확인

- Microsoft SQL Server 2008 R2

 

SQL Server Configuration 클릭 하여 다음과 같이 설정합니다.

 

 

12. SQL Server 구성관리자 -> SQLEXPRESS에 대한 프로토콜 공유 메모리, 명명된파이프, TCP/IP 사용

VIA제외하고 나머지는 사용으로 하되 TCP/IP는 다음과 같이 셋팅해주세요 TCP 포트는 1433 입니다.

 

 

 

 

설정뒤에 다음과 같이 다시 시작을 꼭 해주셔야 됩니다.

 

 

13. Windows 방화벽에 포트추가(설정은 스샷참조)

 

15. 방화벽설정후 다시 시작합니다.

 

16. 자신의 아이피를 서버 이름에 입력후 연결

- 아이피 보는 법은 시작 -> 실행 -> cmd 입력 후 명령 프롬프트창이 뜨면 ipconfig 를 입력하세요

(혹시나 없는 경우에는 보조프로그램 -> 명령 프롬프트가 있는지 확인해주세요~! XP 기준입니다.)

 

앗!! 잠깐만요

 

간혹가다 cmd  -> ipconfig해도 다음 그림과 같이 안되는 경우가 있습니다.

 

 

 

이럴떄는 기본적으로 ipconfig 가 깔려있는 폴더 c:\windows\system32 로 들어가셔서 해주시면 됩니다.

 


자신의 아이피 주소를 확인후에 설치가 된 SSMS에 들어가셔서 서버이름에 아이피와 앞서설정했던

로그인 아이디 암호를 적어주시면 됩니다.~! 밑에와 위에 IP가 다른 이유는 서로 다른 환경에서 하였으므로

다름을 밝힙니다. IP는 보안상 가렸습니다 양해바랍니다^^



'Development > visual studio' 카테고리의 다른 글

[MFC 트레이아이콘으로 만들기]  (0) 2012.08.19
[error C2146: 구문 오류]  (0) 2012.08.19
[MFC 트레이아이콘으로 만들기]  (0) 2012.08.18
[error LNK2005]  (1) 2012.08.18
[fatal error LNK1169]  (0) 2012.08.18
Posted by cyj4369
,