Click here to Skip to main content
15,890,506 members
Home / Discussions / C#
   

C#

 
QuestionGet host name from different segment of LAN Pin
w1424327-Jul-17 17:39
w1424327-Jul-17 17:39 
AnswerRe: Get host name from different segment of LAN Pin
Jochen Arndt27-Jul-17 22:04
professionalJochen Arndt27-Jul-17 22:04 
AnswerRe: Get host name from different segment of LAN Pin
Nathan Minier28-Jul-17 1:19
professionalNathan Minier28-Jul-17 1:19 
AnswerRe: Get host name from different segment of LAN Pin
Member 1333447128-Jul-17 8:42
Member 1333447128-Jul-17 8:42 
QuestionCOM and C#.net Interoperability Pin
Vijjuuu.26-Jul-17 8:59
Vijjuuu.26-Jul-17 8:59 
AnswerRe: COM and C#.net Interoperability Pin
Richard MacCutchan26-Jul-17 10:05
mveRichard MacCutchan26-Jul-17 10:05 
AnswerRe: COM and C#.net Interoperability Pin
Bernhard Hiller26-Jul-17 22:05
Bernhard Hiller26-Jul-17 22:05 
GeneralRe: COM and C#.net Interoperability Pin
Vijjuuu.27-Jul-17 7:27
Vijjuuu.27-Jul-17 7:27 
Thanks for your response.

Actually, i am trying re-write a COM component developed in ATL which is production. i want to give the same interface so that consumer has minimal impact.

code snippet from my existence code.

STDMETHOD(get_methodA)(/*[in]*/ VARIANT storeID, /*[out, retval]*/ VARIANT *pVal);
STDMETHOD(put_methodA)(/*[in]*/ VARIANT storeID, /*[in]*/ VARIANT newVal);
STDMETHOD(get_methodB)(/*[in]*/ VARIANT storeID, /*[in]*/ VARIANT index, /*[out, retval]*/ VARIANT *pVal);
STDMETHOD(put_methodB)(/*[in]*/ VARIANT storeID, /*[in]*/ VARIANT index, /*[in]*/ VARIANT newVal);


when i extract the typelib for this

[id(0x00000001), propget, helpstring("property methodA")]
   HRESULT methodA([in] VARIANT storeID, [out, retval] VARIANT* pVal);

   [id(0x00000001), propput, helpstring("property methodA")]
   HRESULT methodA([in] VARIANT storeID, [in] VARIANT pVal);


   [id(0x00000004), propget, helpstring("property methodB")]
   HRESULT methodB([in] VARIANT storeID, [in] VARIANT index, [out, retval] VARIANT* pVal);


   [id(0x00000004), propput, helpstring("property methodB")]
   HRESULT methodB([in] VARIANT storeID, [in] VARIANT index, [in] VARIANT pVal);


so the consumer can use as

methodA(123) -- return a value
methodA(123) = 100 -- this will set a value

methodB(123, 3) -- return a value
methodB(123, 3) = 100 -- this will set a value.

i am trying to mimic the same methods defined in my ATL in a C# interface and use .net com interoperability using a regasm.

i am not able to find out how achieve this in C#. if this is done in ATL i was thinking there could be a way to achieve this.

thanks for your time

modified 27-Jul-17 13:36pm.

GeneralRe: COM and C#.net Interoperability Pin
Pete O'Hanlon27-Jul-17 20:46
mvePete O'Hanlon27-Jul-17 20:46 
AnswerRe: COM and C#.net Interoperability Pin
BenScharbach12-Aug-17 10:21
BenScharbach12-Aug-17 10:21 
QuestionIssue with the below code Pin
Paul McGann25-Jul-17 22:44
professionalPaul McGann25-Jul-17 22:44 
AnswerRe: Issue with the below code Pin
F-ES Sitecore25-Jul-17 23:00
professionalF-ES Sitecore25-Jul-17 23:00 
GeneralRe: Issue with the below code Pin
Paul McGann26-Jul-17 3:14
professionalPaul McGann26-Jul-17 3:14 
AnswerRe: Issue with the below code Pin
Nathan Minier26-Jul-17 1:23
professionalNathan Minier26-Jul-17 1:23 
GeneralRe: Issue with the below code Pin
Paul McGann26-Jul-17 3:14
professionalPaul McGann26-Jul-17 3:14 
AnswerRe: Issue with the below code Pin
BillWoodruff26-Jul-17 4:00
professionalBillWoodruff26-Jul-17 4:00 
GeneralRe: Issue with the below code Pin
Paul McGann26-Jul-17 10:34
professionalPaul McGann26-Jul-17 10:34 
AnswerRe: Issue with the below code Pin
Ravi Bhavnani28-Jul-17 8:00
professionalRavi Bhavnani28-Jul-17 8:00 
AnswerRe: Issue with the below code Pin
BenScharbach12-Aug-17 9:42
BenScharbach12-Aug-17 9:42 
QuestionCreate an API in winform Pin
JohnPL25-Jul-17 18:56
JohnPL25-Jul-17 18:56 
QuestionRe: Create an API in winform Pin
Richard MacCutchan25-Jul-17 20:39
mveRichard MacCutchan25-Jul-17 20:39 
AnswerRe: Create an API in winform Pin
Bernhard Hiller25-Jul-17 20:42
Bernhard Hiller25-Jul-17 20:42 
AnswerRe: Create an API in winform Pin
BillWoodruff25-Jul-17 22:23
professionalBillWoodruff25-Jul-17 22:23 
AnswerRe: Create an API in winform Pin
F-ES Sitecore25-Jul-17 22:57
professionalF-ES Sitecore25-Jul-17 22:57 
QuestionMultiple checkbox Pin
sunsher25-Jul-17 1:04
sunsher25-Jul-17 1:04 

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.