Hi,
i'm trying to get IDBDataInitiali ze.GetInitializ ationString working.
Initially i tried
[return:MarshalA s(UnmanagedType .LPWStr)]
string GetInitializati onString(
[In, MarshalAs(Unman agedType.Interf ace)] object pDataSource,
[In] byte fIncludePasswor d
);
Having successfully got the dialogue box with
object provider = null;
provider = promptInitializ e.PromptDataSou rce(IntPtr.Zero , hwnd,
(Int32)
options, 0, IntPtr.Zero, IntPtr.Zero, ref IID_IDBInitiali ze);
and checked that 'provider' is not null i invoke
string conn = dataInitialise. GetInitializati onString( provider, 0xFF
);
This gives me a null reference exception with the trace
Additional information: The parameter is incorrect.
Documentation tells me that E_INVALIDARG is returned if 'provider' or
the initialisation string
are null. So i converted to
[return:MarshalA s(UnmanagedType .LPWStr)]
string GetInitializati onString(
[In, MarshalAs(Unman agedType.Interf ace)] object
pDataSource,
[In] byte fIncludePasswor d,
[In, MarshalAs( UnmanagedType.L PWStr )] string
connectionStrin g);
and invoked with
string dummy = "";
string conn = dataInitialise. GetInitializati onString( provider, 0xFF,
dummy );
i got the same error.
(IIRC .NET interop doesn't support [In, Out]. Is that correct? If
not how do i use that?)
Anyone know how to get this working?
TIA,
imp.
i'm trying to get IDBDataInitiali ze.GetInitializ ationString working.
Initially i tried
[return:MarshalA s(UnmanagedType .LPWStr)]
string GetInitializati onString(
[In, MarshalAs(Unman agedType.Interf ace)] object pDataSource,
[In] byte fIncludePasswor d
);
Having successfully got the dialogue box with
object provider = null;
provider = promptInitializ e.PromptDataSou rce(IntPtr.Zero , hwnd,
(Int32)
options, 0, IntPtr.Zero, IntPtr.Zero, ref IID_IDBInitiali ze);
and checked that 'provider' is not null i invoke
string conn = dataInitialise. GetInitializati onString( provider, 0xFF
);
This gives me a null reference exception with the trace
Additional information: The parameter is incorrect.
Documentation tells me that E_INVALIDARG is returned if 'provider' or
the initialisation string
are null. So i converted to
[return:MarshalA s(UnmanagedType .LPWStr)]
string GetInitializati onString(
[In, MarshalAs(Unman agedType.Interf ace)] object
pDataSource,
[In] byte fIncludePasswor d,
[In, MarshalAs( UnmanagedType.L PWStr )] string
connectionStrin g);
and invoked with
string dummy = "";
string conn = dataInitialise. GetInitializati onString( provider, 0xFF,
dummy );
i got the same error.
(IIRC .NET interop doesn't support [In, Out]. Is that correct? If
not how do i use that?)
Anyone know how to get this working?
TIA,
imp.