Click here to Skip to main content
15,886,362 members
Home / Discussions / C#
   

C#

 
Generalinheritance with a twist on IEditableObject Pin
Ista23-Aug-03 18:53
Ista23-Aug-03 18:53 
GeneralDeveloping a voice messenger with .NET Pin
Naveed Ahmad23-Aug-03 17:52
Naveed Ahmad23-Aug-03 17:52 
GeneralATL server Pin
devvvy23-Aug-03 16:42
devvvy23-Aug-03 16:42 
GeneralRe: ATL server Pin
Ista23-Aug-03 18:50
Ista23-Aug-03 18:50 
GeneralRe: ATL server Pin
devvvy23-Aug-03 20:28
devvvy23-Aug-03 20:28 
GeneralRe: ATL server Pin
Ista23-Aug-03 18:56
Ista23-Aug-03 18:56 
GeneralRe: ATL server Pin
Ista23-Aug-03 19:09
Ista23-Aug-03 19:09 
GeneralRe: ATL server Pin
devvvy23-Aug-03 20:44
devvvy23-Aug-03 20:44 
humm... so, what is it. Return value is always S_OK/S_FAIL (HRESULT)??

[propget,id(3),helpstring("property ComputerName")] HRESULT ComputerName([out,retval] BSTR *pVal );

I my client code:

CCATLSimpleClass * pSysInfo = new CCATLSimpleClass;

try
{
//So, here, it's "return" value (and it did worked on my machine, by the way, what if there're more than one "retval"?):
String* sComputerName = pSysInfo->GetComputerNameA();

//Compile error: "...error C2660: 'pkATLSimpleASM::CCATLSimpleClass::GetComputerNameA' : function does not take 1 parameters"
pSysInfo->GetComputerNameA(sComputerName);


}
catch(Exception * e)
{
//.NET dont do HRESULT, return S_OK,E_MYERROR..etc will be packaged into an Exception object.
}

Checking dll with ILDASM,

instance string marshal( bstr) GetComputerNameA() runtime managed internalcall

Compare to source code, it seems tlbimp changes signature of the member function:

STDMETHODIMP CCATLSimple::GetComputerName(BSTR* sComputerName)
{
// TODO: Add your implementation code here
USES_CONVERSION;

if(!sComputerName)
return E_POINTER;

DWORD dwSize = MAX_COMPUTERNAME_LENGTH + 1;
TCHAR sTemp[MAX_COMPUTERNAME_LENGTH +1];

if(!::GetComputerName(sTemp, &dwSize) )
return E_FAIL;

* (sComputerName) = T2BSTR(sTemp);

return S_OK;
}

Now, what if there're more than one [out/retval]? Which one will be treated as "return"?

norm
GeneralRe: ATL server Pin
Ista24-Aug-03 5:16
Ista24-Aug-03 5:16 
GeneralRe: ATL server Pin
Ista24-Aug-03 6:45
Ista24-Aug-03 6:45 
Generaltransforming bitmaps Pin
Ista23-Aug-03 15:38
Ista23-Aug-03 15:38 
GeneralGod book on patterns in C# Pin
ervar23-Aug-03 12:45
ervar23-Aug-03 12:45 
GeneralRe: God book on patterns in C# Pin
MeisterBiber23-Aug-03 13:26
MeisterBiber23-Aug-03 13:26 
GeneralRe: God book on patterns in C# Pin
flipdoubt23-Aug-03 14:52
flipdoubt23-Aug-03 14:52 
GeneralRe: God book on patterns in C# Pin
ervar24-Aug-03 20:38
ervar24-Aug-03 20:38 
GeneralRe: God book on patterns in C# Pin
Jim Stewart26-Aug-03 10:20
Jim Stewart26-Aug-03 10:20 
GeneralCuting out a part of a bitmap Pin
Ylis23-Aug-03 11:45
Ylis23-Aug-03 11:45 
GeneralRe: Cuting out a part of a bitmap Pin
J. Dunlap23-Aug-03 13:47
J. Dunlap23-Aug-03 13:47 
GeneralRe: Cuting out a part of a bitmap Pin
Ista23-Aug-03 19:17
Ista23-Aug-03 19:17 
GeneralRe: Cuting out a part of a bitmap Pin
Ylis24-Aug-03 6:12
Ylis24-Aug-03 6:12 
GeneralEFFICIENCY: lock{} or .Synchronized Pin
MeisterBiber23-Aug-03 11:45
MeisterBiber23-Aug-03 11:45 
GeneralRe: EFFICIENCY: lock{} or .Synchronized Pin
Julian Bucknall [MSFT]25-Aug-03 10:15
Julian Bucknall [MSFT]25-Aug-03 10:15 
General80% call doA() , 20% call doB() Pin
MeisterBiber23-Aug-03 7:01
MeisterBiber23-Aug-03 7:01 
GeneralRe: 80% call doA() , 20% call doB() Pin
Daniel Turini23-Aug-03 12:10
Daniel Turini23-Aug-03 12:10 
GeneralRe: 80% call doA() , 20% call doB() Pin
MeisterBiber23-Aug-03 13:21
MeisterBiber23-Aug-03 13:21 

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.