今天用VC compile flite Debug 版 ok,Release 版時,發生 「fatal error C1076: compiler limit: internal heap limit reached」錯誤,原因是程式裡面有宣告一個很大的 global static array,造成 heap memory 超過預設值,解決方法是 compile 參數加上
/Zm600
600 表示 6 倍預設 heap 大小
今天用VC compile flite Debug 版 ok,Release 版時,發生 「fatal error C1076: compiler limit: internal heap limit reached」錯誤,原因是程式裡面有宣告一個很大的 global static array,造成 heap memory 超過預設值,解決方法是 compile 參數加上
/Zm600
600 表示 6 倍預設 heap 大小
曾經遇到過的vc6 error messages,如
Q1.unexpected end of file while looking for precompiled header directive
Q2. Cannot open precompiled header file ….
還有一些其它的 error message 可到 MGT331 找到解答
14 七月, 2006
Posted by: asd In: C++| Code Snippet| 程式設計
如何使 vc6 MFC 程式具有 WinXP 外觀?
Create a Manifest File
view plain
XML:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1"
manifestVersion="1.0">
<assemblyIdentity
version="1.0.0.0"
processorArchitecture="X86"
name="Microsoft.Windows.YourApplication"
type="win32"
/>
<description>YourApplication</description>
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
[...]
In VC DLL
function 前不需要加入 __declspec(dllexport),要匯出的function名稱加入 .def 即可,避免name mangling
function 之 calling convertion 為 __stdcall
ex. int __stdcall GetCPUSpeed()
使用.def 作出的 Dll,可被 VC 及 VB 程式呼叫
VB 傳參數進 VC DLL
例一 : Call By Reference
In VB,若function宣告為
Private Declare Function GetStrFromVC1 "z:DllDebugDll2.dll" ( ByRef PA as integer, ByRef str1 as String) As String
呼叫
view plain
Visual Basic:
Dim strRet as String
Dim PA as Integer
Dim strOutStr as [...]
最近寫一了個api,在header file宣告一個巨大的字串二維陣列
char *szTable[78190][2] = {
{"一","it"} ,
....
}
編譯時卻出現
: fatal error C1001: INTERNAL COMPILER ERROR
( compiler file 'F:\8168\vc98\p2\src\P2\main.c ', line 506 )
只要在Project->C++->Optimizations設成「Default」即可。陣列太大的話,建議還是動態配置再載入比較好。