Click here to Skip to main content
15,897,187 members
Home / Discussions / COM
   

COM

 
AnswerRe: How to get a HBITMAP? Pin
Laxman Auti14-Jun-06 3:41
Laxman Auti14-Jun-06 3:41 
QuestionWMI Pin
abhiramsss12-Jun-06 21:07
abhiramsss12-Jun-06 21:07 
QuestionHow to embed external document? Pin
Super Lloyd12-Jun-06 19:55
Super Lloyd12-Jun-06 19:55 
AnswerRe: How to embed external document? Pin
Aamir Butt14-Jun-06 1:16
Aamir Butt14-Jun-06 1:16 
GeneralRe: How to embed external document? Pin
Super Lloyd14-Jun-06 1:53
Super Lloyd14-Jun-06 1:53 
QuestionServer busy message box Pin
Rinu_Raj11-Jun-06 23:43
Rinu_Raj11-Jun-06 23:43 
Generalusing com object of photoshop Pin
santhoshkumar_pv9-Jun-06 20:25
santhoshkumar_pv9-Jun-06 20:25 
QuestionCOM-.NET interoperability (string - BSTR marshalling) Pin
Prasadrn9-Jun-06 1:23
Prasadrn9-Jun-06 1:23 
I saw this on MSDN:
RCW enforces built-in marshaling rules. For example, when a .NET client passes a String type as part of an argument to a managed object, the wrapper converts the string to a BSTR type. Should the COM object return a BSTR to its managed caller, the caller receives a string. Both the client and the server send and receive data that is familiar to them.

But this doesn't work for a .NET client passing a string by value to a COM server.

ATLSERVERLib.Object1Class obj = new ATLSERVERLib.Object1Class();<br />
					<br />
unsafe<br />
{<br />
     short k1 = obj.GetANum;<br />
     Console.WriteLine(k1);<br />
<br />
     string name = new string('o', 7);<br />
     obj.GetName = "Check";<br />
     string[] strArray = new string[1];<br />
     strArray[0] = "N Prasad";<br />
     obj.set_OtherName(ref strArray[0]);<br />
     Console.WriteLine(obj.GetName);<br />
     Console.ReadLine();<br />
}


If I comment out obj.set_OtherName(ref strArray[0]);, the obj.GetName doesn't yield the correct string.

It seems that the obj.GetName = "Check"; has no effect although it sets the COM server's private variable BSTR myValue;.

Thus it also seems that the .NET string to COM BSTR marshalling works properly inside COM server only if the string (.NET object) is passed by reference, which means it becomes a BSTR* in COM server.

Does anybody have an idea why this happens?
AnswerRe: COM-.NET interoperability (string - BSTR marshalling) Pin
Andy Moore10-Jun-06 11:45
Andy Moore10-Jun-06 11:45 
Questionuse an automation object from a service Pin
joepadmiraal8-Jun-06 23:32
joepadmiraal8-Jun-06 23:32 
QuestionProblem in using Mlang Pin
Abhinav agrawal7-Jun-06 5:42
Abhinav agrawal7-Jun-06 5:42 
AnswerRe: Problem in using Mlang Pin
Stephen Hewitt8-Jun-06 17:52
Stephen Hewitt8-Jun-06 17:52 
QuestionCOM Servers Pin
HakunaMatada7-Jun-06 2:29
HakunaMatada7-Jun-06 2:29 
AnswerRe: COM Servers Pin
Roger Stoltz7-Jun-06 11:04
Roger Stoltz7-Jun-06 11:04 
GeneralRe: COM Servers Pin
HakunaMatada7-Jun-06 17:40
HakunaMatada7-Jun-06 17:40 
GeneralRe: COM Servers Pin
Roger Stoltz7-Jun-06 22:23
Roger Stoltz7-Jun-06 22:23 
GeneralRe: COM Servers Pin
HakunaMatada7-Jun-06 22:59
HakunaMatada7-Jun-06 22:59 
AnswerRe: COM Servers Pin
Roger Stoltz8-Jun-06 0:03
Roger Stoltz8-Jun-06 0:03 
GeneralRe: COM Servers Pin
HakunaMatada8-Jun-06 1:06
HakunaMatada8-Jun-06 1:06 
AnswerRe: COM Servers Pin
Roger Stoltz8-Jun-06 2:12
Roger Stoltz8-Jun-06 2:12 
GeneralRe: COM Servers Pin
HakunaMatada8-Jun-06 17:28
HakunaMatada8-Jun-06 17:28 
GeneralRe: COM Servers [modified] Pin
Stephen Hewitt8-Jun-06 18:02
Stephen Hewitt8-Jun-06 18:02 
GeneralRe: COM Servers [modified] Pin
Roger Stoltz9-Jun-06 2:14
Roger Stoltz9-Jun-06 2:14 
GeneralRe: COM Servers Pin
Stephen Hewitt9-Jun-06 18:01
Stephen Hewitt9-Jun-06 18:01 
AnswerRe: COM Servers Pin
Aamir Butt12-Jun-06 4:07
Aamir Butt12-Jun-06 4:07 

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.