Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
Surfaces.cpp
Package: solidgraph_sources.zip [view]
Upload User: kairuinn
Upload Date: 2009-02-07
Package Size: 2922k
Code Size: 10k
Category:
Graph program
Development Platform:
Visual C++
- // Surfaces.cpp : Defines the initialization routines for the DLL.
- //
- #include "stdafx.h"
- #include "resource.h"
- #include <afxdllx.h>
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- unsigned int endID = 0;
- unsigned int startID = 0;
- REGIME active_regime = REGIME_NONE;
- #include "Commands//FaceCommand.h"
- #include "Commands//Coons2Command.h"
- #include "Commands//Coons3Command.h"
- #include "Commands//Coons4Command.h"
- #include "Commands//SplineSurf.h"
- #include "Commands//LinearSurf.h"
- extern "C" AFX_EXTENSION_MODULE SurfacesDLL = { NULL, NULL };
- extern "C" int APIENTRY
- DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)
- {
- // Remove this if you use lpReserved
- UNREFERENCED_PARAMETER(lpReserved);
- if (dwReason == DLL_PROCESS_ATTACH)
- {
- TRACE0("Surfaces.DLL Initializing!n");
- // Extension DLL one-time initialization
- if (!AfxInitExtensionModule(SurfacesDLL, hInstance))
- return 0;
- new CDynLinkLibrary(SurfacesDLL);
- }
- else if (dwReason == DLL_PROCESS_DETACH)
- {
- TRACE0("Surfaces.DLL Terminating!n");
- AfxTermExtensionModule(SurfacesDLL);
- }
- return 1; // ok
- }
- extern "C" AFX_EXT_API void GetPluginInfo(PLUGIN_INFO* plInfo)
- {
- SWITCH_RESOURCE
- plInfo->plugin_type = PLUGIN_TOOLBAR;
- plInfo->menu_string.LoadString(IDS_MENU_STRING);
- plInfo->show_after_load = true;
- plInfo->in_trial_version = true;
- plInfo->plugin_version = 1;
- plInfo->solidgraph_version = 1;
- plInfo->kernel_version = 1;
- }
- extern "C" AFX_EXT_API void ResetNames()
- {
- face_name_index = 1;
- coons_name_index = 1;
- spline_surface_index = 1;
- linear_surface_index = 1;
- }
- extern "C" AFX_EXT_API void GetToolbar(unsigned int start_ID_from_app,
- CToolBar* pToolbar,
- CWnd* pPar)
- {
- SWITCH_RESOURCE
- startID = endID = start_ID_from_app;
- if (!pToolbar->CreateEx(pPar, TBSTYLE_FLAT, WS_CHILD | CBRS_TOP
- | CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC) ||
- !pToolbar->LoadToolBar(MAKEINTRESOURCE(IDR_TOOLBAR)))
- {
- TRACE0("Failed to create toolbar 2Dn");
- return; // fail to create
- }
- //Load32BitmapOnToolbar(pToolbar,IDB_TOOLBAR32_BMP);
- pToolbar->GetToolBarCtrl().SetCmdID(0,endID++);
- pToolbar->GetToolBarCtrl().SetCmdID(1,endID++);
- pToolbar->GetToolBarCtrl().SetCmdID(2,endID++);
- pToolbar->GetToolBarCtrl().SetCmdID(3,endID++);
- pToolbar->GetToolBarCtrl().SetCmdID(4,endID++);
- pToolbar->GetToolBarCtrl().SetCmdID(5,endID++);
- pToolbar->EnableDocking(CBRS_ALIGN_ANY);
- ResetNames();
- }
- extern "C" AFX_EXT_API HBITMAP GetToolbarBitmap(LPWORD wC)
- {
- HBITMAP hBitmap = NULL;
- /*if ( NULL == hInst )
- hInst = ::AfxFindResourceHandle( IDB_TOOLBAR32_BMP, RT_BITMAP);*/
- HRSRC hRsrc = ::FindResource(SurfacesDLL.hResource,
- MAKEINTRESOURCE(IDB_TOOLBAR32_BMP), RT_BITMAP);
- if ( hRsrc ){
- HGLOBAL hglb = LoadResource(SurfacesDLL.hResource, hRsrc);
- if ( hglb ){
- // 阻蜞屐 玎泐腩忸