Click here to Skip to main content
15,908,618 members
Home / Discussions / C#
   

C#

 
GeneralConverting short into byte[] Pin
tag3385-Feb-05 3:42
tag3385-Feb-05 3:42 
GeneralRe: Converting short into byte[] Pin
Robert Rohde5-Feb-05 4:06
Robert Rohde5-Feb-05 4:06 
GeneralThe using statement Pin
paululvinius5-Feb-05 1:06
paululvinius5-Feb-05 1:06 
GeneralRe: The using statement Pin
Robert Rohde5-Feb-05 1:17
Robert Rohde5-Feb-05 1:17 
GeneralRunning Without a form GUI Pin
Amir Jalaly5-Feb-05 0:03
Amir Jalaly5-Feb-05 0:03 
GeneralRe: Running Without a form GUI Pin
Gary Thom5-Feb-05 1:18
Gary Thom5-Feb-05 1:18 
Generalcommunication between a c# application and C++ com Pin
yaya1014-Feb-05 21:45
yaya1014-Feb-05 21:45 
GeneralRe: communication between a c# application and C++ com Pin
Heath Stewart5-Feb-05 4:52
protectorHeath Stewart5-Feb-05 4:52 
While your explanation could use a little bit of elaboration, do make sure that you're accessing an instance of the COM object and not creating another one. This can be tricky in .NET. In your native application you could add an instance of your DMO to the RunningObjectTable (ROT; fairly easy in native code) and then get it out in your managed application using Marshal.GetActiveObject(string progId) (so make sure to register your COM object class with a ProgID).

Note that you can also send information to the filter using SendMessage, but you must P/Invoke it. The generic signature follows:
[DllImport("user32.dll")]
static extern IntPtr SendMessage(IntPtr hWnd,
  [MarshalAs(UnmanagedType.U4)] int msg,
  IntPtr wParam,
  IntPtr lParam);
Depending on the message parameters and return code, you can redefine this a little differently. If you must pass a pointer to a struct, for example, you can do the following (since a pointer to a struct is the size of an IntPtr):
[DllImport("user32.dll")]
static extern IntPtr SendMessage(IntPtr hWnd,
  [MarshalAs(UnmanagedType.U4)] int msg,
  IntPtr wParam,
  ref MyStruct lParam);
What QueryInterface method are you using? Marshal.QueryInterface? Please post some example code.

This posting is provided "AS IS" with no warranties, and confers no rights.

Software Design Engineer
Developer Division Sustained Engineering
Microsoft

[My Articles] [My Blog]
GeneralRe: communication between a c# application and C++ com Pin
yaya1017-Feb-05 7:24
yaya1017-Feb-05 7:24 
GeneralOdd SSL Public Key Pin
bigals4-Feb-05 18:25
bigals4-Feb-05 18:25 
GeneralStop and Start MSDOS C# App Pin
StephenMcAllister4-Feb-05 18:17
StephenMcAllister4-Feb-05 18:17 
GeneralRe: Stop and Start MSDOS C# App Pin
Heath Stewart5-Feb-05 4:44
protectorHeath Stewart5-Feb-05 4:44 
GeneralAccess Database Pin
Cappuccino_David4-Feb-05 16:51
Cappuccino_David4-Feb-05 16:51 
GeneralRe: Access Database Pin
Yulianto.4-Feb-05 17:16
Yulianto.4-Feb-05 17:16 
GeneralRe: Access Database Pin
Luis Alonso Ramos4-Feb-05 19:23
Luis Alonso Ramos4-Feb-05 19:23 
GeneralRe: Access Database Pin
Cappuccino_David5-Feb-05 8:23
Cappuccino_David5-Feb-05 8:23 
GeneralRe: Access Database Pin
Luis Alonso Ramos5-Feb-05 8:30
Luis Alonso Ramos5-Feb-05 8:30 
GeneralonMaximize() or onResize() questions... Pin
new_phoenix4-Feb-05 16:46
new_phoenix4-Feb-05 16:46 
GeneralRe: onMaximize() or onResize() questions... Pin
Heath Stewart5-Feb-05 3:39
protectorHeath Stewart5-Feb-05 3:39 
GeneralRe: onMaximize() or onResize() questions... Pin
new_phoenix5-Feb-05 8:20
new_phoenix5-Feb-05 8:20 
GeneralRe: onMaximize() or onResize() questions... Pin
Heath Stewart6-Feb-05 5:35
protectorHeath Stewart6-Feb-05 5:35 
GeneralRe: onMaximize() or onResize() questions... Pin
new_phoenix6-Feb-05 12:12
new_phoenix6-Feb-05 12:12 
GeneralRe: onMaximize() or onResize() questions... Pin
Heath Stewart7-Feb-05 6:36
protectorHeath Stewart7-Feb-05 6:36 
GeneralBest Practices - Serializing Dialog Data Pin
Newbie_T4-Feb-05 16:37
Newbie_T4-Feb-05 16:37 
GeneralRe: Best Practices - Serializing Dialog Data Pin
Heath Stewart5-Feb-05 3:30
protectorHeath Stewart5-Feb-05 3:30 

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.