Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
Help us understand the problem. What is going on with this article?

vistaでvs2010 その3

概要

vistaで、visual studio 2010やってみた。
コマンドプロンプトで、C++をコンパイルしてみた。

コマンドプロンプトで、dllをコンパイル。

cl makedll.cpp /LD

サンプルコード

makedll.h

extern "C" __declspec(dllexport) int Tasu(int x, int y);

makedll.cpp

#include <windows.h>
#include "makedll.h"

BOOL APIENTRY DllMain(HANDLE hModule, DWORD ul_reason_for_call, LPVOID lpReserved) {
    switch (ul_reason_for_call)
    {
    case DLL_PROCESS_ATTACH:
    case DLL_THREAD_ATTACH:
    case DLL_THREAD_DETACH:
    case DLL_PROCESS_DETACH:
    break;
    }
    return TRUE;
}
int Tasu(int x, int y) {
    return x + y;
}




以上。

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away