extern "C" ブロックなしで C++ 関数を定義しています。C++ では関数をオーバーロードできる (つまり、さまざまな引数のセットを持つ多数の captureCamera() 関数を作成する) ことができるため、DLL 内の実際の関数名は異なります。これを確認するには、Visual Studio コマンド プロンプトを開き、バイナリ ディレクトリに移動して次を実行します。
dumpbin /exports YourDll.dll
次のようなものが得られます。
Dump of file debug\dll1.dll
File Type: DLL
Section contains the following exports for dll1.dll
00000000 characteristics
4FE8581B time date stamp Mon Jun 25 14:22:51 2012
0.00 version
1 ordinal base
1 number of functions
1 number of names
ordinal hint RVA name
1 0 00011087 ?captureCamera@@YAHAAH@Z = @ILT+130(?captureCamera@@YAHAAH@Z)
Summary
1000 .data
1000 .idata
2000 .rdata
1000 .reloc
1000 .rsrc
4000 .text
10000 .textbss
?captureCamera@@YAHAAH@Zは、指定した引数を実際にエンコードする修飾名です。
他の回答で述べたように、宣言に extern "C" を追加するだけです。
extern "C" __declspec(dllexport) int captureCamera(int& captureId)
{
...
}
dumpbin を再実行して、名前が正しいことを再確認できます。
Dump of file debug\dll1.dll
File Type: DLL
Section contains the following exports for dll1.dll
00000000 characteristics
4FE858FC time date stamp Mon Jun 25 14:26:36 2012
0.00 version
1 ordinal base
1 number of functions
1 number of names
ordinal hint RVA name
1 0 000110B4 captureCamera = @ILT+175(_captureCamera)
Summary
1000 .data
1000 .idata
2000 .rdata
1000 .reloc
1000 .rsrc
4000 .text
10000 .textbss