Skip to content

Instantly share code, notes, and snippets.

@aosoft
aosoft / AtlWindow.cpp
Last active August 27, 2022 17:07
AtlWindow.cpp
#define _ATL_NO_AUTOMATIC_NAMESPACE
#include <atlbase.h>
ATL::CAtlWinModule _Module;
#include <atlwin.h>
class Window : public ATL::CWindowImpl<Window>
{
public:
DECLARE_WND_CLASS(_T("AtlWindow"));
@aosoft
aosoft / MainUnityActivity.cs
Created December 6, 2020 07:52
MainUnityActivity.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Android.App;
using Android.Content;
using Android.Content.PM;
using Android.OS;
using Android.Runtime;
@aosoft
aosoft / MainActivity.cs
Created December 6, 2020 07:49
MainActivity.cs
using System;
using Android.App;
using Android.Content;
using Android.Graphics;
using Android.OS;
using Android.Runtime;
using Android.Support.V7.App;
using Android.Support.V7.Widget;
using Android.Views;
using Android.Widget;
@aosoft
aosoft / main.rs
Created September 18, 2020 16:49
Rust Representation / Function pointer
macro_rules! size_of {
($x:ty) => {
(stringify!($x), std::mem::size_of::<$x>())
};
}
pub enum EnumA<T> {
A(T),
B,
}
use std::ffi::c_void;
use std::ptr;
type Error = u32;
type FnMessageBox = extern "stdcall" fn(hWnd: *const c_void, lpText: *const u16, lpCaption: *const u16, uType: u32) -> i32;
#[link(name = "kernel32")]
#[no_mangle]
extern "stdcall" {
fn GetLastError() -> Error;
struct trait {
void **fnptrs;
};
struct rust_struct {
// data
};
struct trait_ref {
trait *t;
@aosoft
aosoft / Program.cs
Created March 2, 2020 16:43
ストリームからの MML コンパイル、曲ロードの API イメージ
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
namespace ConsoleApp1
{
class Program
{
/// <summary>