Click here to Skip to main content
15,900,378 members
Home / Discussions / COM
   

COM

 
AnswerRe: Apartment model, COM and misery Pin
Lim Bio Liong9-Sep-06 22:00
Lim Bio Liong9-Sep-06 22:00 
GeneralRe: Apartment model, COM and misery Pin
BadJerry11-Sep-06 5:09
BadJerry11-Sep-06 5:09 
GeneralRe: Apartment model, COM and misery Pin
Lim Bio Liong11-Sep-06 5:21
Lim Bio Liong11-Sep-06 5:21 
QuestionCOleDispatchException when creating comments for Excel Worksheets Pin
Crash27-Sep-06 10:00
Crash27-Sep-06 10:00 
AnswerRe: COleDispatchException when creating comments for Excel Worksheets Pin
Steve S7-Sep-06 21:51
Steve S7-Sep-06 21:51 
GeneralRe: COleDispatchException when creating comments for Excel Worksheets Pin
Crash28-Sep-06 1:34
Crash28-Sep-06 1:34 
GeneralRe: COleDispatchException when creating comments for Excel Worksheets Pin
Crash28-Sep-06 4:27
Crash28-Sep-06 4:27 
Questionthe problem of SafeArray Pin
XPointer7-Sep-06 7:16
XPointer7-Sep-06 7:16 
i wanna contruct a safearray,which is made up of VARIANT type element,which vt = VT_BSTR;i use SafeArrayCreate to create the safearray,then use SafeArrayPutElement to add element into array one by one,it's ok,and (this is just my test code) if i use SafeArrayGetElement to get the element that just now put into the array,on the neck of the SafeArrayPutElement at the same cycle statement,it's all right.
but if i write the SafeArrayGetElement out of the same cycle,the program
crashed.why?it's so strange.
my codes are as follows:
VARIANT *pvarCis = new VARIANT[nCount];
for(int i = 0;i < nCount;i++)
{
    CComBSTR bstrCi(arCi.GetAt(i)); //CStringArray arCi;

    (pvarCis + i)->vt = VT_BSTR;
    (pvarCis + i)->bstrVal = bstrCi.Copy();
}

SAFEARRAYBOUND rgsabound[1];
rgsabound[0].lLbound = 0;
rgsabound[0].cElements = nCount;

SAFEARRAY * psa = NULL;
psa = SafeArrayCreate(VT_VARIANT, 1, rgsabound);
if(psa)
{
    //psa->fFeatures = FADF_VARIANT;
    psa->cbElements = nCount;
    VARIANT *pvarCellInfo = new VARIANT[nCount];

    HRESULT hresult;
    for(long lIndex = 0; lIndex < nCount; lIndex++)
    {
        hresult = SafeArrayPutElement(psa,&lIndex,&pvarCis[lIndex]);
        if(FAILED(hresult))
            return;
        //this SafeArrayGetElement is ok
        hresult = SafeArrayGetElement(psa,&lIndex,&pvarCellInfo[lIndex]);
        if(FAILED(hresult))
            return;
    }

    for(lIndex = 0;lIndex < nCount; lIndex++)
    {
        //error occurred : 0xC0000005:Access Violation
        hresult = SafeArrayGetElement(psa,&lIndex,&pvarCellInfo[lIndex]);
        if(FAILED(hresult))
            return;
    }
    ... ...
}

AnswerRe: the problem of SafeArray Pin
Hans Ruck8-Sep-06 2:46
Hans Ruck8-Sep-06 2:46 
AnswerRe: the problem of SafeArray Pin
Lim Bio Liong8-Sep-06 3:46
Lim Bio Liong8-Sep-06 3:46 
AnswerRe: the problem of SafeArray Pin
BadJerry8-Sep-06 5:23
BadJerry8-Sep-06 5:23 
GeneralRe: the problem of SafeArray Pin
XPointer10-Sep-06 2:24
XPointer10-Sep-06 2:24 
QuestionUsing COM with ASP.Net Pin
hsv0037-Sep-06 5:46
hsv0037-Sep-06 5:46 
QuestionDLL does not contain any types that can be registered for COM Interop Pin
Calgary Randy6-Sep-06 10:13
Calgary Randy6-Sep-06 10:13 
AnswerRe: DLL does not contain any types that can be registered for COM Interop Pin
Mike Dimmick7-Sep-06 3:59
Mike Dimmick7-Sep-06 3:59 
QuestionRe: DLL does not contain any types that can be registered for COM Interop Pin
Calgary Randy11-Sep-06 20:24
Calgary Randy11-Sep-06 20:24 
AnswerRe: DLL does not contain any types that can be registered for COM Interop Pin
Calgary Randy11-Sep-06 20:29
Calgary Randy11-Sep-06 20:29 
QuestionUsing C#/Office .NET Programmability Pin
Andrew Mercer5-Sep-06 22:44
Andrew Mercer5-Sep-06 22:44 
AnswerRe: Using C#/Office .NET Programmability Pin
Pavan K Kulkarni8-Sep-06 3:51
Pavan K Kulkarni8-Sep-06 3:51 
QuestionIs it possible to convert Visual C++ program with GUI into COM DLL or ActiveX ? Pin
peysock5-Sep-06 6:34
peysock5-Sep-06 6:34 
QuestionIdentifying Dynamic Controls click Pin
vijayaBTS5-Sep-06 0:52
vijayaBTS5-Sep-06 0:52 
GeneralRe: Identifying Dynamic Controls click Pin
voorugonda prashanth6-Sep-06 0:51
voorugonda prashanth6-Sep-06 0:51 
QuestionDLL Conversion to 2005 to 2003 Pin
Charith Jayasundara4-Sep-06 7:13
Charith Jayasundara4-Sep-06 7:13 
QuestionError while accssing methods of interfaces passed in safearray Pin
satindar_kumar4-Sep-06 0:56
satindar_kumar4-Sep-06 0:56 
AnswerRe: Error while accssing methods of interfaces passed in safearray Pin
Lim Bio Liong10-Sep-06 5:37
Lim Bio Liong10-Sep-06 5:37 

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.