顯示具有 dll 標籤的文章。 顯示所有文章
顯示具有 dll 標籤的文章。 顯示所有文章

2014年10月26日 星期日

windows dll share data , using pelles C 7.0R

/*
   dll file must using same folder's dll,
   X:/xx/xxx/my_dll.dll
   O:/ooo/oo/my_dll.dll
 my_dll.dll  =content=  mydll.dll
but loading to memory , it's two different dll.
*/
 
/* below is dll key function and compiler option */
/*
compiler option :  Enable microsoft extension ,   calling conv: __cdecl

*/

#pragma data_seg(".shared")
    int share_var_k = 0;
#pragma data_seg()
#pragma comment(linker, "/section:.shared,RWS")


DLLAPI int WINAPI get_share_var(void)
{   
     return share_var_k;
}

DLLAPI void WINAPI set_share_var(int value)
{   
     share_var_k = value;
}





/* ---- cut ---- */





/* -------------- below is test file function ------*/

int main(int argc, char *argv[])
{
    printf("Hello, world!\n");
    for(int i=0;i<25 br="" i="">    {
        int value=0;
        set_share_var(i);
        Sleep(1000);
        value = get_share_var();
        printf("%d\r\n",value);
    }
    return 0;

2014年10月18日 星期六

lcc-win32 build openeuolua


build a openeuolua.dll for

work for LFW LuaForWindows_v5.1.4-46.exe (from goggle code)

in OpenEUOLua.zip   OpenEUOLua.txt copy rename to -->  openeuolua.c

; make an lib for lcc-win32 usage
copy X:\lua\5.1\lib\lua51.lib
pedump /EXP lua51.lib > 51.exp
buildlib 51.exp lua51_lcc.lib
 
makefile
[code]
SRCDIR=e:\lcc\p\openeuolua
CFLAGS=-I"E:\lcc\p\OpenEUOLua\lua51\include" -I"e:\lcc\include" -DWIN32 -DLUA_BUILD_AS_DLL
CC=$(LCCROOT)\bin\lcc.exe
LINKER=$(LCCROOT)\bin\lcclnk.exe
OBJS=\
    openeuolua.obj

LIBS=e:\lcc\p\openeuolua\lua51_lcc.lib
EXE=e:\lua\5.1\clibs\openeuolua.dll

$(EXE):    $(OBJS) Makefile
    $(LINKER)  -s -dll -entry DllMain -nounderscores -o e:\lua\5.1\clibs\openeuolua.dll $(OBJS) $(LIBS)

# Build openeuolua.c
OPENEUOLUA_C=\
    $(SRCDIR)\lua51\include\lauxlib.h\
    $(SRCDIR)\lua51\include\lua.h\
    $(SRCDIR)\lua51\include\luaconf.h\

openeuolua.obj: $(OPENEUOLUA_C) $(SRCDIR)\openeuolua.c
    $(CC) -c $(CFLAGS) $(SRCDIR)\openeuolua.c

link:
    $(LINKER)  -s -dll -entry DllMain -nounderscores -o e:\lua\5.1\clibs\openeuolua.dll $(OBJS) $(LIBS)

clean:
    del $(OBJS) openeuolua.dll
[/code]

build lua dll module in mingw/msys

1. install mingw/msys , base_mingw,base_msys,g++
2. postinstall msys

3. download & build lua 5.1.5
    make mingw
4. write a dll4lua.c   
    gcc  -O2  -c  -o dll4lua.o  dll4lua.c
    gcc  -O    -shared -o dll4lua.dll  dll4lua.o -llua

食用油

豆大芥小 加熱均 又非橄㰖 造假多 油麻菜籽 螻蟻命 自求多福 身安康 目前 我推 芥花油,較耐高溫. 從成份上來看 橄㰖>芥花>大豆 . 從CP/造假上來看 又不推 高價 橄㰖了, 可能 摻其它大豆等油/加色素等, 最近新聞 數千公頓大豆 不知所踪, 合理推測, 是...