Click here to Skip to main content
15,921,660 members
Home / Discussions / C#
   

C#

 
GeneralRe: Threading using the ref statement? Wha Happen? Pin
jremignanti27-Oct-03 8:00
jremignanti27-Oct-03 8:00 
GeneralRe: Threading using the ref statement? Wha Happen? Pin
Heath Stewart27-Oct-03 8:05
protectorHeath Stewart27-Oct-03 8:05 
GeneralRe: Threading using the ref statement? Wha Happen? Pin
jremignanti27-Oct-03 8:28
jremignanti27-Oct-03 8:28 
GeneralRe: Threading using the ref statement? Wha Happen? Pin
Heath Stewart27-Oct-03 8:34
protectorHeath Stewart27-Oct-03 8:34 
GeneralRe: Threading using the ref statement? Wha Happen? Pin
jremignanti27-Oct-03 9:02
jremignanti27-Oct-03 9:02 
GeneralRe: Threading using the ref statement? Wha Happen? Pin
Heath Stewart27-Oct-03 10:08
protectorHeath Stewart27-Oct-03 10:08 
GeneralRe: Threading using the ref statement? Wha Happen? Pin
jremignanti27-Oct-03 10:36
jremignanti27-Oct-03 10:36 
GeneralRe: Threading using the ref statement? Wha Happen? Pin
Heath Stewart27-Oct-03 10:43
protectorHeath Stewart27-Oct-03 10:43 
This definitely sounds like a marshaling problem. Seems like data about the array is being sent when you want the array data since the bytes should be the same on both.

You shoud read Advanced COM Interop in the MSDN Library. Basically, you're interface is just a way to access the class. In COM, you treat every object through it's interface by QI'ing (QueryInterface) for the interface that the class implements. In .NET this is acheived by merely casting.

You can define the interface in your project regardless of what is in the interop assembly, yes. As long as the method signatures are marshalable and similar (proper number of params) and use the same return types (should all be void unless PreserveSignature is true, which then you use int to represent an HRESULT). Just instantiate your COM class and cast it to the interface you redefined (remember, use the same GUID for the interface in the GuidAttribute and keep all that stuff the same I said in the previous post) and you should have a valid reference to your object through that interface (again, it's like calling QI, which doesn't care about qualified names like .NET does).

I'm not sure I'm explaining this as easily as possible, but read that section in MSDN (or perhaps start with the more basic stuff that comes before it). COM interop is powerful but is also is a beast to tame.

 

-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
GeneralRe: Threading using the ref statement? Wha Happen? Pin
jremignanti27-Oct-03 10:54
jremignanti27-Oct-03 10:54 
GeneralRe: Threading using the ref statement? Wha Happen? Pin
Heath Stewart27-Oct-03 10:55
protectorHeath Stewart27-Oct-03 10:55 
GeneralRe: Threading using the ref statement? Wha Happen? Pin
jremignanti27-Oct-03 11:17
jremignanti27-Oct-03 11:17 
GeneralAllowDrop Property Problem Pin
Volker Jacobsen27-Oct-03 3:14
Volker Jacobsen27-Oct-03 3:14 
GeneralRe: AllowDrop Property Problem Pin
Heath Stewart27-Oct-03 8:44
protectorHeath Stewart27-Oct-03 8:44 
GeneralRe: AllowDrop Property Problem Pin
Volker Jacobsen27-Oct-03 20:46
Volker Jacobsen27-Oct-03 20:46 
GeneralTwo ImageList and two ImageIndex (and maybe... useful source code for you) Pin
god4k27-Oct-03 1:36
god4k27-Oct-03 1:36 
GeneralRe: Two ImageList and two ImageIndex (and maybe... useful source code for you) Pin
Heath Stewart27-Oct-03 2:37
protectorHeath Stewart27-Oct-03 2:37 
QuestionHow do I catch Windows messages in c#?? Pin
IrishSonic27-Oct-03 0:03
IrishSonic27-Oct-03 0:03 
AnswerRe: How do I catch Windows messages in c#?? Pin
Heath Stewart27-Oct-03 2:13
protectorHeath Stewart27-Oct-03 2:13 
AnswerRe: How do I catch Windows messages in c#?? Pin
oOomen27-Oct-03 4:58
oOomen27-Oct-03 4:58 
GeneralFOCUS Pin
oOomen26-Oct-03 20:27
oOomen26-Oct-03 20:27 
GeneralRe: FOCUS Pin
Heath Stewart27-Oct-03 2:25
protectorHeath Stewart27-Oct-03 2:25 
GeneralRe: FOCUS Pin
oOomen27-Oct-03 5:01
oOomen27-Oct-03 5:01 
GeneralRe: FOCUS Pin
allancto27-Oct-03 18:32
allancto27-Oct-03 18:32 
GeneralRe: FOCUS Pin
oOomen28-Oct-03 2:38
oOomen28-Oct-03 2:38 
GeneralRe: FOCUS Pin
oOomen28-Oct-03 2:52
oOomen28-Oct-03 2:52 

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.