Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 4 additions & 16 deletions snippets/cpp/VS_Snippets_CLR/Marshal/cpp/marshal.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
//Types:System.Runtime.InteropServices.Marshal
//<snippet1>
using namespace System;
Expand All @@ -14,7 +14,7 @@

int main()
{
//<snippet2>
//<snippet2>
// Demonstrate the use of public static fields of the Marshal
// class.
Console::WriteLine(
Expand All @@ -23,18 +23,8 @@
Marshal::SystemMaxDBCSCharSize);
//</snippet2>

//<snippet3>
// Demonstrate the use of the SizeOf method of the Marshal
// class.
Console::WriteLine("Number of bytes needed by a Point object: {0}",
Marshal::SizeOf(Point::typeid));
Point point;
Console::WriteLine("Number of bytes needed by a Point object: {0}",
Marshal::SizeOf(point));
//</snippet3>

//<snippet4>
// Demonstrate how to call GlobalAlloc and
// Demonstrate how to call GlobalAlloc and
// GlobalFree using the Marshal class.
IntPtr hglobal = Marshal::AllocHGlobal(100);
Marshal::FreeHGlobal(hglobal);
Expand All @@ -53,15 +43,13 @@

// This is a platform invoke prototype. SetLastError is true,
// which allows the GetLastWin32Error method of the Marshal class
// to work correctly.
// to work correctly.
[DllImport("Kernel32", ExactSpelling = true, SetLastError = true)]
extern bool CloseHandle(IntPtr h);
//</snippet5>

// This code produces the following output.
//
//
// SystemDefaultCharSize=2, SystemMaxDBCSCharSize=1
// Number of bytes needed by a Point object: 8
// Number of bytes needed by a Point object: 8
// CloseHandle call failed with an error code of: 6
//</snippet1>
77 changes: 0 additions & 77 deletions snippets/cpp/VS_Snippets_CLR/PtrToStructure/CPP/pts.cpp

This file was deleted.

This file was deleted.

19 changes: 0 additions & 19 deletions snippets/cpp/VS_Snippets_Remoting/HttpChannel/CPP/makefile

This file was deleted.

Loading
Loading