Saturday, November 24, 2018
Thursday, November 22, 2018
Monday, September 3, 2018
Saturday, August 25, 2018
PPT assembly language quick notes
PPT assembly language quick notes
- x86 Assembly Guide
- The Real, Protected, Long mode assembly tutorial for PCs
- Protecting .NET 4.+ Application By C++ [Unmanaged]
- An Anti-Reverse Engineering Guide
- Anti-Reflector .NET Code Protection
- Introduction to Drawing in Windows
- Multithreading Tutorial
- The Practical Guide to Multithreading - Part 1
- The Practical Guide to Multithreading - Part 2
- A multithreaded, OpenGL-enabled application.
Friday, July 20, 2018
books on assembly languages
books on assembly languages
- Optimizing C With Assembly Code Paperback – October, 1995
- Zen of Graphics Programming: The Ultimate Guide to Writing Fast PC Graphics
- Microsoft Macro Assembler 6.1 Programming/Book and Disk
- Zen of Assembly Language: Knowledge (Scott Foresman Assembly Language Programming Series) Paperback – January 1, 1990
- Optimizing C With Assembly Code Paperback – October 1, 1995
- Best Assembler x86 Textbooks: very complete list
- Zen of Assembly Language: Volume I, Knowledge
- Index of /pdf/Gentoomen Library/Programming/Assembly/
the following are good books:
Saturday, July 7, 2018
C struct Labs
C struct Labs
- CMSC 313 -- Fixing The Size Of Structures
- CMSC 313 -- Structures in C
- CMSC 313 -- Structures in Assembly
- Linked Lists
- Floating Point Operations
- Visual C++ equivalent of GCC's __attribute__ ((__packed__))
- fixed size of struct
- Data structure alignment
- Why isn't sizeof for a struct equal to the sum of sizeof of each member?
PE format and viewers
PE format and viewers
- PE File Format
- wine-3.11/include/winnt.h
- PE Format
- x86 Disassembly/Windows Executable Files
- Operating System Development Series
- perating Systems Development - Portable Executable (PE)
- Operating Systems Development - MSVC++ 2005, 2008, 2010
- Five PE Analysis Tools Worth Looking At
- Exeinfo PE for Windows by A.S.L.
- Advance PE Viewer - NikPEViewer 0.4v (beta)
this article is very detailed. please look further.
Friday, June 29, 2018
Saturday, June 23, 2018
arduino and C
arduino and C
- ARDUINO AND PIDGIN C++
- SparkFun Digital Sandbox
- MODERN C++ FOR C PROGRAMMERS: PART 1
- MODERN C++ FOR C PROGRAMMERS: PART 2
- CodeBlocks Arduino IDE 20140626
- PROGRAM ARDUINO UNO IN C LANGUAGE
- Arduino for Kids Paperback – March 23, 2017
- C Programming for Arduino Paperback – May 17, 2013
- Beginning C for Arduino, Second Edition: Learn C Programming for the Arduino 2nd ed. Edition
- Building a Quadcopter with Arduino Paperback – January 5, 2016
- Freenove Super Starter Kit for Arduino | Beginner Learning | UNO R3 MEGA NANO MICRO | 25 Projects, 139 Pages Detailed Tutorial
- SainSmart 6-Axis Desktop Robotic Arm & Grippers, Assembled for Arduino UNO MEGA2560
- SunFounder Remote Control Crawling Quadruped Robot Model V2.0 DIY Wooden Kit for Arduino Nano Servo Motor RC Smart Toys Detailed Manual
- LewanSoul 5DOF Metal Humanoid Robot Hand Five Individual Finger with 5 Servos for Robot DIY(Assembled)
- Aideepen ROT3U 6DOF Aluminium Robot Arm Silver Mechanical Robotic Clamp Claw for Arduino without Servo
Saturday, June 16, 2018
Saturday, June 9, 2018
Windows folder & path
Windows folder & path. very good tricks to find short path names.
- Dos2Unix / Unix2Dos - Text file format converters
- Welcome to the free Win32 software page at BASTET.COM!: unix2dos
- How do I specify C:\Program Files without a space in it for programs that can't handle spaces in file paths?
- How does “PROGRA~1” path notation work? [duplicate]
- How can I find the short path of a Windows directory/file?
- How can I find the short path of a Windows directory/file?
- reate a short filename for program files (progra~1) on Windows 7
- How do I get into the program files directory in DOS?
- Visual studio doesn't have cl.exe
- Command Prompt - How to add a set path only for that batch file executing?
- EOL conversion in notepad ++
- Do you want to convert the file to DOS format?
- Converting newline formatting from Mac to Windows
Friday, June 8, 2018
C5 library
- sestoft/C5
- The Working Programmer - .NET Collections: Getting Started with C5
- The C5 Generic Collection Library for C# and CLI
- Peter Sestoft: Inside The C5 Generic Collection Library for C# and CLI
- Top 20 NuGet collections Packages
- Quickstart: Install and use a package in Visual Studio
- How to Use NuGet Packages
- QuickPlot Utility
- NuGet in 30 min - Quick introduction to NuGet in Visual Studio
- 2018高考数学试题解析:提升数学能力是王道
Saturday, May 19, 2018
Friday, May 11, 2018
Saturday, May 5, 2018
diskpart tutorial and windows installation
diskpart tutorial and windows installation
- Take command of disk management in Windows XP with DiskPart
- How to build a Windows 7 USB System Repair Disc
- How to Create Bootable USB Drives and SD Cards For Every Operating System
- Create a bootable flash drive for installing Windows
- Where to Download Windows 10, 8.1, and 7 ISOs Legally
- Create a Bootable USB Flash Drive
- Windows USB/DVD Download Tool
- Windows USB/DVD Download Tool
- Windows USB/DVD Download Tool
- good article
Tuesday, April 10, 2018
Saturday, April 7, 2018
Friday, March 30, 2018
Saturday, March 24, 2018
assembly language float types
assembly language float types
- x86 calling conventions
- x86 Disassembly/Calling Conventions
- x86 Disassembly/Floating Point Numbers
- Common x86 Calling Conventions
- X86 Assembly/Floating Point
- Floating-Point Processing
- Floating Point Assembly Language
- Notes about Floating-Point Numbers in Assembly Language
Friday, March 16, 2018
Saturday, March 10, 2018
symbolic computation
- Solving statistics problems with symbolic C# framework
- Symbolic C# Framework for Vector and Matrix Operations
- A Vector Type for C#
- math.net
- MathLibrary for Matrix and Vector
- Exploring parametric ODE with symbolic C# framework
- Symbolic C# Framework for Vector and Matrix Operations
- Symbolic evaluations and numerical methods
- Dynamic Data Display Getting Started
- Microsoft/InteractiveDataDisplay.WPF
- Editor Component for Physical Applications Data Input
- Unicode subscripts and superscripts
Friday, March 9, 2018
raid 1 set up
I bought HD enclosure: NST-27253-BK. it is from www.vantecusa.com. v1.01. Dual 2.5inch SATA SSD/HDD RAID enclsoure. serial number:0664400409.
specification from box: NexStarGX usb3.0 SATA SSD/HDD RAID enclsoure
- model: NST-27253-BK
- device support:SATA I/II/III SSD/HDD/SDHD
- device size:2 bay for 2.5" 7mm and 9.5mm SSD/HDD/SDHDs
- internal interface: SATA
- external interface: usb3.0 micro-B
- HDD capacity: 2 TB per bay, for a combined total of 4TB.
- power supply: USB AC adapter 5V/2A; micro USB to A, length :23 inches
- weight: 300g
- dimension:130x83x25mm
- system requirements: windows 7/8/10, MACX 10.6 or above. Linux ubuten 10.4(kernel 2.6.38)
Features:
- support Dual 2.5" SATA/I/II/III/SSD/HDD/SDHD
- support JBOD/RAID 0 /RAID 1
- Auto RAID 1 rebuild
- support UASP
- SATA interface support SATA III specification up to 6Gps
instruction to set up:
- power up unit
- wait for the drive to spin up speed
- press and hold the reset button for 3 seconds(HDD LEDS will turn off)
- release the reset button and the built-in controller will activate the RAID or normal mode based on the dip switch setting.
- all new USB storage device need to be intialized, partition and formatted for the operating system you are using before it can store data.
- for windows operating system, use Disk Management
- for OS X, use disk utility to prepare this storage device
- note: on Windows 10, plug in usb to computer, power up. the HDD LED lights are on. it shows current setting(JBOFS). now press reset button for 3 seconds. new drives get disconnected and then connected to computers based on sounds. and then new RAID 1 setting is enabled based on light below RAID 1 setting.
- start Disk Management tool. PC automatically recognizes the uninitialized hard drive. it prompts you to format it. follow the prompts and format the hard drive. no quick format and no enable compression.
for details instruction refer to the FAQ " how to preparing a new storage, hard driver, or SSD for use with a system?" on our website support section at www.vantecusa.com
Hard Drive specifications:HGST TRAVELSTAR hard drive. o=bought on 03/08/2018.
- 1TB. 5400 RPM. 8MB/Mo Cache. 9.5mm.
- S/N: 1V2EYNEM (0S03508)
- 12-2017. made in China
- Bar-code: 05487 18982
Saturday, March 3, 2018
research on class design
research on class design. if we have a legacy software, how to improve it? this article gives some thoughts, then follow these threads, we can move on broader view.
- Discovering Hidden Design
- Coupling and Cohesion
- Structured Design
- Writing code for other people: cognitive psychology and the fundamentals of good software design principles
- code of damned: good website
- How to avoid temporal coupling in C#
- Design for change: Coupling and cohesion in object oriented systems
- All You Need to Know About UASP
- Identifying Object-Oriented Classes
- High Cohesion & Low Coupling using SOLID Principles -- Part 1
- High Cohesion & Low Coupling Using SOLID Principles -- Part 2
- Adaptive Code via C#:
Choosing Structure over Naming
There are many qualities that can make designs better. One that really helps names that have clear meaning in the domain. We can use those names to help us determine the relationship between different parts of our code. Beyond that, we can fall back on the classical ideas of coupling and cohesion — a design is good when it maximizes cohesion and minimizes coupling. Although the justification is rarely noted, it's likely that the concepts of coupling and cohesion are useful to us because they are cognitive aids for understanding unfamiliar things [1]. We can understand only so much at a time, so the pieces we attempt to understand should be small and their dependencies should be clear and few. We should be able to understand a chunk of code by itself. Good naming helps us by giving us a mental handle for the other chunks of code that a particular chunk depends upon. It helps us build up a web of understanding.
There are times, however, when our code has internal clustering in its graph and we can't conceive of good names for the clusters. If that is the case, is it acceptable to choose a poor name and move forward with class extraction? Aren't we making our code a little worse if we do that? Again, everyone has to make their own judgment on a situation-by-situation basis, but it's worth considering that naming is only one aspect of program understanding. Code, in general, becomes more understandable when we are looking at chunks that don't have many dependencies on externals. When we can look at a piece and feel that we can understand it locally, we are more likely to be able to change it correctly. The fact that we don't have a good name for it is regrettable, but there is always the chance that we might find a good name later, or that we might eventually merge the the extracted class back into its original class and find a better to way to refactor. In the meantime, we get the benefit of local understanding. If that understanding is constructive relative to the original state of the code, the refactoring might be worthwhile.
Friday, March 2, 2018
research on scale
research on scale. plan is: plotting, zoom, pan on cp.com. chart engine on Devx. Gigasoft on scale and zoom design.
- ProEssentials v8 Help
- .NET C++ MFC Delphi ActiveX Charting Download
- Chapter 2: C# .NET WinForm Walk-Through VS2010
- WinForm C# 2010 Walkthrough or WinForm C# 2012 Walkthrough
- .NET example code is good place to review too
- .NET deployment is good place to review too
- .NET installation
- Build a Reusable Graphical Charting Engine with C#
- Welcome To JFreeChart!
- Scientific charting control
- n MFC Chart Control with Enhanced User Interface
- High-speed Charting Control
- Scientific charting control
- A simple C# library for graph plotting
- Plot Graphic Library
- Drawing Recurrence Plots with C#
- FPlot, a .NET library for plotting functions and measurement data
- AderPlotter
- Oscilloscope/StripChart Control
- Line Graph Component in C#
- Graphing Calculator in C# with LES
- A Simple Graph Control
- Graph Library
- Autoscaling Graph Control
- A 2D Graph Component With Zoom Capability
- Realtime Chart and Graph in One
- C# 2.0 Graphing Control
- Building a Graph control in 7 easy steps.
- Drawing a Line Graph in GDI+
- GraphDisplay: a Bezier based control for graphing functions and curves
- Graph control
- Tracker - A Windows Form graph control
- Bullet Graphs - A Custom Control - WPF vs. Windows Forms
look at alphabetical listing. focus on "S" section: scale. especially on "scale Symbols".
user's manual=>Chapter 2 WPF WinForm ASP.NET =>
extract class design. study the required minimal property and methods to be a charting component.
need to search graph on cp.com
Saturday, February 24, 2018
fix internet connection issue
fix internet connection issue
- Windows 10 PC will not connect to Internet
- open command prompt (admin)
- Type: netsh int ip reset then Enter
- Restart PC
- Resetting TCP/IP to Default
- How to reset TCP/IP by using the NetShell utility
- The Nuclear Option: Resetting The Crap Out Of Your Network Adapters in Vista
- Reset TCP/IP or Internet Protocol in Windows 10/8/7
- How to reset your network adapter in Windows 10
- How to permanently disable Windows Defender on Windows 10
As an ISP tech support rep, I have had a large number of calls since 12/9/16 reporting the same issue. Appears to be relate to the TCP/IP stack. Try the following, I have had a lot of success with it:
Friday, February 23, 2018
set up Visual Studio 2008 for assembler
set up Visual Studio 2008 for assembler
- How to compile assembly files using vs2008?
- Start with a General - Empty project.
- Right-clicking on the project name in the solution explorer, set Custom Build Rules so that the Microsoft Macro Assembler is used.
- Next, go to Project - Properties. Find the Linker in the dialog box and expand it (click on the +).
- Under the Linker, select System.
- On the top line, Subsystem, click the down arrow and choose "Console (/SUBSYSTEM:CONSOLE)."
- In the same dialog box under Linker, select Advanced.
- Edit the top line, Entry Point, so that it is the label you used as the starting point of your code. Note: You should not enter the underscore when filling
- in the Entry Point. VS apparently adds an underscore. Your environment is now set to do assembly langauge programming as a project.
- How to run Assembly Programs in Visual Studio
- How to run Assembly Programs in Visual Studio
- Guide to Using Assembly in Visual Studio .NET
Right-click the project in the Solution Explorer window, Custom Build Rules, tick "Microsoft Macro Assembler". This ensures that any .asm files you add to your project get compiled with the custom build rule for .asm files.
it works only when you create Windows 32 project in Visual Studio 2008: select console application, then empty project. after empty project is created, then remove all folders. in this case, no need to set up Entry Point in the Linker property tab.
The basic question is more or less answered, but what if you want to do just assembly language in your Visual Studio project? Here is the answer:
The procedure works also in Microsoft's free Visual C++ 2008 Express edition which is still downloadable from MS as of the date of this posting. Good luck and have fun!
Saturday, February 10, 2018
tips and tricks on pre-compiled header
tips and tricks on pre-compiled header. my note is taken from the following posts.
- Precompiled headers
-
First, make sure you select "All Configurations" so that your fixes will affect both debug and release builds of your project.
-
Now, go to the C/C++ tab, precompiled headers category. Select "Use precompiled header file" and type in the name of your precompiled header file (stdafx.h or precompiled.h).
-
If you try to build now your build will fail, giving a cryptic error about how it doesn't know how to create the .pch file. You need to tell it how.
In the explorer view in project settings, open up your project and navigate down to the .cpp file that you chose for creating the precompiled header file (in VS.Net you will select that file from the Solution Explorer).
Select that file, with "All Configurations" still selected, and select "Create precompiled header file", and type in the name of your precompiled header file. -
It kind of makes sense once you go through the steps. You give VC++ one source file to create the precompiled header file, and the other files all use it. This guarantees that it won't be rebuilt unnecessarily.
You have to #include this file from all of your source files so that if you turn precompiled headers off, your program will compile in the same manner. -
The one fly in the ointment, the worrisome aspect of this feature, is that there is actually no guarantee that your program will behave identically, because VC++ doesn't enforce that your #include of the precompiled header file comes first. It enforces that you include the precompiled header file in each source file, but it will happily ignore includes, defines, and other code before that include. If you notice yourself getting some strange errors after changing your precompiled header files, that's probably why.
Go through all of your source files and make sure that your precompiled header file is included first. -
That's it. If you have any problems then double check all of the steps, check the problematic source files for any preprocessor directives or code before the include of the precompiled header file, and maybe do a rebuild-all for good measure. If you want an example of a properly setup project to use as a reference, use the AppWizard to create an MFC project.
-
You may be surprised. With Visual Studio .Net you can get a hierarchical list of header files used by setting Properties->C/C++->Advanced->Show Includes to yes.
- Speed up C++ compilation, part 1: precompiled headers
Preparations
With Visual C++ 6.0 you have to run devenv.exe with the undocumented /y3 option.
In Visual Studio .Net you can get similar functionality by going to Tools->Options->Projects->VC++ Build and setting Build Timing to Yes.
add some variation on this line to all copies of windows.h on my machine:
#pragma message("Compiling windows.h - this should happen just once per project.\n")
Setting up precompiled headers
The only precompiled header settings that are efficient to use are the Create/Use pair of settings.( The documentation for these settings tells you what each setting does, but it fails to give you the big picture - it doesn't tell you how to setup a project to use these two together.)
The basic idea is that one cpp file is specified as creating the precompiled header file and the other cpp files uses that precompiled header file. Because only one source file ever creates the precompiled header file it is guaranteed that it will only get built once per total rebuild.
First you need to have one header file that every source file in your project will include. This is typically called stdafx.h or precompiled.h. If you don't have such a file, create it now. Check it to make sure it is including the appropriate set of header files - big header files that never change. Now make sure that every source file in your project is including this header file as the first non-comment thing that they do.
Now you need one source file whose only job is to create the precompiled header file. It's best to have a source file exclusively for this purpose because every time this source file is modified, the .pch file will be regenerated. Generating the .pch file is an expensive operation that we are trying to avoid. This source file will typically be called stdafx.cpp or precompiled.cpp - to match the header file.
Now it's time to go to project settings.
The defaults are dangerous
For some projects - typically non-MFC projects, but the specifics depend on what version of VC++ you are using - the project wizard's set the precompiled header option to the seductive sounding "Automatic use of precompiled headers." Microsoft itself has admitted that this option is inefficient - yet they make it the default for many projects. Unless you are exquisitely careful this "automatic" use of precompiled headers translates to "rebuilding the precompiled headers for every source file." It is difficult to avoid this and keep it working properly. Don't use it. Either disable precompiled headers, or use them properly.
If you use the DirectX AppWizard to create a non-MFC project, the newly created project will use the "Automatic use of precompiled headers" setting. Because of this these projects will take approximately twice as long to build as they need to. You need to manually fix them to get good build performance.
Friday, February 9, 2018
PE utility
PE utility
- Five PE Analysis Tools Worth Looking At
- PE Format
- Windows Programming Utilities
- Code Obfuscation in 64-Bit Land
- TinyPE NG
- COMPILER, ASSEMBLER, LINKER AND LOADER: A BRIEF STORY
- Microsoft Visual Studio
- A Number of Reusable PE File Format Scanning Functions
- Evilsocket/libpe
- Principled, lightweight C/C++ PE parser
- Portable Executable (PE) library written in .Net
- OpenRCE Articles
a very good introduction. PEBrowse is a good tool.
Saturday, February 3, 2018
very good tips from a phd student
very good tips from a phd student
- MVP Tips, Techniques, and Goodies
- C# for MFC programmers Quick Equivalents Map
- Character Functions
- Drawing Techniques
- Hooks and DLLs
- A Logarithmic Slider Control
- The PolyDraw Explorer
- Virtual Screen Coordinates
- Limiting Window Resizing Resizing Controls
- The NUMA Explorer
- A General Polygon Management Routine
- Sharp Layout
- Automatic Layout of Resizable Dialogs
- Layout Manager for Dialogs, Formviews, DialogBars and PropertyPages
this post is very important for me expand my windows form to multi-screen setting.
customize pagesize file on windows 7
I learned a good key combination: Windows key + Pause/Break. it goes to system tab on control panel directly. customize pagesize file on windows 7.
- What's the best size for the pagefile.sys gigantic virtual memory file? This thread is locked from future replies
- How do I decrease the size of the page file?
- Optimize the Paging File in Windows 7/8/8.1
- How To Reduce Hibernate File Size In Windows 10/7
- Win 7 Disk Space Guide: How to remove pagefile and hiberfil
Friday, February 2, 2018
Visual C++: include files from another project in the same solution
Visual C++: include files from another project in the same solution. I take note from the following pages and put it here for my own reference.
Settings for compiler
In the project where you want to #include the header file from another project, you will need to add the path of the header file into the Additional Include Directories section in the project configuration. To access the project configuration:- Right-click on the project, and select Properties.
- Select Configuration Properties->C/C++->General.
- Set the path under Additional Include Directories.
How to include
To include the header file, simply write the following in your code:
#include "filename.h"
Note that you don't need to specify the path here, because you include the directory in the Additional Include Directories already, so Visual Studio will know where to look for it.
// In project settings
Additional Include Directories ..\..\libroot
// In code
#include "lib1/lib1.h" // path is relative to libroot
#include "lib2/lib2.h" // path is relative to libroot
Setting for linker
If using static libraries (i.e. .lib file), you will also need to add the library to the linker input, so that at linkage time the symbols can be linked against (otherwise you'll get an unresolved symbol):- Right-click on the project, and select Properties.
- Select Configuration Properties->Linker->Input
- Enter the library under Additional Dependencies. for example: MyLibX.lib
- Linker->General->Additional Library Directories: ..\MyLibX;
//(for example). if adding reference is set, we still need to set up this step.
we can combine 3) and 4) in 3) as: ..\MyLibX\MyLibX.lib
the above notes are from following links.
- visual c++: #include files from other projects in the same solution
- #include files from another project in Visual Studio Solution
Saturday, January 27, 2018
walk through to create DLL in visual studio 2008 ,2010, 2015, and 2017
- Walkthrough: Creating and Using a Dynamic Link Library (C++)- you can find Visual Studio 2008
- reference DLL assembly: Project Properties-> Common Properties ->Reference -> Add New reference:
- project Properties -> Configuration Properties->C/C++ node->add additional include directories, specify where .h file is located
- update PATH environment info to tell where DLL is located because executable does not load DLL until runtime. so you need to tell where to load DLL file: Project property page-> configuration properties->Debugging:: Environment, type path such as PATH=
. here I used $(TargetDir) - Walkthrough: Creating and Using a Dynamic Link Library (C++)
- When the Win32 Application Wizard finishes, a minimal console application project is created for you. The name for the main source file is the same as the project name that you chose earlier. In this example, it is named MathClient.cpp.
- To use the math routines that you created in the DLL, you must reference the DLL in your app. To do this, under the MathClient project in Solution Explorer, select the References item. On the menu bar, choose Project, Add Reference.
- The Add Reference dialog box lists the libraries that you can reference. The Projects tab lists the projects in the current solution and any libraries that they contain. On the Projects tab, select the check box next to MathLibrary, and then choose the OK button.
-
You need the definitions in the MathLibrary.h file to call the DLLs functions from your app. You could copy the header file into your client app project, but that might lead to changes in one copy that are not reflected in the other. To avoid this issue when you reference the header files of the DLL, you can change the included directories path in your project to include the original header.
To do this, open the Property Pages dialog box for the MathClient project. In the left pane, expand Configuration Properties, C/C++ node, and then select General. In the center pane, select the drop-down control next to the Additional Include Directories edit box, and then choose
. Select the top pane of the Additional Include Directories dialog box to enable an edit control. In the edit control, specify the path to the location of the MathLibrary.h header file. Because typing the complete path may be difficult, you can use the browse control (...) at the end of the edit box to bring up a Select Directory dialog box. In the dialog, navigate up one folder level to the MathLibraryAndClient folder, then select the MathLibrary folder, and then choose the Select Folder button. Once you've entered the path to the header file in the Additional Include Directories dialog box, choose the OK button to go back to the Property Pages dialog box, and then choose the OK button to save your changes. - You can now include the MathLibrary.h file and use the Functions class in your client application. Replace the contents of MathClient.cpp by using the following code:
- Walk through: Create and use your own Dynamic Link Library (C++)::Visual Studio 2017
- generate windows 32 console application - > select DLL -> leave checked precompiled headers.
-
make sure MATHLIBRARY_EXPORTS is set up in preprocessor:Project-> properties->Configuration Properties -> C/C++-> preprocessor definitions. if it is MathLibrary_EXPORT, you need to edit it into MATHLIBRARY_EXPORTS.
when you edit this field, please make sure to do: Property Pages dialog, change the Configuration drop-down to All Configurations - inside source folder, dllmain.cpp is automatically generated. no touch.
- build this project, it will succeed.
- create a windows 32 console application with precompiled header file checked.
-
to call the functions MathLibrary.dll, your project needs to include MathLibrary.h. you can either copy this file into your client app directory,
or set up Additional Include Directories path in your client app project to include the path to original DLL header .
Property Pages-> configuration drop down, select ALL Configurations if not already selected. then go to Configuration Properties-> C/C++ ->General-> select Additional Include Directories edit box.
in my project settings, I used ..\MathLibrary -
At this point, your MathClient can be compiled, but not linked. the linker must be able to find the MathLibrary.lib file to link successfully. you can either copy MathLibrary.lib to your Mathclient app project, or you can point it to MathLibrary directory (in fact it is Debug folder).
MathClient project->Property Pages ->Configuration drop down, please select All Configuration if it is not already selected. ->Configuration Properties-> Linker->Input->Additional Dependencies->Edit, type MathLibrary.lib .
It specifies additional items to add to the link command line. (i.e.,kernel32.lib) -
in the left pane, select Configuration Properties->Linker->General->Additional Library Directories->Edit
please enter ..\MathLibrary\$(IntDir)
this will tell where to find MathLibrary.lib file.
in Visual Studio 2017, it is written as: this Additional Library Directories allows user to override the environmental library path. (/LIBPATH: folder)
in Visual Studio 2008, it is written as: specifies one or more additional paths to search for libraries; configuration specific; use semicolon delimited list if more than one. (/LIBPATH:[dir] - Build MathClient project. it will succeed.
- post-build event seems like not necessary.
- Projects in Visual C++ 2010 – Part 1: Creating a DLL project
- Create a Class library. the default it will create a dynamic library. please verify by Project Properties->Configuration Properties->General->Project Defaults->Configuration Type: dynamic library. make sure NO common language runtime support.
-
Add header Printable.h. make sure following __declspec(dllexport) and __declspec(dllimport) are used:
#ifdef COMPILE_MYLIBRARY
#define MYLIBRARY_EXPORT __declspec(dllexport)
#else
#define MYLIBRARY_EXPORT __declspec(dllimport)
#endif
class MYLIBRARY_EXPORT PrintableInt {}; - Project Properties-> Configuration : ALL Configuration
- Project Properties->Configuration Properties->C/C++-> Preprocessor-> preprocessor definition: COMPILE_MYLIBRARY;
- Add source file Printable.cpp(in my project it is MyLibX.cpp. either way is fine).
- Add MyLibXClient console application.
- specify Include Path. Make sure All Configuration is selected from "configuration" dropdown:
from project properties->configuration Properties -> C/C++ -> General->Additional Include Directies: type, ..\MyLibX
Make sure All Configuration Type is selected.
it will tell VS 2010 where to find PrintableInt.h file. if you compile the client app now, you will have link error. -
specify Lib file. it is to specify the path to the .lib file of the library project. note your DLL projects will create a .LIB file so that this console app will link against the DLL automatically.
Linker->Input-> Additional Dependencies
type such as ..\MyLibX\$(IntDir)\MyLibX.lib -
from Visual Studio 2010, referencing a DLL is simplified.
project properties->common properties->Framework and Reference->Add New Reference button: you can add MyLibX project in.
when you compile it, it will fail because it needs MyLibX.lib. to create this MyLibX.lib file, __declspec(dllexport) must be used.
in Visual Studio 2010, we still need to set up include directories in the above step: Configuration :
configuration properties->Linker->General->Additional Library Directories: type relative path.
My Note: I tested that this step is not needed after adding reference.I also tested this step: with adding reference to MyLibX , we don't need to set up this step:
configuration properties->Linker->Input->Additional Dependencies:type lib name such as MyLibX.lib. or we can type relative path plus lib name such as ..\MyLibX\MyLibX.lib - Basic C++ Win32 DLL
- Walkthrough: Creating and Using a Dynamic Link Library (C++)-- Visual Studio 2015
- Execute a function in any Win32 DLL - Reflection in Win32 DLL?
- DLL Tutorial For Beginners
- C++ Tutorial Create a DLL in VC++ 2013 or 2015
- C++ Tutorial: Create a DLL in VC++ 2010/2008
- Exporting C Functions for Use in C or C++ Language Executables
- Exporting from a DLL Using __declspec(dllexport)
- Importing into an Application Using __declspec(dllimport)
I tested and summarized my note on creating DLL in Visual Studio different versions.
for Visual Studio 2008, when you use DLL, just do steps:
in Visual Studio 2015, we have another way to add reference this DLL. it is the same as regular .NET assembly reference. need to test it out on Visual Studio 2017 sometime.
first create a client Windows console application.
To use the functionality from the class library in the app
NOTE In older versions of Visual Studio, references are added to your project in a different way. Select the MathClient project in Solution Explorer, and then on the menu bar, choose Project, References. In the Property Pages dialog box, expand the Common Properties node, select Framework and References, and then choose the Add New Reference button. For more information about the References dialog box, see Adding references.
In visual Studio 2017, when we create DLL prpoject, we have more settings(but I tried in Visual Studio 2008 with the same steps):
in visual Studio 2017, when we create a console application to use DLL prpoject, we have more settings:
In Visual Studio 2010, to create a DLL without template class, we have following steps:
Friday, January 26, 2018
code iterations
code iterations
- Code Iterations
- A Helper Class to Bind a DataTable to a Class
- Database Helper v 2.0.0
- Owner Drawn Resizable Control
- The Koch Curve - Snowflake!
- A Simple Moving Average Algorithm
- Time moving average
- Genetic Algorithm Library
- A primitive CEP engine to analyse stock market data in real time
- FlowSharp
- cliftonm/FlowSharp
- Building a Simple .NET Compiler
- A Simple Compiler for the Common Language Runtime
Saturday, January 20, 2018
VS linker setups
VS linker setups. google: dll is generated, but lib file
- No lib files outputed from visual studio Exp 2010
- Problem creating static/dynamic c++ libraries in visual studio
- How do I build an import library (.lib) AND a DLL in Visual C++?
- Where is *.lib after generating *.dll with VC++?
- Why does fatal error “LNK1104: cannot open file 'C:\Program.obj'” occur when I compile a C++ project in Visual Studio?
- Build Succeeded, but no .lib file gets created
- DLL generated but related import library is missing?
- Visual Studio does not generate .lib file for a DLL project
- Is there a better way to load a dll in C++?
- Generating LIB File for DLL Library
- Libraries
- Create .lib file from .dll
__desclspec(dllexport) etc.
- A super easy DLL made in VC++ IDE, especially for the first time tasters
- HowTo: Export C++ classes from a DLL
- Basic C++ Win32 DLL
- Dlls are Simple. Part 1
- DLLs are simple: Part 2
- The Ultimate (DLL) Header File
- Win32/Linux Dynamic Library Loader Class
- A way for a MFC DLL to deal, at runtime, with BSTR from Visual Basic and from Visual C++
- Exporting C++ classes without using MFC extension DLL
- Exporting C++ Classes from an MFC Extension DLL
- Beginner's Guide
- Interface-based Programming, Runtime Class Discovery, Dynamic Class Loading from DLL
- A Beginner's Guide to Pointers
- Technical Guide on C
- Step by Step: Calling C++ DLLs from VC++ and VB - Part 1
- Step by Step: Calling C++ DLLs from VC++ and VB - Part 2
- Step by Step: Calling C++ DLLs from VC++ and VB - Part 3
- Step by Step: Calling C++ DLLs from VC++ and VB - Part 4
- Creating and consuming MFC DLLs for Beginners
- How to create a DLL library in C and then use it with C#
- Creating Import Library from a DLL with Header File
- Importing a Locally Defined Symbol without Using a Module Definition File
- DllExports - Common Problems and Solutions
- Calling methods from Dll compiled in 'C' from C#
- DLL Template which lets your project take off
- Understanding DLLs – Building them and Allowing External Calls to their Functions
- a Tiny Parser Generator v1.2
Friday, January 19, 2018
pre-compiled header
pre-compiled header
- Precompiled Headers & Normal C++ Semantics
- Precompiled Headers (Fast Build)
- Speed up C++ compilation, part 1: precompiled headers
- Speed up C++ compilation, part 2: compiler cache
- Speed up C++ compilation, part 3: distributed compilation
- Projects in Visual C++ 2010 – Part 3: Precompiled Headers
- Compiler Warning (level 1) C4273
- What are TCHAR, WCHAR, LPSTR, LPWSTR, LPCTSTR (etc.)?
- Precompiled header
- Creating Precompiled Header Files
- StdAfx.h - by Andrey Karpov
- StdAfx.h - Andrey Karpov
- Speed up C++ compilation, part 1: precompiled headers
- A quick guide to using Precompiled Headers (Visual Studio)
- CMake precompiled header support via custom PCH compiler extension
- 4 Ways Precompiled Headers Cripple Your Code
- Projects in Visual C++ 2010 – Part 3: Precompiled Headers
- The Ultimate (DLL) Header File
- Optimizing Serialization in .NET
- How to Optimize Compilation Times with Precompiled Headers (PCH Files)
a good example.
this example is very small. can test it out.
this provides an example to test.
Monday, January 15, 2018
Parser
- An Enhanced Mathematical Expression Recursive Descent Parser in C#
- Mathematical Expression Parser Using Coco/R
- Mathematical Expression Parser Using Recursive Descent Parsing
- Fast Mathematical Expressions Parser
- LL Mathematical Parser
- Inside the Mathematical Expressions Evaluator
- Math Parser .NET C#
- Math Parser
- Math Parser .NET
- An extensible math expression parser with plug-ins
- Plug-ins in C#
- Plug-in Framework
- Anti-Sandbox and Anti-Virtual Machine Tool
Saturday, January 13, 2018
floating point or float point## ZOOM /PAN
floating point and tips. good ZOOM algorithms need testing
- Five Tips for Floating Point Programming
- Floating Point in .NET part 1: Concepts and Formats
- Reliable Floating Point Equality Comparison
- Heresy I - Why Floating Point Coordinates are Wasteful
- Coordinate and CoordinateList classes - ISO 6709 compliant
- Heresy II - Why 4D Homogeneous Transform/Clip/Project is Wasteful
- A New Perspective on Viewing
- Perfect Panning in 3D (Zoom Too)
- A WPF Custom Control for Zooming and Panning
- WPF Chart Control With Pan, Zoom and More
- An Enhanced WPF Custom Control for Zooming and Panning
- Basic concepts on Endianness
the above article needs a further look. the demo project is to research.
Friday, January 12, 2018
Friday, January 5, 2018
C prototype tips
C prototype tips
- C Language: exit function
- Use of exit() function
- Does a static function need the static keyword for the prototype in C?
- Effective C Tip #4 – Prototyping static functions
- Rule 8.1 and static functions
- 5.2 Function Prototypes
- Understanding “extern” keyword in C
- Is forward declaration of methods necessary in c?
- For static functions, if the prototype is not published in the h file, other files may not use the function anyway, so why define it static at all?
- Pointer to Pointer and Reference to Pointer