Click here to Skip to main content
15,901,426 members
Home / Discussions / COM
   

COM

 
GeneralFire COM Event from MFC Class Pin
Koep27-May-02 4:59
Koep27-May-02 4:59 
GeneralRe: Fire COM Event from MFC Class Pin
Prem Kumar28-May-02 7:22
Prem Kumar28-May-02 7:22 
Generalserver to client calls Pin
26-May-02 23:08
suss26-May-02 23:08 
GeneralRe: server to client calls Pin
Prem Kumar28-May-02 7:20
Prem Kumar28-May-02 7:20 
GeneralVB Script - Can I sink events - Automation Pin
Sara Burns26-May-02 0:27
Sara Burns26-May-02 0:27 
GeneralRe: VB Script - Can I sink events - Automation Pin
CodeCrew27-May-02 15:45
CodeCrew27-May-02 15:45 
GeneralRe: VB Script - Can I sink events - Automation Pin
Ernest Laurentin14-Jun-02 7:44
Ernest Laurentin14-Jun-02 7:44 
QuestionHelp...floundering...BSTR? Pin
Member 9624-May-02 6:35
Member 9624-May-02 6:35 
Hello, I am using a commercial component in a VC++ app and I'm confounded by the use of BSTR.

The function I need to call was generated from Classwizard by using the Add Class function and pointing it to the .dll that contains the component, it's defined like this:
------
short _clsIIF::ReadIIF(BSTR* PathName)
{
short result;
static BYTE parms[] = VTS_PBSTR;
InvokeHelper(0x60030024, DISPATCH_METHOD, VT_I2, (void*)&result, parms,PathName);
return result;
}
----

The Microsoft docs say to use _bstr_t instead of BSTR, however the compiler won't accept any form of casting of _bstr_t which according to the docs is how to return the encapsulated BSTR object. The only solution I have been able to come up with that works is this:
---------------------
_bstr_t b(strPathToIIF);//strPathToIIF is a CString
BSTR B;
B = b.copy();
lResult=iif.ReadIIF(&B);
-----------------

It works fine, but it's very obviously an inelegant way of doing it, any help would be very much appreciated. The component I'm using has Visual Basic docs only and I don't know anything about VB and only slightly more about COM.

- John
AnswerRe: Help...floundering...BSTR? Pin
soptest24-May-02 7:19
soptest24-May-02 7:19 
GeneralRe: Help...floundering...BSTR? Pin
Member 9624-May-02 7:36
Member 9624-May-02 7:36 
GeneralRe: Help...floundering...BSTR? Pin
soptest24-May-02 9:14
soptest24-May-02 9:14 
GeneralRe: Help...floundering...BSTR? Pin
Member 9624-May-02 10:17
Member 9624-May-02 10:17 
GeneralRe: Help...floundering...BSTR? Pin
Jason Henderson24-May-02 18:51
Jason Henderson24-May-02 18:51 
AnswerRe: Help...floundering...BSTR? Pin
Mazdak25-May-02 20:59
Mazdak25-May-02 20:59 
Generalhelp bluetooth. Pin
23-May-02 9:14
suss23-May-02 9:14 
GeneralRe: help bluetooth. Pin
soptest23-May-02 9:14
soptest23-May-02 9:14 
GeneralRe: help bluetooth. Pin
David Wulff23-May-02 16:26
David Wulff23-May-02 16:26 
GeneralRe: help bluetooth. Pin
Henrik Husted23-May-02 17:26
Henrik Husted23-May-02 17:26 
GeneralDCOM server crash!!! Pin
Jason Henderson23-May-02 6:48
Jason Henderson23-May-02 6:48 
GeneralRe: DCOM server crash!!! Pin
soptest23-May-02 7:34
soptest23-May-02 7:34 
GeneralRe: DCOM server crash!!! Pin
Jason Henderson23-May-02 16:18
Jason Henderson23-May-02 16:18 
GeneralRe: DCOM server crash!!! Pin
Jason Henderson24-May-02 18:47
Jason Henderson24-May-02 18:47 
GeneralRe: DCOM server crash!!! Pin
Vi224-May-02 3:30
Vi224-May-02 3:30 
GeneralSign Files! Pin
erasmo23-May-02 6:01
erasmo23-May-02 6:01 
GeneralRe: Sign Files! Pin
Matt Philmon24-May-02 12:18
Matt Philmon24-May-02 12:18 

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.