Click here to Skip to main content
15,900,724 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Problem occur to access dll dialog box Pin
ShilpiP11-Nov-08 19:18
ShilpiP11-Nov-08 19:18 
GeneralRe: Problem occur to access dll dialog box Pin
Mark Salsbery11-Nov-08 20:28
Mark Salsbery11-Nov-08 20:28 
GeneralRe: Problem occur to access dll dialog box Pin
ShilpiP12-Nov-08 18:04
ShilpiP12-Nov-08 18:04 
GeneralRe: Problem occur to access dll dialog box Pin
Mark Salsbery12-Nov-08 20:47
Mark Salsbery12-Nov-08 20:47 
QuestionHow to return multiple values in MFC ActiveX? Pin
followait10-Nov-08 22:51
followait10-Nov-08 22:51 
AnswerRe: How to return multiple values in MFC ActiveX? Pin
Roger Stoltz10-Nov-08 23:05
Roger Stoltz10-Nov-08 23:05 
GeneralRe: How to return multiple values in MFC ActiveX? Pin
followait10-Nov-08 23:24
followait10-Nov-08 23:24 
AnswerRe: How to return multiple values in MFC ActiveX? Pin
Roger Stoltz11-Nov-08 0:15
Roger Stoltz11-Nov-08 0:15 
followait wrote:
In fact I have multiple return valus, not only name,


This is one of the reasons it won't compile.
It seems to me like you've misunderstood the meaning of "return value".
If you have a function declared as
bool MyFunc( int nTheInt, DWORD* pdwTheResult );
it will return a boolean value, but you can expect some kind of result of the operation in the DWORD-value. The return value in this case would be to inform the caller whether the operation was successful or not.

And I also noticed that you've already declared a VARIANT as return type in you IDL-file here:
[id(3)] VARIANT GetData(VARIANT id.......<small>the rest omitted for brevity</small>

This is allowed since the MFC framework will hide the actual HRESULT that is returned from all COM calls and return the VARIANT type in your case. If the returned HRESULT would happen to be an error code the client will throw an exception, or some equivalent depending on what language the client is implemented in.

Your IDL should probably look something like
[id(3)] BOOL GetData(VARIANT id, [out] VARIANT *name1, [out] VARIANT *name2);
where the "return value" is a boolean that informs the caller whether the operation was successful or not. The result of the operation is given in the two arguments name1 and name2.
This means that in your VB code you would call the function similar to
Dim name1 As Object
Dim name2 As Object
Dim success As Boolean
success = MyCtrl.GetData( 1, name1, name2 )



"It's supposed to be hard, otherwise anybody could do it!" - selfquote
"High speed never compensates for wrong direction!" - unknown


GeneralRe: How to return multiple values in MFC ActiveX? Pin
followait11-Nov-08 15:56
followait11-Nov-08 15:56 
QuestionRe: How to return multiple values in MFC ActiveX? Pin
Roger Stoltz11-Nov-08 22:15
Roger Stoltz11-Nov-08 22:15 
AnswerRe: How to return multiple values in MFC ActiveX? Pin
followait12-Nov-08 3:04
followait12-Nov-08 3:04 
AnswerRe: How to return multiple values in MFC ActiveX? Pin
Roger Stoltz12-Nov-08 3:20
Roger Stoltz12-Nov-08 3:20 
GeneralRe: How to return multiple values in MFC ActiveX? Pin
followait13-Nov-08 3:21
followait13-Nov-08 3:21 
QuestionAVI Player Pin
tanmay.kol10-Nov-08 22:49
tanmay.kol10-Nov-08 22:49 
AnswerRe: AVI Player Pin
Hamid_RT11-Nov-08 3:33
Hamid_RT11-Nov-08 3:33 
GeneralRe: AVI Player Pin
tanmay.kol11-Nov-08 23:42
tanmay.kol11-Nov-08 23:42 
GeneralRe: AVI Player Pin
Hamid_RT12-Nov-08 5:49
Hamid_RT12-Nov-08 5:49 
QuestionCRichEditCtrl Problem of displaying text as hyperlink Pin
Dhiraj kumar Saini10-Nov-08 22:40
Dhiraj kumar Saini10-Nov-08 22:40 
QuestionRe: CRichEditCtrl Problem of displaying text as hyperlink Pin
David Crow11-Nov-08 3:17
David Crow11-Nov-08 3:17 
QuestionExecuting Sort.exe using ShellExecute()... etc Pin
Mick Leong10-Nov-08 21:22
Mick Leong10-Nov-08 21:22 
QuestionRe: Executing Sort.exe using ShellExecute()... etc Pin
CPallini10-Nov-08 22:33
mveCPallini10-Nov-08 22:33 
AnswerRe: Executing Sort.exe using ShellExecute()... etc Pin
David Crow11-Nov-08 3:20
David Crow11-Nov-08 3:20 
Questionproblem creating a colored icon Pin
tudorbalan10-Nov-08 21:19
tudorbalan10-Nov-08 21:19 
AnswerRe: problem creating a colored icon [modified] Pin
Mark Salsbery11-Nov-08 6:56
Mark Salsbery11-Nov-08 6:56 
GeneralRe: problem creating a colored icon Pin
tudorbalan11-Nov-08 10:34
tudorbalan11-Nov-08 10:34 

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.