ʹÓÃCDHtmlDialog £¬ÊµÏÖjavascript µ÷ÓÃC++
.h Îļþ
class CHtmlSkinDlg : public CDHtmlDialog
{
¡£¡£¡£¡£¡£
DECLARE_DISPATCH_MAP()
// !!! ¸²¸Ç»ùÀàµÄÕâ¸ö·½·¨
BOOL CanAccessExternal()
{
// we trust all com object (haha, you can make virus)
return TRUE;
}
// ×Ô¶¨Òå·½·¨
BOOL set_pos(int x, int y);
}
.cppÎļþ
BEGIN_DISPATCH_MAP(CHtmlSkinDlg, CDHtmlDialog)
DISP_FUNCTION(CHtmlSkinDlg, "set_pos", set_pos, VT_BOOL, VTS_I4 VTS_I4)
END_DISPATCH_MAP()
.html Îļþ
<SCRIPT type=text/javascript>
//<![CDATA[
window.external.set_pos(600, 400);
//]]>
</SCRIPT>
Ïà¹ØÎĵµ£º
43¡¢JavaScriptÖ÷Ò³µ¯³ö´°¿Ú¼¼ÇÉ
´°¿ÚÖм䵯³ö
<script>
window.open("http://www.cctv.com","","width=400,height=240,top="+(screen.availHeight-240)/2+",left="+(screen.availWidth-400)/2);
</script>
============
<html>
<head>
<script language="LiveScript">
fu ......
C·ç¸ñ×Ö·û´®£º¶Ô×Ö·û´®½øÐвÙ×÷µÄ C º¯Êý¶¨ÒåÔÚÍ·Îļþ<cstring>ÖУ»
1. ×Ö·û´®¶¨Ò壺char* result£»
2. ×Ö·û´®µÄ×îºóÒ»¸ö×Ö·ûÊÇnull×Ö·û£¨'\0'£©£¬¿ÉÒÔͨ¹ýÕâ¸ö×Ö·ûÈ·¶¨×Ö·û´®µÄ½áβ¡£
3. strlen()·µ»ØµÄÊÇ×Ö·û´®µÄ´óС£»Òò´Ë£¬ ......
ʹÓÃC/C++À©Õ¹Python
·Òë:
gashero
Èç¹ûÄã»áÓÃC£¬ÊµÏÖPythonǶÈëÄ£¿éºÜ¼òµ¥¡£ÀûÓÃÀ©Õ¹Ä£¿é¿É×öºÜ¶àPython²»·½±ã×öµÄÊÂÇ飬ËûÃÇ¿ÉÒÔÖ±½Óµ÷ÓÃC¿âºÍϵͳµ÷Óá£
ΪÁËÖ§³ÖÀ©Õ¹£¬Python API¶¨ÒåÁËһϵÁк¯Êý¡¢ºêºÍ±äÁ¿£¬ÌṩÁ˶ÔPythonÔËÐÐʱϵͳµÄ·ÃÎÊÖ§³Ö¡£PythonµÄC APIÓÉCÔ´Âë×é³É£¬²¢°üº¬ “Python.h” Í·Îļ ......
#include < ruby.h > //
static int id_sum;
int Values[] = {5, 10 ,15,-1,20,0};
static VALUE wrap_sum(VALUE args)
{
VALUE * values = (VALUE *) args;
VALUE summer = values[0];
VALUE max = values[1];
return rb_funcall(summer,id_sum,1,max);
}
static VALUE ......