title: issues in wrapping c++ dll for php5 extension
body: <p>I am trying to create php 5.2.17 extension for my c++ dll. Iam using Visual studio 2005 on windows xp with Sambar Server 7.0.
  I have two questions: </p>
  
  <ol>
  <li><p>I could not able to include c++ things (strings or STL maps) in my code.. its giving error like: "PHP has encountered an Access Violation at 00CF421B". How can I use strings and STL maps in my dll.</p></li>
  <li><p>I am trying to create a c++ dll which contains a function with 3 parameters of string type and return 2nd string of those 3.</p></li>
  </ol>
  
  <p>Below is the code : </p>
  
  <pre><code>PHP_FUNCTION(add){
      char* a;
      char* b;
      char* c;
  
      if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sss", &amp;a,&amp;b,&amp;c) == FAILURE) {
          RETURN_STRING("Bad parameters!", true);
      }
  
      //string ss=a;
      //ss=ss+b;
      //memset(a,0,30);
      //strcpy(a,ss.c_str());
      //php_printf("a : %s b : %s ",a,b);
      RETURN_STRING(b,1);
  }
  </code></pre>
  
  <p>php file contains :</p>
  
  <pre><code>$a="abc";
  $b="def";
  $c="ghi";
  $result = add($a,$b,$c);
  print "Calling add($a,$b,$c) returned $result";
  </code></pre>
  
  <p>-> here 1st string is returning fine when two parameters were set for this function.</p>
  
  <p>-> when tried to return 2nd string with two parameters for this function then i am getting an error : "PHP has encountered an Access Violation at 014AE07C"</p>
  
  <p>-> when tried with 3 parameters like the above code then my sambar server is closing by itself.. no chance of seeing output.</p>
  
  <p>Why this strange behaviour, where am I going wrong ?</p>
  
  <p>Thanks in Advance</p>
  
  <p>Anil</p>