Click here to Skip to main content
15,887,812 members
Home / Discussions / COM
   

COM

 
GeneralPaste img from any application like Paint, Ms Photoeditor,etc Pin
Filomela2-Feb-04 20:47
Filomela2-Feb-04 20:47 
Questionhow to use ActiveX contrl listview and imagelist in mscomctl.ocx Pin
Dababa2-Feb-04 14:29
Dababa2-Feb-04 14:29 
GeneralParameter in ActiveX control Pin
TrungHuynh1-Feb-04 19:43
TrungHuynh1-Feb-04 19:43 
GeneralRe: Parameter in ActiveX control Pin
Steve S2-Feb-04 4:23
Steve S2-Feb-04 4:23 
GeneralRe: Parameter in ActiveX control Pin
TrungHuynh2-Feb-04 14:30
TrungHuynh2-Feb-04 14:30 
GeneralRe: Parameter in ActiveX control Pin
Steve S2-Feb-04 22:07
Steve S2-Feb-04 22:07 
GeneralRe: Parameter in ActiveX control Pin
TrungHuynh2-Feb-04 22:25
TrungHuynh2-Feb-04 22:25 
GeneralRe: Parameter in ActiveX control Pin
Steve S3-Feb-04 0:18
Steve S3-Feb-04 0:18 
Firstly, you should give MIDL some hint about your parameter. Is it being passed into the function ([in] FILE_INFO FileInfo) or being passed back?
([out] FILE_INFO* FileInfo).
Secondly, it's customary for methods to return a status indication (or HRESULT) so that you can easily determine that an error has occurred.

To use a UDT, assign a GUID to the structure definition. Something like this will help.

#ifdef __midl
[
uuid(FFFFFFFF-FFFF-FFFF-FFFF-FFFFFFFFFFFF),
version(1.0),
helpstring("My FILEINFO structure")
]
#else
struct __declspec(uuid("FFFFFFFF-FFFF-FFFF-FFFF-FFFFFFFFFFFF")) FILE_INFO;
typedef
#endif
struct FILE_INFO
{
BSTR szFileName;
BSTR szLocation;
BSTR szLocationTemp;
} FILE_INFO;

except you'd replace the dummy guid FFFFFFFF-FFFF-FFFF-FFFF-FFFFFFFFFFFF with your own.

You should then have

[id(7)] HRESULT SetInfo([in] struct FILE_INFO* pFileInfo);

Note that it's a pointer you pass in now, not a structure. UDTs must be passed by reference, not by value.

I suggest you read the MSDN articles located by searching for
UDT IDL parameter
and if you're going to do a lot of this, read the Martin Gudgin book, Essential IDL.



Steve S
GeneralRe: Parameter in ActiveX control Pin
TrungHuynh3-Feb-04 14:44
TrungHuynh3-Feb-04 14:44 
GeneralRe: Parameter in ActiveX control Pin
TrungHuynh3-Feb-04 14:46
TrungHuynh3-Feb-04 14:46 
GeneralRe: Parameter in ActiveX control Pin
Steve S3-Feb-04 22:52
Steve S3-Feb-04 22:52 
GeneralAccessing IE via COM or ActiveX Pin
Dave Midgley1-Feb-04 7:52
Dave Midgley1-Feb-04 7:52 
GeneralRe: HTML control Pin
Anonymous3-Feb-04 22:09
Anonymous3-Feb-04 22:09 
Generalembedding activex control in outlook mail message Pin
emmatty1-Feb-04 3:53
emmatty1-Feb-04 3:53 
GeneralRe: embedding activex control in outlook mail message Pin
gialli1-Feb-04 19:24
gialli1-Feb-04 19:24 
Generalactivex control problem Pin
emmatty30-Jan-04 19:08
emmatty30-Jan-04 19:08 
GeneralRe: activex control problem Pin
AssemblySoft31-Jan-04 12:31
AssemblySoft31-Jan-04 12:31 
GeneralRe: activex control problem Pin
Jörgen Sigvardsson31-Jan-04 12:41
Jörgen Sigvardsson31-Jan-04 12:41 
QuestionPassing complex type through COM interface ? Pin
Alwin7530-Jan-04 12:50
Alwin7530-Jan-04 12:50 
AnswerRe: Passing complex type through COM interface ? Pin
Jörgen Sigvardsson30-Jan-04 13:00
Jörgen Sigvardsson30-Jan-04 13:00 
GeneralCOM+ Catalog Infomation Pin
kimsangwoo30-Jan-04 12:28
kimsangwoo30-Jan-04 12:28 
GeneralProblem with MIDL and Flash IDL Pin
gialli29-Jan-04 22:16
gialli29-Jan-04 22:16 
GeneralPassing variants in Fire_xxx methods Pin
Aby Philip28-Jan-04 4:38
Aby Philip28-Jan-04 4:38 
GeneralRe: Passing variants in Fire_xxx methods Pin
Lim Bio Liong29-Jan-04 4:24
Lim Bio Liong29-Jan-04 4:24 
GeneralCOM and _bstr_t Pin
Tzoockee27-Jan-04 1:05
Tzoockee27-Jan-04 1:05 

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.