views:

69

answers:

0

Hello,

I am using Inline asm in C++/CLI. Horrible problem infact could be a bug I obsereved. I passed vector from one function call to another. If I comment the whole code snippet of _asm{....some assembly code here} inside the called function where vector used which are provided to it from other function, then no problem whole vector gets fine and copied to argument of called function successfully in correct manner.

But If uncmment _asm{} I mean if I use _asm{} patch in called function , it corrupts the whole vectors of objects infact whole object corrupts which contains vectors and other strings data and it just shows for every data inside object like npos=4294967295.

What is it? Why this is so? Is CLI creating problem or I am using inline asm i wrong way?

Kindly help me out , as I am stuck here.

             strParamType  = strReturnType;
             if(strParamType.find("IDispatch")!=string::npos)
             {
                 IDispatch* pIDispatch; 
                 _asm
                 {
                   mov  esi,esp 
                       lea  eax,[pIDispatch] 
                   push eax
             }
              }

Here If I dont write anything at all inside _asm{} even then problem occurs which I described.

Regards Usman