Click here to Skip to main content
15,913,773 members
Home / Discussions / C#
   

C#

 
GeneralRe: project options (advice) Pin
Steve Maier24-Aug-04 4:45
professionalSteve Maier24-Aug-04 4:45 
GeneralRe: project options (advice) Pin
HudsonKane24-Aug-04 5:33
HudsonKane24-Aug-04 5:33 
GeneralRe: project options (advice) Pin
HudsonKane24-Aug-04 5:36
HudsonKane24-Aug-04 5:36 
GeneralRe: project options (advice) Pin
Steve Maier24-Aug-04 7:13
professionalSteve Maier24-Aug-04 7:13 
GeneralRe: project options (advice) Pin
HudsonKane24-Aug-04 8:19
HudsonKane24-Aug-04 8:19 
GeneralWeb application config Pin
jzb24-Aug-04 3:09
jzb24-Aug-04 3:09 
GeneralRe: Web application config Pin
Steven Campbell24-Aug-04 3:51
Steven Campbell24-Aug-04 3:51 
QuestionHow can I pass byte array from C++ to c# ? Pin
neoksd24-Aug-04 2:31
neoksd24-Aug-04 2:31 
Hi~~
I have a problem transfer byte array from directshow filter to C# application.

I made simple directshow filter using C++. that filter has a interface to communication outside application. like this..

DECLARE_INTERFACE_(IGetCurrentData, IUnknown)
{
STDMETHOD(Get_Current_Media) (THIS_
BYTE** pData
) PURE;

STDMETHOD(Get_Current_Media_Legnth) (THIS_
long& length
) PURE;
};


I also declare interface in C# application to communicate with filter(C++ Dll) like this..

[ComVisible(true), ComImport,
Guid("CCB4EF12-C1CC-43a4-82EF-7886C0F39EB1"),
InterfaceType( ComInterfaceType.InterfaceIsIUnknown )]
public interface IGetCurrentData
{
[PreserveSig]
int Get_Current_Media([MarshalAs(UnmanagedType.LPArray, SizeParamIndex=0)]out byte[]ar);

[PreserveSig]
int Get_Current_Media_Legnth(out long length);
}

I use this sentence to use C# interface.

byte[] pData;
Get_Current_Media(out pData);

but I meet an exception during runtime. I think datatype is not match. How can I solve this problem?
AnswerRe: How can I pass byte array from C++ to c# ? Pin
billb211224-Aug-04 3:31
billb211224-Aug-04 3:31 
GeneralRe: How can I pass byte array from C++ to c# ? Pin
neoksd24-Aug-04 4:16
neoksd24-Aug-04 4:16 
GeneralRe: How can I pass byte array from C++ to c# ? Pin
billb211224-Aug-04 5:45
billb211224-Aug-04 5:45 
AnswerRe: How can I pass byte array from C++ to c# ? Pin
Heath Stewart24-Aug-04 8:03
protectorHeath Stewart24-Aug-04 8:03 
GeneralRe: How can I pass byte array from C++ to c# ? Pin
neoksd26-Aug-04 15:23
neoksd26-Aug-04 15:23 
GeneralRe: Declaration Default Argument Values Pin
S Sansanwal23-Aug-04 23:54
S Sansanwal23-Aug-04 23:54 
GeneralRe: Declaration Default Argument Values Pin
Heath Stewart24-Aug-04 8:09
protectorHeath Stewart24-Aug-04 8:09 
GeneralHosting Managed Controls in MFC Pin
Amir Harel23-Aug-04 23:13
Amir Harel23-Aug-04 23:13 
Generaldatabound list with customisable filter Pin
..Hubert..23-Aug-04 23:03
..Hubert..23-Aug-04 23:03 
GeneralIP-Tunnel Pin
erina54823-Aug-04 22:55
erina54823-Aug-04 22:55 
GeneralRe: IP-Tunnel Pin
Dave Kreskowiak24-Aug-04 6:56
mveDave Kreskowiak24-Aug-04 6:56 
GeneralISOBARS Pin
beolijza23-Aug-04 22:39
beolijza23-Aug-04 22:39 
QuestionHow do I call a base class function from a derived class function? Pin
Salil Khedkar23-Aug-04 20:21
Salil Khedkar23-Aug-04 20:21 
AnswerRe: How do I call a base class function from a derived class function? Pin
Colin Angus Mackay23-Aug-04 20:44
Colin Angus Mackay23-Aug-04 20:44 
GeneralRe: How do I call a base class function from a derived class function? Pin
Salil Khedkar23-Aug-04 21:19
Salil Khedkar23-Aug-04 21:19 
GeneralRe: How do I call a base class function from a derived class function? Pin
leppie23-Aug-04 21:31
leppie23-Aug-04 21:31 
GeneralRe: How do I call a base class function from a derived class function? Pin
Colin Angus Mackay24-Aug-04 0:29
Colin Angus Mackay24-Aug-04 0:29 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.