ごく基本的な質問には申し訳ありません。 UNCパスを文字列で置き換えたかっただけです。 CのためのUNCパスを有するこれらの行++接続は、完全に動作:「オブジェクト参照が非静的フィールド、メソッド、またはプロパティのために必要とされる」文字列でUNCパスを交換UNCパスを文字列で置き換えようとするとエラーが発生する
[DllImport(C:\\Users\\SJ\\Documents\\VS2015\\Projects\\P_01\\Debug\\EV_01.dll",
EntryPoint = "DDentry", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
public static extern void DDentry
(
[MarshalAs(UnmanagedType.SafeArray, SafeArraySubType = VarEnum.VT_BSTR)]
string[,] pArrayStr
);
がエラーを与える
あなたのアイデアをstring UNCpath = @"C:\\Users\\SJ\\Documents\\VS2015\\Projects\\P_01\\Debug\\EV_01.dll";
[DllImport(UNCpath,
EntryPoint = "DDentry", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
public static extern void DDentry
(
[MarshalAs(UnmanagedType.SafeArray, SafeArraySubType = VarEnum.VT_BSTR)]
string[,] pArrayStr
);
多くの感謝...
[変数値を持つカスタム属性をパラメータとして渡す]可能な複製(https://stackoverflow.com/questions/13125046/passing-a-custom-attribute-with-a-variable-value-as- a-parameter) – Diado