Re: TAPI sample in VC++ using MFC
From: DBard (DBard_at_discussions.microsoft.com)
Date: 08/18/04
- Next message: William DePalo [MVP VC++]: "Re: TAPI sample in VC++ using MFC"
- Previous message: William DePalo [MVP VC++]: "Re: TAPI sample in VC++ using MFC"
- In reply to: William DePalo [MVP VC++]: "Re: TAPI sample in VC++ using MFC"
- Next in thread: William DePalo [MVP VC++]: "Re: TAPI sample in VC++ using MFC"
- Reply: William DePalo [MVP VC++]: "Re: TAPI sample in VC++ using MFC"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 18 Aug 2004 11:47:02 -0700
I modified your sample into an MFC program and am new to ATL/COM programming.
It seems as though I can put the CoInitializeEx just about anywhere, but no
matter where I put the CoUninitialize I get the crash. I've tried putting it
in both the Dlg's and base file's code in areas which dismiss the program. I
did have both in the function which did the TAPI stuff. How do I tell if the
function dismissed it itself? Any other thoughts?
Regarding 2.x vs. 3.x I need the H323 and G711 functionality, which MS
documentation leads me to believe is only available in 3.x. That true?
- David
"William DePalo [MVP VC++]" wrote:
> "DBard" <DBard@discussions.microsoft.com> wrote in message
> news:C1475692-E8B9-4C63-911A-D4B4C13E3DA9@microsoft.com...
> > One problem remains in the sample code.
>
> Really?
>
> > I get an application error and a
> > crash when the MakeTapiCall function exits.
>
> In my _unmodified_ sample? :-)
>
> > I've been able to narrow it down
> > to:
> >
> > pEnumAddress = pTapi->EnumerateAddresses();
> >
> > Any ideas? Does this have to be "de-enumerated" or something?
>
> Are you new to ATL/COM? ATL "smart" COM-pointer classes call Release() when
> the object goes out of scope. For "automatic" (aka stack-based ) objects
> that happens on leaving the function where the are defined. If that function
> has already called CoUninitialize() then COM is gone and bad things can
> happen. That's why in my litle sample you'll find the CoInitialize() and
> CoUninitialize() in main() and the TAPI/COM stuff in a separate function.
>
> Now, I'm not saying this is the problem, but it is a common C++/ATL/COM
> beginner's mistake. It is something to look at. I don't have any way of
> testing H.323 here but I would expect you'd just have to change the
> destination number and the destination type in my sample. If doing that
> doesn't work then I don't know what the problem is.
>
> Just by the way, I only cooked up that sample because someone asked. I
> remain convinced that TAPI version 2.1 (procedural though it is), with a set
> of application classes to the problem at hand is the way to go. Just my
> opinion, others may (and do) disagree.
>
> > Thanks again.
>
> You are welcome.
>
> Regards,
> Will
>
>
>
- Next message: William DePalo [MVP VC++]: "Re: TAPI sample in VC++ using MFC"
- Previous message: William DePalo [MVP VC++]: "Re: TAPI sample in VC++ using MFC"
- In reply to: William DePalo [MVP VC++]: "Re: TAPI sample in VC++ using MFC"
- Next in thread: William DePalo [MVP VC++]: "Re: TAPI sample in VC++ using MFC"
- Reply: William DePalo [MVP VC++]: "Re: TAPI sample in VC++ using MFC"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|