Hi All!

From: Date: Tue, 29 Mar 2005 09:10:27 +0000
Subject: Hi All!
Groups: php.pecl.dev 
Request: Send a blank email to pecl-dev+get-2227@lists.php.net to get a copy of this message
Hi! i just subscribed to this list because i'm writing a php extension and need some help with it. My extension is a native Windows Binding, so i can write windows apps in php. Everything works fine so far, but i got a problem with the window procedure callback function. Since that function is not exported (not a zend function), i have to call TSRMLS_FETCH() as far as i know. But somehow the compiler/linker (MSVC .NET 2003) cannot find the "compiler_globals_id" symbol, and i get the following: wex_proc.obj : error LNK2019: unresolved external symbol _compiler_globals_id referenced in function _wex_def_wndproc@16 c:\php5_win\ext\php_wex.dll : fatal error LNK1120: 1 unresolved externals i had a function from the WinBinder extension to compare my code to, but i couldn't find anything different there. So i wondered if anyone in here could help me with this? I'll include the code of my function in this mail in case you want to see it. As im anyway mailing to the list, i'd like to introduce my extension to you too ;o) it is/should/will be called WEX (WindowsEXtension). Please tell me wha you think of this... Regards and Thanks in advance, Markus Duft (AUSTRIA / GRAZ ;o) , so excuse my bad english) ======wex_proc.c====== LRESULT CALLBACK wex_def_wndproc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) { zval *fname, *return_value = NULL, **params[6], *p1, *p2, *p3, *p4, *p5, *p6; int i; BOOL bRet; long retval; TSRMLS_FETCH(); for(i=0; i < WEX_MAXWPROCCOUNT; i++) { if(wex_wndproc[i]) { if(wex_wndproc[i]->hWindow->hWindow == hWnd) { if(wex_wndproc[i]->szCallback) { MAKE_STD_ZVAL(fname); ZVAL_STRING(fname, wex_wndproc[i]->szCallback, 1); if(!zend_is_callable(fname, 0, &wex_wndproc[i]->szCallback)) { continue; } MAKE_STD_ZVAL(p1); ZVAL_LONG(p1, (long)wex_wndproc[i]->hWindow); MAKE_STD_ZVAL(p2); ZVAL_LONG(p2, (long)msg); MAKE_STD_ZVAL(p3); ZVAL_LONG(p3, (long)LOWORD(wParam)); MAKE_STD_ZVAL(p4); ZVAL_LONG(p4, (long)HIWORD(wParam)); MAKE_STD_ZVAL(p5); ZVAL_LONG(p5, (long)LOWORD(lParam)); MAKE_STD_ZVAL(p6); ZVAL_LONG(p6, (long)HIWORD(lParam)); params[0] = &p1; params[1] = &p2; params[2] = &p3; params[3] = &p4; params[4] = &p5; params[5] = &p6; bRet = call_user_function_ex( CG(function_table), NULL, fname, &return_value, 6, params, 0, NULL TSRMLS_CC ); if(bRet != SUCCESS) { continue; } retval = Z_LVAL_P(return_value); zval_ptr_dtor(&return_value); return (LRESULT)retval; } } } } return 0; //ONLY WHILE TESTING... /*switch(msg) { case WM_DESTROY: PostQuitMessage(0); break; default: return DefWindowProc(hWnd, msg, wParam, lParam); } return 0;*/ }

« previous php.pecl.dev (#2227) next »