Click here to Skip to main content
15,926,939 members
Home / Discussions / COM
   

COM

 
GeneralNeed help in accessing ATL COM property of type coclass. Pin
bahruddina15-Nov-02 5:38
bahruddina15-Nov-02 5:38 
GeneralRe: Need help in accessing ATL COM property of type coclass. Pin
Hans Ruck17-Nov-02 4:44
Hans Ruck17-Nov-02 4:44 
Generalpass an array from C# to a COM object Pin
gharrison14-Nov-02 21:09
gharrison14-Nov-02 21:09 
GeneralRe: pass an array from C# to a COM object Pin
Christian Graus17-Nov-02 8:24
protectorChristian Graus17-Nov-02 8:24 
QuestionCComPtr or CComQIPtr??? Pin
LukeV14-Nov-02 4:08
LukeV14-Nov-02 4:08 
AnswerRe: CComPtr or CComQIPtr??? Pin
ian mariano14-Nov-02 6:56
ian mariano14-Nov-02 6:56 
GeneralSAFEARRAY - Multidimensions Pin
Dave Loeser13-Nov-02 6:16
Dave Loeser13-Nov-02 6:16 
GeneralRe: SAFEARRAY - Multidimensions Pin
Vi217-Nov-02 20:45
Vi217-Nov-02 20:45 
If you want to have the VB array (a to b) in i-th dimension bounds, you should initialize the SABounds[i].lLbound = a; and SABounds[i].cElements = b-a+1; As a rule, a is equal 0, so cElements = b-0+1 and = b+1.

But RecordCount is equal to size of array (cElements), therefore, you haven't to add extra "1". Your array in VB will have (0 to x-1) bounds.

// Setup/Create our SAFEARRAY
SAFEARRAYBOUND SABounds[2];
SABounds[0].cElements = (DWORD)pRsHPASReports->RecordCount;
SABounds[0].lLbound = 0;
SABounds[1].cElements = 2; // You have only [0] and [1] in this dimension. Ok?
SABounds[1].lLbound = 0; 

// Initialize the variant and set it up as an array of variants
VariantInit(pReportTypes);
pReportTypes->vt = VT_VARIANT | VT_ARRAY;
pReportTypes->parray = SafeArrayCreate(VT_VARIANT, 2, SABounds);

lLoop = 0; // SABounds[0].lLbound
while(! pRsHPASReports->IsEOF)
{
	ldimension[0] = lLoop++;
	ldimension[1] = 0; // SABounds[1].lLbound

	CComVariant bstrTmp( pRsHPASReports->Fields->Item["RptType"]->Value );
	TESTHR(SafeArrayPutElement( pReportTypes->parray, ldimension, &bstrTmp ));

	ldimension[1]++;
	CComVariant bstrTmp2( pRsHPASReports->Fields->Item["Title"]->Value );
	TESTHR(SafeArrayPutElement( pReportTypes->parray, ldimension, &bstrTmp2 ));

	pRsHPASReports->MoveNext();
}


With best wishes,
Vita
GeneralDealing with CWnd* as parents Pin
Dave_12-Nov-02 3:41
Dave_12-Nov-02 3:41 
GeneralMFC ActiveX and Admin rights Pin
Paul Selormey11-Nov-02 20:15
Paul Selormey11-Nov-02 20:15 
GeneralRe: MFC ActiveX and Admin rights Pin
Renjith Ramachandran22-Nov-02 2:24
Renjith Ramachandran22-Nov-02 2:24 
GeneralPassing files Pin
Scracha11-Nov-02 4:48
Scracha11-Nov-02 4:48 
GeneralRe: Passing files Pin
Steve S11-Nov-02 6:58
Steve S11-Nov-02 6:58 
GeneralRe: Passing files Pin
Scracha13-Nov-02 3:42
Scracha13-Nov-02 3:42 
GeneralExcel Component holds up memory Pin
yslim10-Nov-02 21:37
yslim10-Nov-02 21:37 
GeneralPractical question regarding largish com (ATL) based application Pin
Member 969-Nov-02 19:45
Member 969-Nov-02 19:45 
GeneralRe: Practical question regarding largish com (ATL) based application Pin
Anonymous10-Nov-02 5:02
Anonymous10-Nov-02 5:02 
GeneralSerializing COM Components Pin
Tometa Software8-Nov-02 21:25
Tometa Software8-Nov-02 21:25 
GeneralRe: Serializing COM Components Pin
Stephane Rodriguez.8-Nov-02 21:37
Stephane Rodriguez.8-Nov-02 21:37 
GeneralDCOM, domains, and the guest account Pin
Anonymous8-Nov-02 10:03
Anonymous8-Nov-02 10:03 
GeneralActiveX Control signature Pin
Haabit8-Nov-02 3:38
Haabit8-Nov-02 3:38 
GeneralProgrammer's Reference Pin
Haakon S.8-Nov-02 0:35
Haakon S.8-Nov-02 0:35 
GeneralCommunication between 2 ActiveX Ctrls in a browser( HTML page) Pin
sanskypotov7-Nov-02 19:53
sanskypotov7-Nov-02 19:53 
GeneralIDL syntax for SAFEARRAY parameters Pin
nebbish6-Nov-02 10:14
nebbish6-Nov-02 10:14 
GeneralRe: IDL syntax for SAFEARRAY parameters Pin
Steve S7-Nov-02 21:31
Steve S7-Nov-02 21:31 

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.