Click here to Skip to main content
16,006,065 members
Home / Discussions / COM
   

COM

 
Generalmeaning of HRESULTs in Office Automation Pin
moredip14-Apr-03 12:00
moredip14-Apr-03 12:00 
Questionhow to get client's icon? Pin
mojimejl12-Apr-03 5:06
mojimejl12-Apr-03 5:06 
AnswerRe: how to get client's icon? Pin
pba_13-Apr-03 7:40
pba_13-Apr-03 7:40 
AnswerRe: how to get client's icon? Pin
Brian Shifrin13-Apr-03 17:41
Brian Shifrin13-Apr-03 17:41 
Questioni am new in COM: what are COMs ? Pin
Sendel11-Apr-03 15:53
Sendel11-Apr-03 15:53 
AnswerRe: i am new in COM: what are COMs ? Pin
Michael Dunn11-Apr-03 16:20
sitebuilderMichael Dunn11-Apr-03 16:20 
GeneralRe: i am new in COM: what are COMs ? Pin
Sendel11-Apr-03 16:40
Sendel11-Apr-03 16:40 
General_RecordsetPtr Detach / Debug Exception Pin
Ecator11-Apr-03 6:52
Ecator11-Apr-03 6:52 
Hi!

I'm new to posting here, but I wanted to start out with an annoying
feature that was bugging me. I get to do a lot of the weird programming
assignments.....

I've got a ATL/COM Service that has one Simple ATL Apartment object. It takes a flat
file record and converts it into a one row recordset with appropriate columns.

It has a method to pass a detached recordset back and forth, such as this:

[id(2), helpstring("method ReadRecord")] HRESULT ReadRecord([in, out] VARIANT *iRetVal, [out, retval] IUnknown **ppRecordset);

STDMETHODIMP CGenericObj::ReadRecord(VARIANT *iRetVal, IUnknown **ppRecordset)

It works perfectly fine, except when you get into the debugger, and only once you get
out of the raw_ReadRecord.

First-chance exception in Generic.exe (KERNEL32.DLL): 0xE06D7363: Microsoft C++ Exception.

But, everything works fine, even in release mode. When I don't detach the recordset, the message does not surface. When the object is passed back in through:

STDMETHODIMP CGenericObj::WriteRecord(IUnknown *pRecordset, VARIANT *iRetVal)

It does the same thing.

The code to generate it:

_RecordsetPtr m_pRs;
m_pRs.CreateInstance(__uuidof(Recordset));

(read field loop)

m_pRs->Fields->Append(_T((LPCSTR)pField.sExternalName), lEnum, lFieldSize, adFldIsNullable);

(read field loop end)

_variant_t vNull(DISP_E_PARAMNOTFOUND,VT_ERROR);
m_pRs->Open(vNull,vNull,adOpenForwardOnly, adLockOptimistic, adCmdUnknown);

m_pRs->AddNew();

(read file field loop)

m_pRs->Update();

*ppRs = m_pRs.Detach();

Just curious what you coders think....

GeneralRe: _RecordsetPtr Detach / Debug Exception Pin
pba_13-Apr-03 7:31
pba_13-Apr-03 7:31 
GeneralRe: _RecordsetPtr Detach / Debug Exception Pin
Ecator13-Apr-03 17:53
Ecator13-Apr-03 17:53 
GeneralRe: _RecordsetPtr Detach / Debug Exception Pin
pba_14-Apr-03 4:11
pba_14-Apr-03 4:11 
GeneralRe: _RecordsetPtr Detach / Debug Exception Pin
Ecator14-Apr-03 6:20
Ecator14-Apr-03 6:20 
QuestionHow to load multiple internet shortcuts by IUniformResourceLocator Pin
sning10-Apr-03 7:48
sning10-Apr-03 7:48 
GeneralAccess Denied When Automating PowerPoint with VC++ Pin
User 15945410-Apr-03 5:08
User 15945410-Apr-03 5:08 
QuestionHow to keep a C++ com dll in memory? Pin
Anonymously10-Apr-03 3:52
Anonymously10-Apr-03 3:52 
AnswerRe: How to keep a C++ com dll in memory? Pin
pba_10-Apr-03 4:14
pba_10-Apr-03 4:14 
GeneralRe: How to keep a C++ com dll in memory? Pin
Anonymously10-Apr-03 4:59
Anonymously10-Apr-03 4:59 
GeneralRe: How to keep a C++ com dll in memory? Pin
pba_13-Apr-03 7:17
pba_13-Apr-03 7:17 
GeneralClient with flexible server name. Pin
MauriceMG9-Apr-03 22:40
MauriceMG9-Apr-03 22:40 
GeneralRe: Client with flexible server name. Pin
pba_10-Apr-03 4:17
pba_10-Apr-03 4:17 
GeneralRe: Client with flexible server name. Pin
MauriceMG10-Apr-03 20:04
MauriceMG10-Apr-03 20:04 
GeneralDetecting the apartment Pin
Dave Bryant9-Apr-03 9:54
Dave Bryant9-Apr-03 9:54 
GeneralRe: Detecting the apartment Pin
Vi29-Apr-03 23:14
Vi29-Apr-03 23:14 
GeneralRe: Detecting the apartment Pin
Dave Bryant10-Apr-03 9:51
Dave Bryant10-Apr-03 9:51 
GeneralPassing safearray of UDTs Pin
bharanidharan9-Apr-03 9:32
bharanidharan9-Apr-03 9:32 

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.