Wednesday, November 12, 2008

C#, Managed C++ 참고 자료

C# 레퍼런스 모음.

C/C++ 을 하다가 C# 으로 추가 개발을 하려는 사람에게 꼭 필요한 것들을 모아봤음.
직접 해보면서 삽질한 내용임.

C# eBook
http://www.bestsoftware4download.com/software/t-free-c-school-ebook-download-llijghlw.html
http://www.pnasoft.com/archive/2008/01/11/pro-csharp-2008-and-the-net-3-5-platform-4th-edition.aspx

C++ / CLI, Managed C++ eBook
http://int6.net/ebook/Expert.Cpp.Cli.NET.pdf

C# memcpy (링크를 까먹어서 -_- 코드로 대체)


// copied from group.google.com
public object raw_deserialize_ex(byte[] rawdatas, Type anytype)
{
int rawsize = Marshal.SizeOf(anytype);
if (rawsize > rawdatas.Length)
return null;
GCHandle handle = GCHandle.Alloc(rawdatas, GCHandleType.Pinned);
IntPtr buffer = handle.AddrOfPinnedObject();
object retobj = Marshal.PtrToStructure(buffer, anytype);
handle.Free();
return retobj;
}

// copied from group.google.com
public byte[] raw_serialize_ex(object anything)
{
int rawsize = Marshal.SizeOf(anything);
byte[] rawdatas = new byte[rawsize];
GCHandle handle = GCHandle.Alloc(rawdatas, GCHandleType.Pinned);
IntPtr buffer = handle.AddrOfPinnedObject();
Marshal.StructureToPtr(anything, buffer, false);
handle.Free();
return rawdatas;
}


Block Copy
http://msdn.microsoft.com/en-us/library/system.buffer.blockcopy.aspx

Byte[] to String
System.Text.Encoding.UTF8.GetString(...);

String to Byte[]
ASCIIEncoding.UTF8.GetBytes(...);

[Managed C++] System::String^ <-> std::string
http://www.codeguru.com/forum/showthread.php?p=1722705#post1722705

UI Invoke (다른 Thread 에서 ui 를 업데이트 하려면 invoke 를 거쳐가야함.)
http://msdn.microsoft.com/en-us/library/system.windows.forms.form.invoke.aspx
i.e.) this.Invoke(new _set_btn_enable_delegate(_set_btn_enable));

Property Grid
http://msdn.microsoft.com/en-us/library/aa302326.aspx

XML Serializer
http://msdn.microsoft.com/en-us/library/system.xml.serialization.xmlserializer.aspx

CRC32, MD5, SHA1
http://www.vbaccelerator.com/home/net/code/Libraries/CRC32/article.asp
http://msdn.microsoft.com/en-us/library/system.security.cryptography.sha1cryptoserviceprovider.aspx

Native C++ <-> Unmanaged C++ <-> C#
http://sj21.wo.to/tt/483
http://sj21.wo.to/tt/484
http://blogs.msdn.com/junfeng/archive/2006/05/20/599434.aspx

Application 정보는 System.Application
Environment 정보는 System.Environment

다른 Application 실행시키려면
http://msdn.microsoft.com/en-us/library/system.diagnostics.processstartinfo.aspx


일단 이정도.

위의 내용만 잘 숙지해도, 기본적인 개발은 할 수 있음.

2 comments:

  1. 좋은 정보네요. 잘 쓰겠습니다.

    ReplyDelete
  2. 좋은 정보 감사합니다.

    ReplyDelete