From 8d7356970b388ff813d99bce7014fef8f9045d60 Mon Sep 17 00:00:00 2001 From: h_vogt Date: Sat, 31 Oct 2009 11:11:13 +0000 Subject: [PATCH] updating windows --- ChangeLog | 4 + src/winmain.c | 22 ++-- visualc/how-to-ngspice-vstudio.txt | 166 +++++++++++++++-------------- 3 files changed, 98 insertions(+), 94 deletions(-) diff --git a/ChangeLog b/ChangeLog index 97a770bb3..1c87e3037 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2009-10-31 Holger Vogt + * winmain.c: windows updated more often + how-to-ngspice-vstudio.txt: updated + 2009-10-24: Dietmar Warning * main.c: correct the command completion under X11, cooments and formatting diff --git a/src/winmain.c b/src/winmain.c index 4e7233370..8e65798bb 100644 --- a/src/winmain.c +++ b/src/winmain.c @@ -16,17 +16,11 @@ #include // exit-codes #include // var. argumente #include // assert-macro -#include "misc/stringutil.h" // copy -#include // _read +#include "misc/stringutil.h" // copy +#include // _read #include -#ifdef _MSC_VER -/* Microsoft VC++ specific stuff */ -#pragma hdrstop -#define strdup _strdup -#endif /* _MSC_VER */ - #include #include #include @@ -221,6 +215,7 @@ void SetAnalyse( struct timeb timenow; /* actual time stamp */ int diffsec, diffmillisec; /* differences actual minus prev. time stamp */ + WaitForIdle(); if ((DecaPercent == OldPercent) && !strcmp(OldAn, Analyse)) return; /* get actual time */ ftime(&timenow); @@ -264,8 +259,9 @@ void SetAnalyse( SetWindowText( hwMain, t); InvalidateRgn( hwAnalyse, NULL, TRUE); InvalidateRgn( hwMain, NULL, TRUE); - WaitForIdle(); } + UpdateWindow(hwAnalyse); + UpdateWindow(hwMain); } // --------------------------------------------------------------- @@ -739,7 +735,7 @@ int MakeArgcArgv(char *cmdline,int *argc,char ***argv) /* API to give the program name */ GetModuleFileName(NULL, buffer, sizeof(buffer)); - tmpargv[0] = buffer; /* add program name to argv */ + tmpargv[0] = copy(buffer); /* add program name to argv */ deli[0] = DELIMITER; deli[1] = '\0'; /* delimiter for strtok */ @@ -752,8 +748,8 @@ int MakeArgcArgv(char *cmdline,int *argc,char ***argv) if (NULL == pC1) pC1 = pWorkString; - if (i == 1) tmpargv[i] = strdup(strtok(pC1, deli)); - else tmpargv[i] = strdup(strtok(NULL, deli)); + if (i == 1) tmpargv[i] = copy(strtok(pC1, deli)); + else tmpargv[i] = copy(strtok(NULL, deli)); } /* copy the working values over to the arguments */ @@ -919,6 +915,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpszCmdLi status = MakeArgcArgv(lpszCmdLine,&argc,&argv); +#if defined(HAS_TCLWIN) /* create private heap for current process */ outheap = HeapCreate(0, 10000000, 0); if (!outheap) { @@ -926,6 +923,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpszCmdLi winmessage("HeapCreate: Internal Error: can't allocate private output heap"); exit(1); } +#endif /* Wait until everything is settled */ WaitForIdle(); diff --git a/visualc/how-to-ngspice-vstudio.txt b/visualc/how-to-ngspice-vstudio.txt index d2923f4e3..1e5a01380 100644 --- a/visualc/how-to-ngspice-vstudio.txt +++ b/visualc/how-to-ngspice-vstudio.txt @@ -1,83 +1,85 @@ -H. Vogt 09.11.08 -(Translation of some commands from German to English is required) - -This this directory (visualc) with its files -vngspice.sln (project starter) and -vngspice.vcproj (project contents) -allows to compile and link ngspice with MS Visual Studio 2008. -The project is probably not compatible with Visual Studio 2005. - -CIDER and XSPICE are included, but the code models for XSPICE -(*.cm) are not (yet) made. You may however use the code models -created with MINGW (which in fact are dlls), as e.g. found in -the ngspice binary distribution. - -There is currently no installation procedure provided, you may -however install the executable manually as described in the -installation tree below. - -/visualc/include contains a dedicated config.h file. It contains the -preprocessor definitions required to properly compile the code. -strings.h has been necessary during setting up the project. - - -Install Microsoft Visual Studio 2008 C++ - -Goto -/ng-spice-rework/visualc - -Start MS Visual Studio 2008 by double click onto -vngspice.sln - -After MS Visual Studio has opened up, select debug or release version -by checking 'Erstellen' , 'Konfigurations-Manager' 'Debug' or 'Release' - -Start making ngspice (called vngspice.exe) by selecting 'Erstellen' and -'vngspice neu erstellen'. - -Object files will be created and stored in visualc/debug or visualc/release. -The executable will be stored to visualc/debug/bin or visualc/release/bin. - -Installation tree (as provided with MINGW make install) and also used by -vngspice: - -C:\Spice\ - bin\ - ngspice.exe - nghelp.exe - ngmakeidx.exe - ngnutmeg.exe - cmpp.exe - lib\ - spice\ - analog.cm - digital.cm - spice2poly.cm - extradev.cm - extravt.cm - share\ - info\ - dir - ngspice.info - ngspice.info-1 - .. - ngspice.info-10 - man\ - man1\ - ngmultidec.1 - ngnutmeg.1 - ngsconvert.1 - ngspice.1 - ng-spice-rework\ - helpdir\ - ngspice.idx - ngspice.txt - scripts\ - ciderinit - devaxis - devload - setplot - spectrum - spinit - +H. Vogt 31.10.09 +(Translation of some commands from German to English is required) +Many more details of ngspice usage under Windows is described +in how-to-use-ngspice091031.txt from the binary distribution. + +This directory (visualc) with its files +vngspice.sln (project starter) and +vngspice.vcproj (project contents) +allows to compile and link ngspice with MS Visual Studio 2008. +The project is probably not compatible with Visual Studio 2005. + +CIDER and XSPICE are included, but the code models for XSPICE +(*.cm) are not (yet) made. You may however use the code models +created with MINGW (which in fact are dlls), as e.g. found in +the ngspice binary distribution. + +There is currently no installation procedure provided, you may +however install the executable manually as described in the +installation tree below. + +/visualc/include contains a dedicated config.h file. It contains the +preprocessor definitions required to properly compile the code. +strings.h has been necessary during setting up the project. + + +Install Microsoft Visual Studio 2008 C++ + +Goto +/ng-spice-rework/visualc + +Start MS Visual Studio 2008 by double click onto +vngspice.sln + +After MS Visual Studio has opened up, select debug or release version +by checking 'Erstellen' , 'Konfigurations-Manager' 'Debug' or 'Release' + +Start making ngspice (called vngspice.exe) by selecting 'Erstellen' and +'vngspice neu erstellen'. + +Object files will be created and stored in visualc/debug or visualc/release. +The executable will be stored to visualc/debug/bin or visualc/release/bin. + +Installation tree (as provided with MINGW make install) and also used by +vngspice: + +C:\Spice\ + bin\ + ngspice.exe + nghelp.exe + ngmakeidx.exe + ngnutmeg.exe + cmpp.exe + lib\ + spice\ + analog.cm + digital.cm + spice2poly.cm + extradev.cm + extravt.cm + share\ + info\ + dir + ngspice.info + ngspice.info-1 + .. + ngspice.info-10 + man\ + man1\ + ngmultidec.1 + ngnutmeg.1 + ngsconvert.1 + ngspice.1 + ng-spice-rework\ + helpdir\ + ngspice.idx + ngspice.txt + scripts\ + ciderinit + devaxis + devload + setplot + spectrum + spinit + \ No newline at end of file