VIDE
http://www.objectcentral.com/objectcentral/vide.htm
+++++仿佛轻云应笑我--相携水岸弄朝霞--此生只为听天籁--坐拥书城看落花+++++
The CMT project has adopted OTcl as the base for the CMT Media Playback API, but unfortunately found MIT Version 0.96 to be lacking a couple of needed features, as well as not being compatible with Tcl/Tk 8.0. We are therefore including our modified version of OTcl with CMT 4.0.
OTcl, short for MIT Object Tcl, is an extension to Tcl/Tk for object-oriented programming. It shouldn't be confused with the IXI Object Tcl extension by Dean Sheenan. Some of OTcl's features as compared to alternatives are:
For documentation about objects, classes, and their capabilities, see the following reference pages:
Python是荷兰人写的,Ruby是日本人写的,Lua是巴西人写的,我这个中国人只能在这里脸红。
---孟岩
不必人人制轮胎,难道你不想躺在轮胎做的吊床上休息?
---牡蛎
只选对的,不选贵的。
---路人甲
Python是荷兰人写的,Ruby是日本人写的,Lua是巴西人写的,我这个中国人只能在这里脸红。
Lua是所有动态语言中间平均效率最高的一个。它最初是以Library的形式存在,纯粹只是用作C/C++的一个扩展。现在不仅发展出了解释器,还发展 出了编译器。游戏开发里Lua是使用最广泛的脚本语言。当世界上第一本Lua图书上市销售的时候,一位读者评价道:"Lua is a real gem."
(牡蛎到没有听过Lua、Python或者Ruby的编译器——.NET的冒牌货除外)
Lua很棒,Lua是巴西人发明的,这些都令我不爽,但是还不至于脸红,最多眼红。
让我脸红的是Lua的源代码,百分之一百的ANSI C,一点都不掺杂。在任何支持ANSI C编译器的平台上都可以轻松编译通过。我试过,真是一点废话都没有。
我1996年就学会了C,1997年就跑去研究Win32 API,后来是C++,STL,Java... 直到2002年看到C Interfaces and Implementations,才知道仅仅用ANSI C就可以实现一个强大的优美的library,直到2004年看到Lua的源代码才知道仅仅用ANSI C就可以实现一个非常快的虚拟机、非常棒的解释器/编译器和非常漂亮的语言实现。
这8年我都干什么去了?
---孟岩
http://www.chinaitpower.com/2005September/2005-09-13/204728.html
标签: C/C++, CodeIgnitor, Delphi, Free Pascal, PHP, Python, UML, XHTML
本教程涵盖了Lua5.1。在Lua的每一个版本中都有一些非常不同之处。下面的示例代码将不能在老版本的Lua下运行。如果你仍然在使用老版本而且不愿意升级,不用担心,我已经在文章底部提供了4.0和5.0教程的源代码下载连接。好了,让我们开始吧!
首先,你需要下载Lua。你需要从Lua下载页面去下载源代码。如果你需要编译好了的二进制库,你能在LuaBinaries 中找到你想要的库(lib or dll)。
现在,我们需要安装Lua。在Linux下,你应该先解压文件,然后以root 用户在命令行键入"make linux"和"make linux install"。如果你需要帮助,请参考源代码文件夹中的INSTALL文件。现在,我下载了windows平台下的二进制库包并把它们解压到"C:\ Program Files\lua5.1"。
在Linux下不需要我们做任何设置,但是在windows平台下我们必须配置Visual C++,以便让编译器和连接器找到Lua文件。
现在你可以开始编译你的第一个Lua应用了。
这个程序简短且直接,下面做一点说明:
保存文件为luatest.cpp。如果你直接使用C而不是C++,将文件名改为luatest.c,然后将extern "C"删除。
#include
extern "C" {
#include "lua.h"
#include "lualib.h"
#include "lauxlib.h"
}
/* Lua解释器指针 */
lua_State* L;
int main ( int argc, char *argv[] )
{
/* 初始化Lua */
L = lua_open();
/* 载入Lua基本库 */
luaL_openlibs(L);
/* 运行脚本 */
luaL_dofile(L, "test.lua");
/* 清除Lua */
lua_close(L);
/* 暂停 */
printf( "Press enter to exit…" );
getchar();
return 0;
}
下面是test.lua的内容。
-- simple test
print "Hello, World!" 在Linux下,在命令行键入:
g++ luatest.cpp -llua -ldl -o luatest 然后,键入下列命令运行:
./luatest 如果没有问题,程序将在终端输出Hello, World!
在Visual C++你将需要进行下列步骤:
此时,按F7构建程序。
如果你采用的是dll库,请确保将其放在应用程序的目录中或者windows系统能够找到它的地方。如果你采用的是静态连接库,则不需要。 (Groov0V翻译,转载自CSDN)
谢谢这么简洁清晰的表述
g++ luatest.cpp `pkg-config lua5.1 --libs --cflags` -o luates
Flex is a tool for generating scanners. A scanner, sometimes called a tokenizer, is a program which recognizes lexical patterns in text. The flex program reads user-specified input files, or its standard input if no file names are given, for a description of a scanner to generate. The description is in the form of pairs of regular expressions and C code, called rules. Flex generates a C source file named, "lex.yy.c", which defines the function yylex(). The file "lex.yy.c" can be compiled and linked to produce an executable. When the executable is run, it analyzes its input for occurrences of text matching the regular expressions for each rule. Whenever it finds a match, it executes the corresponding C code.
wxWidgets formerly known as wxWindows is a framework for developing cross-platform GUI applications in C++. Julian Smart started the framework in 1992 at the Artificial Intelligence Applications Institute, University of Edinburgh. In 1995, a port to Xt was released by Markus Holzem. In May 1997, the Windows and the GTK+ ports were merged and put into a CVS repository.
wxWidgets gives you a single, easy-to-use API for writing GUI applications on multiple platforms. Link it with the appropriate library for your platform (Windows/Unix/Mac) and compiler (almost any popular C++ compiler), and your application will adopt the look and feel appropriate to that platform. On top of the great GUI functionality, wxWindows gives you: online help, network programming, streams, clipboard and drag and drop, multithreading, image loading and saving in a variety of popular formats, database support, HTML viewing and printing, and much more.
wxWidgets is a framework very much similar to MFC, except for a few negative points of its own. Those MFC programmers who are aware of the growing number of Linux users and who want to write cross platform GUI applications can use wxWidgets. With wxWidgets, it is very easy to use a framework based on C++ and it has a proven record of 13 years. In fact, wxWidgets is very stable and is supported on:
Currently several major databases, along with other widely used databases, have been tested and supported through the wxODBC classes. The list of supported databases is certain to grow as more users start implementing software with these classes, but at the time of the writing of this document, users have successfully used the classes with the following datasources:
An up-to-date list can be obtained by looking in the comments of the function wxDb::Dbms in db.cpp, or in the enumerated type wxDBMS in db.h.
**dBase is not truly an ODBC datasource, but there are drivers which can emulate much of the functionality of an ODBC connection to a dBase table. See the wxODBC Known Issues section of this overview for details.
http://docs.wxwidgets.org/2.8.0/wx_odbcoverview.html#wxodbcconfiguringyoursystem
The biggest feature is that it is a piece of cake to work with an in memory XML Document from your C++ code. Instead of having to write specialized C++ classes/structures to represent your xml, you can simply use the iDOMDocument as-is. You can think of the XML4WX DOM as a giant Hash table that also has a stateless search and reporting engines built in.
Other XML DOMS (xmllib2, Xerces, MS XML) require you to write large ammounts of C++ code to access the data. If your xml changes, you'll have to re-write the container classes and re-compile your application. With XML4WX, if you write your XPath queries carefully, your C++ code will continue to work.
ResExplorer is a tool that helps you find resources in EXE or DLL files. The first time you use it, it makes a list of files with resource counts. After that, it can show you a selected resource in a selected file (image and attributes). It is possible to save this to a file or the Clipboard. Some formats are available; these are compatible with Visual Studio (such as BMP, AVI, VAW, RES, ICO, or CUR). The program can easily be extended to support all other resource types.
A management of table of the symbols makes it possible to replace the numerical values indicating the resources by symbols such those defined in the files Resource.h
Special tooltips give attribute details.
This tool is an example of MFC usage (sources available): SDI with variable splitter windows (list view, tree view, and scroll view) to show files listing and tree, and a list for resource attributes.
Parts are directly usable in other applications such as for example:
It does not use special classes to read resources in the EXE or DLL files.
A help (in French) is implemented but is it necessary to use this tool.
About the Author
Courbevoie (France)
Downloads
标签: C/C++
标签: C/C++, Code::Blocks, wxWidgets
标签: C/C++
标签: C/C++, Code::Blocks, Compiler, wxWidgets
标签: C/C++, File Format, Java, PHP
| #include "myso01.h" #include <iostream> class ABC : public Base { public: void show(); }; void ABC::show() { std::cout << "ABC" << std::endl; } extern "C" Base* create() { return new ABC; } extern "C" void destroy(Base* p) { delete p; } |
标签: C/C++
////////////////////////////////////////////////////////
#include
#include
BOOL SelfDelete()
{
SHELLEXECUTEINFO sei;
TCHAR szModule [MAX_PATH],
szComspec[MAX_PATH],
szParams [MAX_PATH];
// get file path names:
if((GetModuleFileName(0,szModule,MAX_PATH)!=0) &&
(GetShortPathName(szModule,szModule,MAX_PATH)!=0) &&
(GetEnvironmentVariable("COMSPEC",szComspec,MAX_PATH)!=0))
{
// set command shell parameters
lstrcpy(szParams,"/c del ");
lstrcat(szParams, szModule);
lstrcat(szParams, " > nul");
// set struct members
sei.cbSize = sizeof(sei);
sei.hwnd = 0;
sei.lpVerb = "Open";
sei.lpFile = szComspec;
sei.lpParameters = szParams;
sei.lpDirectory = 0;
sei.nShow = SW_HIDE;
sei.fMask = SEE_MASK_NOCLOSEPROCESS;
// increase resource allocation to program
SetPriorityClass(GetCurrentProcess(),
REALTIME_PRIORITY_CLASS);
SetThreadPriority(GetCurrentThread(),
THREAD_PRIORITY_TIME_CRITICAL);
// invoke command shell
if(ShellExecuteEx(&sei))
{
// suppress command shell process until program exits
SetPriorityClass(sei.hProcess,IDLE_PRIORITY_CLASS);
SetProcessPriorityBoost(sei.hProcess,TRUE);
// notify explorer shell of deletion
SHChangeNoti