Click here to Skip to main content
16,007,760 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Version info? Pin
mcgahanfl29-Oct-03 6:47
mcgahanfl29-Oct-03 6:47 
Questionhow to search post in the forum? Pin
includeh1029-Oct-03 6:13
includeh1029-Oct-03 6:13 
AnswerRe: how to search post in the forum? Pin
Michael P Butler29-Oct-03 6:24
Michael P Butler29-Oct-03 6:24 
GeneralRe: how to search post in the forum? Pin
includeh1029-Oct-03 6:49
includeh1029-Oct-03 6:49 
Generaladding button to dialog titlebar Pin
YanivNahum29-Oct-03 5:44
YanivNahum29-Oct-03 5:44 
GeneralRe: adding button to dialog titlebar Pin
Roger Allen29-Oct-03 6:39
Roger Allen29-Oct-03 6:39 
GeneralPassing a object as a parameter to a OCX Pin
Jean-Guy29-Oct-03 4:19
Jean-Guy29-Oct-03 4:19 
GeneralRe: Passing a object as a parameter to a OCX Pin
Ian Darling29-Oct-03 6:12
Ian Darling29-Oct-03 6:12 
My experience with this sort of thing is a little rusty now, but should have enough information get you started.

You need to understand a little more about how COM (Component Object Model) works, but it should be relatively straightforward from that point.

ActiveX controls (your OCX) are based on COM as well, so what you need to do is write your "MyObject" as another COM object using MFC or ATL. Then you can pass the object from VB into your control.

The function you write on the C++ side of your ActiveX control I think should take a pointer to IUnknown or IDispatch. Once you have this pointer, you can QueryInterface for your own interface (or call Invoke() if it's IDispatch), and pull the height and width, etc values from there.

I'm sure some COM gurus can fill in/correct anything important I've missed.

--
Ian Darling
"The moral of the story is that with a contrived example, you can prove anything." - Joel Spolsky
GeneralGDI+ crashes - please help Pin
ARL:UT Student29-Oct-03 4:00
ARL:UT Student29-Oct-03 4:00 
Generaldb_param Binding problem Pin
TheMooseMan29-Oct-03 3:59
TheMooseMan29-Oct-03 3:59 
GeneralRegistry Snap Shot Pin
YaronNir29-Oct-03 3:28
YaronNir29-Oct-03 3:28 
GeneralRe: Registry Snap Shot Pin
David Crow29-Oct-03 4:14
David Crow29-Oct-03 4:14 
GeneralRe: Registry Snap Shot Pin
YaronNir29-Oct-03 4:31
YaronNir29-Oct-03 4:31 
GeneralWM_QUERYENDSESSION Windows session end causes Pin
Anonymous29-Oct-03 2:09
Anonymous29-Oct-03 2:09 
GeneralOwner Draw Button Pin
YaronNir29-Oct-03 1:23
YaronNir29-Oct-03 1:23 
GeneralRe: Owner Draw Button Pin
KaЯl29-Oct-03 3:33
KaЯl29-Oct-03 3:33 
GeneralRe: Owner Draw Button Pin
YaronNir29-Oct-03 3:35
YaronNir29-Oct-03 3:35 
QuestionSet IP over modem ? Pin
29-Oct-03 1:03
suss29-Oct-03 1:03 
AnswerRe: Set IP over modem ? Pin
Alexander M.,29-Oct-03 3:25
Alexander M.,29-Oct-03 3:25 
GeneralMeeting trouble when reading traffic bandwidth from network adapter. Pin
George228-Oct-03 23:48
George228-Oct-03 23:48 
GeneralVisual C++ .NET Compiler Error ... Pin
SD328-Oct-03 23:42
SD328-Oct-03 23:42 
QuestionSysInternals FileMon - how? Pin
peterchen28-Oct-03 23:37
peterchen28-Oct-03 23:37 
AnswerRe: SysInternals FileMon - how? Pin
Alexander M.,28-Oct-03 23:40
Alexander M.,28-Oct-03 23:40 
AnswerRe: SysInternals FileMon - how? Pin
David Crow29-Oct-03 2:55
David Crow29-Oct-03 2:55 
GeneralRe: SysInternals FileMon - how? Pin
Alexander M.,29-Oct-03 3:28
Alexander M.,29-Oct-03 3:28 

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.