Excel writing and reading with pure c API
Reading and Writing Excel file with pure C api in windows system. tested on windows 2000, hope it can help you:
#ifndef _WINXLS_H_
#define _WINXLS_H_
/*============================================================================*
* Include Files
*============================================================================*/
#include <windows.h>
#include <Oleauto.h> /* SysAllocString */
#include <objbase.h> /* CoCreateInstance, ... */
#pragma comment(lib, "ole32.lib")
#include "mytypes.h" /* tInt32, ... */
#include "mydll.h" /* define EXPORT */
/*============================================================================*
* define/typedef/struct
*============================================================================*/
#define DISP_CELL 170
/* XLS file handle */
typedef struct
{
tChar* filepath;
IDispatch* bookhandle;
IDispatch* sheetshandle;
IDispatch** sheethandles; // Array of IDispatch*
IDispatch** rangehandles; // Array of IDispatch*
tUInt32 sheet_count;
}XLSFILE;
/*============================================================================*
* Const variables
*============================================================================*/
/*============================================================================*
* Global variables
*============================================================================*/
/*==============================================
Ïà¹ØÎĵµ£º
Ò»¡¢»ù±¾ÖªÊ¶
Ö¸ÕëºÍÒýÓõÄÉùÃ÷·½Ê½£º
ÉùÃ÷Ö¸Õ룺char* pc;
ÉùÃ÷ÒýÓãºchar& rc = 0;
ËüÃǵÄÇø±ð£º
¢Ù´ÓÏÖÏóÉÏ¿´£¬Ö¸ÕëÔÚÔËÐÐʱ¿ÉÒԸıäÆäËùÖ¸ÏòµÄÖµ£¬¶øÒýÓÃÒ»µ©ºÍij¸ö¶ÔÏó°ó¶¨ºó¾Í²»Ôٸı䡣Õâ¾ä»°¿ÉÒÔÀí½âΪ£ºÖ¸Õë¿ÉÒÔ±»ÖØÐ¸³ÖµÒÔÖ¸ÏòÁíÒ»¸ö²»Í¬µÄ¶ÔÏó¡£µ«ÊÇÒýÓÃÔò×ÜÊÇÖ¸ÏòÔÚ³õʼ»¯Ê±±»Ö¸¶¨µÄ¶Ô ......
C/C++ÖеÄÈÕÆÚºÍʱ¼ä
ͻ񻣼
±¾ÎÄ´Ó½éÉÜ»ù´¡¸ÅÄîÈëÊÖ£¬Ì½ÌÖÁËÔÚC/C++ÖжÔÈÕÆÚºÍʱ¼ä²Ù×÷ËùÓõ½µÄÊý¾Ý½á¹¹ºÍº¯Êý£¬²¢¶Ô¼ÆÊ±¡¢Ê±¼äµÄ»ñÈ¡¡¢Ê±¼äµÄ¼ÆËãºÍÏÔʾ¸ñʽµÈ·½Ãæ½øÐÐÁ˲ûÊö¡£±¾ÎÄ»¹Í¨¹ý´óÁ¿µÄʵÀýÏòÄãչʾÁËtime.hÍ·ÎļþÖÐÉùÃ÷µÄ¸÷ÖÖº¯ÊýºÍÊý¾Ý½á¹¹µÄÏêϸʹÓ÷½·¨¡£
¹Ø¼ü×Ö£º
UTC£¨ÊÀ½ç±ê׼ʱ¼ä£©£¬Calendar Ti ......
¹ØÓÚº¯ÊýÖ¸ÕëÊý×éµÄ¶¨Òå
¹ØÓÚº¯ÊýÖ¸ÕëÊý×éµÄ¶¨Òå·½·¨£¬ÓÐÁ½ÖÖ£ºÒ»ÖÖÊDZê×¼µÄ·½·¨£»Ò»ÖÖÊÇÃÉÆ·¨¡£
µÚÒ»ÖÖ£¬±ê×¼·½·¨£º
{
·ÖÎö£ºº¯ÊýÖ¸ÕëÊý×éÊÇÒ»¸öÆäÔªËØÊǺ¯ÊýÖ¸ÕëµÄÊý×é¡£ÄÇôҲ¾ÍÊÇ˵£¬´ËÊý¾Ý½á¹¹ÊÇÊÇÒ»¸öÊý×飬ÇÒÆäÔªËØÊÇÒ»¸öÖ¸Ïòº¯ÊýÈë¿ÚµØÖ·µÄÖ¸Õë¡£
¸ù¾Ý·ÖÎö£ºÊ×ÏÈ˵Ã÷ÊÇÒ»¸öÊý×飺Êý×éÃû[]
Æä´Î£¬ÒªËµÃ ......
In C programming language, the observer design pattern is implemented with function pointer (aka callback function). But in Qt library, it introduces signal and slot. How to link a callback function from the C callback function to the C++ siganl and slot is a problem I encounter. Call back function ......