Click here to Skip to main content
16,007,126 members
Home / Discussions / C#
   

C#

 
GeneralRe: E-Commerce Pin
Werdna29-Sep-04 2:47
Werdna29-Sep-04 2:47 
GeneralEdit excel text box using C# Pin
manishoz28-Sep-04 14:40
manishoz28-Sep-04 14:40 
Generaliterating through xml created from a spreadsheet Pin
wend28-Sep-04 12:51
wend28-Sep-04 12:51 
GeneralRe: iterating through xml created from a spreadsheet Pin
Heath Stewart28-Sep-04 13:11
protectorHeath Stewart28-Sep-04 13:11 
QuestionOutlook sync component? Pin
cmkWildsky28-Sep-04 11:53
cmkWildsky28-Sep-04 11:53 
AnswerRe: Outlook sync component? Pin
Heath Stewart28-Sep-04 13:12
protectorHeath Stewart28-Sep-04 13:12 
GeneralC# COM object to TLB generation problem Pin
Werdna28-Sep-04 10:35
Werdna28-Sep-04 10:35 
GeneralRe: C# COM object to TLB generation problem Pin
Heath Stewart28-Sep-04 15:41
protectorHeath Stewart28-Sep-04 15:41 
This is the documented and expected behavior. All COM methods (and, by extension, properties) are supposed to return HRESULTs (as yours does), and what COM clients like VB and .NET via COM interop see is return values (although in .NET you can attribute your methods with PreserveSigAttribute - among other ways - to make sure an HRESULT is returned as an Int32 since the return result code might be important and may not be an error (like S_FALSE).

I recomend that you read Creating a CCW for COM enabled non .NET applications[^] here on CodeProject, as well as Exposing .NET Framework Components to COM[^]. Make sure that you hard-code GUIDs with the GuidAttribute and never change published interfaces (i.e., interfaces you've released unto the world). Always derive new ones. Also never use auto-generated class interfaces. Define your interfaces explicitly and implement your class interface as the first interface in your implementation list.

Also, what examples are you looking at? I've read about every article and API doc in MSDN and COM methods are all return HRESULTs or SCODEs (legacy) - it's part of the COM spec to do so. VB (pre-.NET) interprets [retval]s as return values, just like tlbimp.exe and VS.NET do when importing a typelib. Other late-bound clients like Windows Script (VBScript, JScript) do so as well.

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

Software Design Engineer
Developer Division Sustained Engineering
Microsoft

[My Articles]
GeneralRe: C# COM object to TLB generation problem Pin
Werdna28-Sep-04 16:00
Werdna28-Sep-04 16:00 
GeneralRe: C# COM object to TLB generation problem Pin
Heath Stewart28-Sep-04 18:34
protectorHeath Stewart28-Sep-04 18:34 
GeneralRe: C# COM object to TLB generation problem Pin
Werdna29-Sep-04 4:33
Werdna29-Sep-04 4:33 
GeneralRe: C# COM object to TLB generation problem Pin
Heath Stewart29-Sep-04 5:51
protectorHeath Stewart29-Sep-04 5:51 
GeneralRe: C# COM object to TLB generation problem Pin
Werdna29-Sep-04 6:17
Werdna29-Sep-04 6:17 
GeneralToolBar That Doesn't Move Pin
MarkMokris28-Sep-04 10:04
MarkMokris28-Sep-04 10:04 
GeneralRe: ToolBar That Doesn't Move Pin
Brian Nottingham28-Sep-04 10:28
Brian Nottingham28-Sep-04 10:28 
GeneralRe: ToolBar That Doesn't Move Pin
MarkMokris28-Sep-04 10:44
MarkMokris28-Sep-04 10:44 
General"Independent Display" Pin
monkeymonkey00728-Sep-04 7:11
monkeymonkey00728-Sep-04 7:11 
GeneralRe: "Independent Display" Pin
Christian Graus28-Sep-04 11:50
protectorChristian Graus28-Sep-04 11:50 
GeneralA C# / SQL Query Problem Pin
cemlouis28-Sep-04 6:51
cemlouis28-Sep-04 6:51 
GeneralRe: A C# / SQL Query Problem Pin
Christian Graus28-Sep-04 11:51
protectorChristian Graus28-Sep-04 11:51 
GeneralRe: A C# / SQL Query Problem Pin
Colin Angus Mackay28-Sep-04 12:19
Colin Angus Mackay28-Sep-04 12:19 
GeneralRe: A C# / SQL Query Problem Pin
cemlouis28-Sep-04 14:01
cemlouis28-Sep-04 14:01 
GeneralKeep a Form on Top Pin
MarkMokris28-Sep-04 6:22
MarkMokris28-Sep-04 6:22 
GeneralRe: Keep a Form on Top Pin
Nnamdi Onyeyiri28-Sep-04 6:33
Nnamdi Onyeyiri28-Sep-04 6:33 
GeneralRe: Keep a Form on Top Pin
Anonymous28-Sep-04 6:40
Anonymous28-Sep-04 6:40 

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.