Click here to Skip to main content
15,887,477 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Problem in Creating a directory Pin
André Kraak6-Nov-11 5:07
André Kraak6-Nov-11 5:07 
AnswerRe: Problem in Creating a directory Pin
Richard MacCutchan6-Nov-11 5:11
mveRichard MacCutchan6-Nov-11 5:11 
AnswerRe: Problem in Creating a directory Pin
User 74293386-Nov-11 6:34
professionalUser 74293386-Nov-11 6:34 
GeneralRe: Problem in Creating a directory Pin
Chuck O'Toole6-Nov-11 10:38
Chuck O'Toole6-Nov-11 10:38 
AnswerRe: Problem in Creating a directory Pin
«_Superman_»6-Nov-11 15:27
professional«_Superman_»6-Nov-11 15:27 
Questionupload a file from c++ using visual studio MFC to a php script Pin
carmaxuxo5-Nov-11 1:36
carmaxuxo5-Nov-11 1:36 
AnswerRe: upload a file from c++ using visual studio MFC to a php script Pin
Chuck O'Toole5-Nov-11 3:18
Chuck O'Toole5-Nov-11 3:18 
QuestionCan't clear Variant, debug help Pin
jkirkerx4-Nov-11 20:31
professionaljkirkerx4-Nov-11 20:31 
I have this VARIANT, called varTemp. At the end of the function, when cleanup occurs, I cant't get rid of the first value in it. I can clear the second value, which is Dispatch = 0x017a8618, and any value past 1

So when va.pa[j++] = varTemp, in debug it's SafeArray of Variant = [1] Dispatch = 0x17a8458

When the memory clears at the end of the function, the in the comutil.h in the code below

inline _variant_t::~_variant_t() throw()
::VariantClear(this);

this = safearray = 0x001afb50 safearray of VARIANT = [1](DISPATCH = 0x017a8458)

just bombs, 0xC000005: Access violation reading location 0x017a8458.

I can't figure out what is locking the memory, or there is something I did not unlock or release that is pointing to that address.

C#
for (i = lSLBound, j = 0; i <= lSUBound; ++i) {
            VARIANT varTemp;
            VariantInit(&varTemp);

            hr = SafeArrayGetElement(V_ARRAY(&var), &i, &varTemp);
            RETURN_ON_FAILURE(hr);

            if (VT_DISPATCH != V_VT(&varTemp))
            return E_ADS_CANT_CONVERT_DATATYPE;

            hr = V_DISPATCH(&varTemp)->QueryInterface(__uuidof(::IISMimeType),(void**) &pADMTs);
            RETURN_ON_FAILURE(hr);

            pADMTs->get_Extension(&bstrMimeExtension);
            pADMTs->get_MimeType(&bstrMimeType);
            printf("%ls -> %ls/n", (LPCWSTR) bstrMimeExtension, (LPCWSTR) bstrMimeType);

            // We can compare the stored values to new values to add here
            if (wcsncmp(bstrMimeExtension, pwszAddExtension, bstrMimeExtension.Length() == 0)) {
                --cVariants;
            }
            else {
                va.pa[j++] = varTemp; <-Dispatch=0x17a8458
            }

            VariantClear(&varTemp);

Generaldev-c++ to "call" another program Pin
RealHigh4-Nov-11 12:05
RealHigh4-Nov-11 12:05 
GeneralRe: dev-c++ to "call" another program Pin
Luc Pattyn4-Nov-11 19:33
sitebuilderLuc Pattyn4-Nov-11 19:33 
GeneralRe: dev-c++ to "call" another program Pin
Pranit Kothari5-Nov-11 1:57
Pranit Kothari5-Nov-11 1:57 
GeneralRe: dev-c++ to "call" another program Pin
RealHigh5-Nov-11 3:10
RealHigh5-Nov-11 3:10 
GeneralRe: dev-c++ to "call" another program Pin
Chuck O'Toole5-Nov-11 3:24
Chuck O'Toole5-Nov-11 3:24 
GeneralRe: dev-c++ to "call" another program Pin
Pranit Kothari5-Nov-11 3:32
Pranit Kothari5-Nov-11 3:32 
GeneralRe: dev-c++ to "call" another program Pin
RealHigh5-Nov-11 10:39
RealHigh5-Nov-11 10:39 
GeneralRe: dev-c++ to "call" another program PinPopular
Chuck O'Toole5-Nov-11 3:05
Chuck O'Toole5-Nov-11 3:05 
GeneralRe: dev-c++ to "call" another program Pin
RealHigh5-Nov-11 10:35
RealHigh5-Nov-11 10:35 
QuestionHow do you model your documents? Pin
Fernando A. Gomez F.4-Nov-11 9:43
Fernando A. Gomez F.4-Nov-11 9:43 
QuestionHow to remove 'The publisher could not be verified. Are you sure you want to run this software?' Pin
DanYELL4-Nov-11 6:48
DanYELL4-Nov-11 6:48 
AnswerRe: How to remove 'The publisher could not be verified. Are you sure you want to run this software?' Pin
Software_Developer4-Nov-11 8:20
Software_Developer4-Nov-11 8:20 
QuestionIShellFolder2::GetDetailsOf method not find details of 2007 and upper MS office files. Pin
Le@rner4-Nov-11 0:28
Le@rner4-Nov-11 0:28 
Question"using system" generates "undeclared" error. _outp also. Pin
RealHigh3-Nov-11 7:38
RealHigh3-Nov-11 7:38 
AnswerRe: "using system" generates "undeclared" error. _outp also. Pin
Goto_Label_3-Nov-11 8:22
Goto_Label_3-Nov-11 8:22 
GeneralRe: "using system" generates "undeclared" error. _outp also. Pin
RealHigh4-Nov-11 8:39
RealHigh4-Nov-11 8:39 
QuestionRe: "using system" generates "undeclared" error. _outp also. Pin
David Crow3-Nov-11 9:49
David Crow3-Nov-11 9:49 

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.