Click here to Skip to main content
15,927,344 members
Home / Discussions / COM
   

COM

 
GeneralCOM object passing Pin
7-Apr-02 16:17
suss7-Apr-02 16:17 
GeneralRe: COM object passing Pin
Mazdak8-Apr-02 4:29
Mazdak8-Apr-02 4:29 
GeneralRe: COM object passing Pin
8-Apr-02 14:53
suss8-Apr-02 14:53 
GeneralRe: COM object passing Pin
Mazdak9-Apr-02 1:19
Mazdak9-Apr-02 1:19 
GeneralRe: COM object passing Pin
el davo9-Apr-02 18:54
el davo9-Apr-02 18:54 
GeneralRe: COM object passing Pin
Sam Strachan10-Apr-02 3:16
Sam Strachan10-Apr-02 3:16 
GeneralRe: COM object passing Pin
el davo10-Apr-02 19:24
el davo10-Apr-02 19:24 
GeneralRe: COM object passing Pin
Sam Strachan10-Apr-02 22:36
Sam Strachan10-Apr-02 22:36 
Dave,

Yes, that should do the trick. If it fails then you have a few options including...

1) Making it IUnknown in C++ then in VB do this

dim fred as new adodb.connection
dim oFred as Object
fred.open blah blah blah
set oFred = fred
somestring = getfield(oFred, anotherstring)

(Set in VB is much akin to QueryInterface in C++)

2) Make it a Variant in C++ containing either IUnknown or IDispatch then do the same as above but Dim oFred as a Variant instead.

I haven't done exactly this before (I've done it with my own custom objects) but the principal should be the same.

Also, make sure that you do a _Connection.AddRef() at the beginning and .Release() at the end of your processing in C++ as you will be a COM Client in this case. Not doing this may yield all sorts of nastiness if VB decides it can let go of the Connection in the mean time.

Good luck,

Sam

GeneralITextDocument??? UGH!!! Pin
Dave_7-Apr-02 12:36
Dave_7-Apr-02 12:36 
GeneralCreating Search Engine Component for Intranet Pin
6-Apr-02 19:57
suss6-Apr-02 19:57 
QuestionHow to access method in other object in COM Pin
chq126-Apr-02 11:13
chq126-Apr-02 11:13 
AnswerRe: How to access method in other object in COM Pin
Mazdak6-Apr-02 17:52
Mazdak6-Apr-02 17:52 
GeneralRe: How to access method in other object in COM Pin
chq127-Apr-02 8:32
chq127-Apr-02 8:32 
GeneralRe: How to access method in other object in COM Pin
Mazdak7-Apr-02 9:21
Mazdak7-Apr-02 9:21 
GeneralRe: How to access method in other object in COM Pin
chq127-Apr-02 16:30
chq127-Apr-02 16:30 
GeneralCoUninitialize doesn't return Pin
sefip3-Apr-02 21:24
sefip3-Apr-02 21:24 
Generalenable delegation to work Pin
David Dal Zot3-Apr-02 3:38
David Dal Zot3-Apr-02 3:38 
QuestionWhat does this code do? Pin
Gerald Schwab1-Apr-02 16:57
Gerald Schwab1-Apr-02 16:57 
AnswerRe: What does this code do? Pin
Michael Dunn1-Apr-02 21:15
sitebuilderMichael Dunn1-Apr-02 21:15 
GeneralRe: What does this code do? Pin
Gerald Schwab2-Apr-02 5:28
Gerald Schwab2-Apr-02 5:28 
GeneralRe: What does this code do? Pin
Michael Dunn5-Apr-02 16:19
sitebuilderMichael Dunn5-Apr-02 16:19 
GeneralRe: What does this code do? Pin
Nick Parker5-Apr-02 10:02
protectorNick Parker5-Apr-02 10:02 
GeneralRe: What does this code do? Pin
Michael Dunn5-Apr-02 16:20
sitebuilderMichael Dunn5-Apr-02 16:20 
QuestionWhat does this code do? Pin
Gerald Schwab1-Apr-02 16:52
Gerald Schwab1-Apr-02 16:52 
AnswerRe: What does this code do? Pin
czer4-Apr-02 3:05
czer4-Apr-02 3: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.