'2021/07/08'에 해당되는 글 4건

  1. 2021.07.08 winform 자동으로 UI 늘리기
  2. 2021.07.08 winform MDI
  3. 2021.07.08 vs2019 sdi , mdi 프로젝트 생성하기
  4. 2021.07.08 gcc unsigned to signed upcast 테스트
Programming/c# & winform2021. 7. 8. 13:55

말이 애매한데..

창을 키우면 자동으로 내부 콤포넌트들이 자동으로 키워져 비율에 맞게 작동하는

UI를 제작하고 싶어서 찾아보는 중.

 

Dock을 Fill로 해주면 되는 건가?

[링크 : https://docs.microsoft.com/en-us/dotnet/desktop/winforms/controls/layout?view=netdesktop-5.0]

 

[링크 : https://cwkcw.tistory.com/166]

 

+

paint 함수를 재정의 해서 계산후 적용하는 것도 방법이군..

[링크 : https://stackoverflow.com/questions/40269285/c-sharp-changing-the-size-of-a-button-text]

'Programming > c# & winform' 카테고리의 다른 글

winform IsMdiContainer  (0) 2021.07.12
DataGridView  (0) 2021.07.12
winform 자동으로 UI 늘리기  (0) 2021.07.08
winform MDI  (0) 2021.07.08
winform 첨자(superscript/subscript)  (0) 2021.07.07
nuget RibbonWinForms  (0) 2021.07.06
Posted by 구차니

댓글을 달아 주세요

Programming/c# & winform2021. 7. 8. 13:37

MFC 말고 winform으로는 안되나 찾아보는데 IsMdiContainer 라는게 있대서 찾아보니 있긴하네?

아무튼.. 그렇다면 창 스타일로 지정되고

dialog based로 생성되어도 그 안에 MDI로 구성을 하는 스타일로 격하(?)되었다는 건가?

 

[링크 : https://docs.microsoft.com/.../how-to-create-mdi-parent-forms?view=netframeworkdesktop-4.8]

[링크 : https://docs.microsoft.com/.../how-to-create-mdi-child-forms?view=netframeworkdesktop-4.8]

[링크 : https://docs.microsoft.com/.../multiple-document-interface-mdi-applications?view=netframeworkdesktop-4.8]

 

'Programming > c# & winform' 카테고리의 다른 글

DataGridView  (0) 2021.07.12
winform 자동으로 UI 늘리기  (0) 2021.07.08
winform MDI  (0) 2021.07.08
winform 첨자(superscript/subscript)  (0) 2021.07.07
nuget RibbonWinForms  (0) 2021.07.06
ansi escape code  (0) 2021.05.24
Posted by 구차니

댓글을 달아 주세요

Programming/C Win32 MFC2021. 7. 8. 11:39

그냥해봤는데 내꺼에 설치된 패키지 중에는 SDI / MDI를 지원하는 패키지가 없었는지

부랴부랴 검색해서 추가중

[링크 : https://yyman.tistory.com/1357]

 

 

와와 이제 뜬다!!!!

 

흐으으으으음?! 컴파일러 뿐만 아니라 MFC 라이브러리가 별도로 필요한가?

이 프로젝트에는 MFC 라이브러리가 필요합니다. 사용되는 모든 도구 세트 및 아키텍처의 경우 Visual Studio 설치 관리자(개별 구성 요소 탭)에서 설치하세요.

[링크 : https://docs.microsoft.com/ko-kr/visualstudio/msbuild/errors/msb8041?view=vs-2019]

 

MFC로 검색해서 두개의 구성요소를 설치해야 한다.

  • 스펙터 완화를 지원하는 최신 v000 빌드 도구용 C++ MFC(x86 및 x64)
  • 최신 v000 빌드 도구용 C++ MFC(x86 및 x64)

 

스펙터는 설치안하고 최신 빌드 도구용만 까니 라이브러리 없다고 실행안되는거 보면.. 스펙터는 핑계고(?)

번역상에 문제로 스펙터 완화를 지원하는... 건 실제로는 runtime library 아닌가 의심된다.

 

아무튼 프로젝트 생성해서 빌드만 겨우 했네 휴..

근데 SDI로 작성하긴 했는데 왜이렇게 데모 프로젝트가 현란해? 무슨 Visual Studio 인 줄 ㄷㄷ

[링크 : https://yyman.tistory.com/1367]

'Programming > C Win32 MFC' 카테고리의 다른 글

fopen exclusivly  (0) 2021.07.09
vs2019 sdi , mdi 프로젝트 생성하기  (0) 2021.07.08
vkey win32 / linux  (0) 2021.04.30
strptime  (0) 2021.02.17
while(-1) 이 될까?  (0) 2019.05.24
c언어용 JSON 라이브러리 목록  (0) 2018.10.23
Posted by 구차니

댓글을 달아 주세요

프로그램 사용/gcc2021. 7. 8. 10:40

귀찮으니 날로먹는 코딩으로 테스트

$ cat 1.c
#include <stdio.h>

void main()
{
        unsigned char a = 0xFF;
        char b =a;
        short c = a;
        short d = (char)a;
        short e = (int)a;

        int f = a;
        int g = (int)a;
        int h = (int)(char)a;

        printf("a %d\n",a);
        printf("a %d\n",(int)a);
        printf("a %d\n",(char)a);
        printf("b %d\n",b);
        printf("c %d\n",c);
        printf("d %d\n",d);
        printf("e %d\n",e);
        printf("f %d\n",f);
        printf("g %d\n",g);
        printf("h %d\n",h);
}

 

컴파일러 버전과 아키텍쳐, 그리고 결과인데... 머냐..?!?!

$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/9/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none:hsa
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 9.3.0-17ubuntu1~20.04' --with-bugurl=file:///usr/share/doc/gcc-9/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++,gm2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-9 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none=/build/gcc-9-HskZEa/gcc-9-9.3.0/debian/tmp-nvptx/usr,hsa --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 9.3.0 (Ubuntu 9.3.0-17ubuntu1~20.04)
$ arm-linux-gnueabihf-gcc -v
Using built-in specs.
COLLECT_GCC=arm-linux-gnueabihf-gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc-cross/arm-linux-gnueabihf/7/lto-wrapper
Target: arm-linux-gnueabihf
Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro 7.5.0-3ubuntu1~18.04' --with-bugurl=file:///usr/share/doc/gcc-7/README.Bugs --enable-languages=c,ada,c++,go,d,fortran,objc,obj-c++ --prefix=/usr --with-gcc-major-version-only --program-suffix=-7 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-libitm --disable-libquadmath --disable-libquadmath-support --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib --enable-multiarch --enable-multilib --disable-sjlj-exceptions --with-arch=armv7-a --with-fpu=vfpv3-d16 --with-float=hard --with-mode=thumb --disable-werror --enable-multilib --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=arm-linux-gnueabihf --program-prefix=arm-linux-gnueabihf- --includedir=/usr/arm-linux-gnueabihf/include
Thread model: posix
gcc version 7.5.0 (Ubuntu/Linaro 7.5.0-3ubuntu1~18.04)
$ ./1
a 255
a 255
a -1
b -1
c 255
d -1
e 255
f 255
g 255
h -1
# /mnt/1
a 255
a 255
a 255
b 255
c 255
d 255
e 255
f 255
g 255

 

라즈베리 파이 4에서 시도. arm 아키텍쳐용 컴파일러의 특성인가?

$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/aarch64-linux-gnu/8/lto-wrapper
Target: aarch64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian 8.3.0-6' --with-bugurl=file:///usr/share/doc/gcc-8/README.Bugs --enable-languages=c,ada,c++,go,d,fortran,objc,obj-c++ --prefix=/usr --with-gcc-major-version-only --program-suffix=-8 --program-prefix=aarch64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-bootstrap --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-libquadmath --disable-libquadmath-support --enable-plugin --enable-default-pie --with-system-zlib --disable-libphobos --enable-multiarch --enable-fix-cortex-a53-843419 --disable-werror --enable-checking=release --build=aarch64-linux-gnu --host=aarch64-linux-gnu --target=aarch64-linux-gnu
Thread model: posix
gcc version 8.3.0 (Debian 8.3.0-6)
$ ./1
a 255
a 255
a 255
b 255
c 255
d 255
e 255
f 255
g 255
h 255

 

+

두개중에 하나만 주면 되는진 모르겠지만, 둘 다 주거나 -fsigned-char 만 주어도 결과가 -1로 나오긴 한다.

원문으로 보니 --signed-chars는 RVCT 컴파일러를 위한 옵션인 듯.

The ANSI C standard specifies a range for both signed (at least -127 to +127) and unsigned (at least 0 to 255) chars. Simple chars are not specifically defined and it is compiler dependent whether they are signed or unsigned. Although the ARM architecture has the LDRSB instruction, that loads a signed byte into a 32-bit register with sign extension, the earliest versions of the architecture did not. It made sense at the time for the compiler to treat simple chars as unsigned, whereas on the x86 simple chars are, by default, treated as signed.
One workaround for users of GCC is to use the -fsigned-char command line switch or --signed-chars for RVCT, that forces all chars to become signed, but a better practice is to write portable code by declaring char variables appropriately. Unsigned char must be used for accessing memory as a block of bytes or for small unsigned integers. Signed char must be used for small signed integers and simple char must be used only for ASCII characters and strings. In fact, on an ARM core, it is usually better to use ints rather than chars, even for small values, for performance reasons. You can read more on this in Optimizing Code to Run on ARM Processors.

[링크 : https://developer.arm.com/.../Miscellaneous-C-porting-issues/unsigned-char-and-signed-char]

 

LDRSB (Thumb*) - Load Register Signed Byte

[링크 : http://qcd.phys.cmu.edu/QCDcluster/intel/vtune/reference/LDRSB_(Thumb).htm]

 

LDRB - Load Register Byte

[링크 : http://qcd.phys.cmu.edu/QCDcluster/intel/vtune/reference/INST_LDRB.htm]

 

char -> signed char: -fsigned-char == -fno-unsigned-char
char -> unsigned char: -funsigned-char == -fno-signed-char

[링크 : https://jooojub.github.io/gcc-options-fsigned-char/]

 

-fsigned-char
Let the type char be signed, like signed char.
Note that this is equivalent to -fno-unsigned-char, which is the negative form of -funsigned-char. Likewise, the option -fno-signed-char is equivalent to -funsigned-char.

-funsigned-char
Let the type char be unsigned, like unsigned char.
Each kind of machine has a default for what char should be. It is either like unsigned char by default or like signed char by default.
Ideally, a portable program should always use signed char or unsigned char when it depends on the signedness of an object. But many programs have been written to use plain char and expect it to be signed, or expect it to be unsigned, depending on the machines they were written for. This option, and its inverse, let you make such a program work with the opposite default.
The type char is always a distinct type from each of signed char or unsigned char, even though its behavior is always just like one of those two.

[링크 : https://gcc.gnu.org/onlinedocs/gcc/C-Dialect-Options.html]

 

+

2021.07.09

으잉? singed char로 하면 되긴 한다. char가 signed 아니었어?!

'프로그램 사용 > gcc' 카테고리의 다른 글

gcc unsigned to signed upcast 테스트  (0) 2021.07.08
gcc vectorized loop  (0) 2021.06.30
gcc unsigned to signed cast  (0) 2021.06.22
gcc %p (nil)  (0) 2021.05.07
gcc -D 옵션 인자를 printf로 출력하기  (0) 2021.04.08
Auto-vectorization in GCC  (0) 2021.03.25
Posted by 구차니

댓글을 달아 주세요