私はCで何かを書くのはまったく初めてです。バイナリ操作を実行するヘルパーDLL(C#から呼び出される)を書いています。'識別子"BitScanForward64"isundefined'エラーが発生します。32ビットバージョンが利用可能です。これは、Win32DLLを作成したためだと思います。
その後、64ビットバージョンは特定の64ビットDLL(新しいプロジェクトウィザードでは「一般」と想定)でのみ使用可能であり、32ビットと64ビットの別個のdllが必要になる可能性があることに気づきました。これは事実ですか、それともBitScanForwardとBitScanForward64の両方の組み込み関数を実行する単一のDLLを使用できますか?その場合、どのように作成しますか?
これが私の現在のコードです:
// C Functions.cpp : Defines the exported functions for the DLL application.
#include "stdafx.h"
//#include <intrin.h>
//#include <winnt.h>
int _stdcall LSB_i32(unsigned __int32 x)
{
DWORD result;
BitScanForward(&result, x);
return (int)result;
}
int _stdcall MSB_i32(unsigned __int32 x)
{
DWORD result;
BitScanReverse(&result, x);
return (int)result;
}
int _stdcall LSB_i64(unsigned __int64 x)
{
DWORD result;
BitScanForward64(&result, x);
return (int)result;
}
int _stdcall MSB_i64(unsigned __int64 x)
{
DWORD result;
BitScanReverse64(&result, x);
return (int)result;
}