00001
00002
00003
00004
00005
00006
00007
00008
00009 #include <stdlib.h>
00010 #include <stdio.h>
00011 #include <math.h>
00012 #include <windows.h>
00013
00014 #include "struct.h"
00015 #include "dstruct.h"
00016
00017 #include "simplplt.h"
00018
00019 #define DESELECTED 0
00020 #define SELECTED 1
00021
00022
00023 static HWND hParent;
00024 static HINSTANCE hThisInstance;
00025 static char *szViewClass="OFX:DraftClass";
00026 static SYSTEM_INFO sys_info;
00027 static int DisplayWidth,DisplayHeight,DisplayBits,DisplayPlanes,
00028 xScreen,yScreen;
00029 static DWORD fdwStyle = WS_POPUP | WS_CAPTION | ! WS_SYSMENU |
00030 WS_MAXIMIZEBOX | WS_MINIMIZEBOX | WS_THICKFRAME;
00031 static HCURSOR hcurSave,hcurPen1=NULL;
00032
00033 static int pen=0,stretched=1,tracetool=0;
00034 static long Lv= -1,Fv= -1,Nv=0,Ne=0;
00035 static struct TVLIST {BOOL inc; int x,y; long id;} *TVlist=NULL;
00036 static struct TELIST {BOOL inc; int v1,v2;} *TElist=NULL;
00037
00038 static LRESULT CALLBACK MainWndProc(HWND hWnd,UINT iMessage,WPARAM wParam,LPARAM lParam);
00039 static BOOL MenuCommand(HWND hWnd, WORD id);
00040 static BOOL Viewer(void);
00041 static void DrawRubberLine(HWND hwnd, int x, int y);
00042 static void DrawRubberLines(HWND hwnd, int x, int y);
00043 static void DrawList(HWND hwnd, HDC hDC);
00044 static void AddTraceVertex(int x,int y);
00045 static int GetVertexAtCursor(int x, int y);
00046 static void MoveVertex(HWND hWnd, int x, int y);
00047 static void TraceSubdivide(long v);
00048 static void BuildFromTrace(HWND hWnd);
00049
00050 static BOOL Viewer(void){
00051 MSG msg;
00052 HWND hDesktopWnd,hWnd;
00053 HDC hDCcaps;
00054 WNDCLASS wndclass;
00055 TVlist=NULL; TElist=NULL; Nv=0; Ne=0;
00056 hDesktopWnd = GetDesktopWindow();
00057 hDCcaps = GetDC(hDesktopWnd);
00058 DisplayWidth= GetDeviceCaps(hDCcaps,HORZRES);
00059 DisplayHeight= GetDeviceCaps(hDCcaps,VERTRES);
00060 DisplayBits= GetDeviceCaps(hDCcaps,BITSPIXEL);
00061 DisplayPlanes= GetDeviceCaps(hDCcaps,PLANES);
00062 ReleaseDC(hDesktopWnd,hDCcaps);
00063 GetSystemInfo(&sys_info);
00064 wndclass.style = 0;
00065 wndclass.lpfnWndProc = (WNDPROC)MainWndProc;
00066 wndclass.cbClsExtra = 0 ;
00067 wndclass.cbWndExtra = 0 ;
00068 wndclass.hInstance = hThisInstance ;
00069 wndclass.hIcon = NULL;
00070 wndclass.hCursor = LoadCursor (NULL, IDC_ARROW) ;
00071 wndclass.hbrBackground = GetStockObject (WHITE_BRUSH) ;
00072 wndclass.lpszMenuName = "tracemenu" ;
00073 wndclass.lpszClassName = szViewClass;
00074 if (!RegisterClass (&wndclass)) return FALSE ;
00075 xScreen = GetSystemMetrics (SM_CXSCREEN) ;
00076 yScreen = GetSystemMetrics (SM_CYSCREEN) ;
00077 hWnd = CreateWindow(
00078 szViewClass,
00079 "2D Drafting Utility",
00080 fdwStyle,
00081 25,
00082 25,
00083 xScreen-50,
00084 yScreen-50,
00085 hParent,
00086 NULL,
00087 hThisInstance,
00088 NULL) ;
00089 if(hWnd == NULL)return FALSE;
00090 hcurPen1=LoadCursor(hThisInstance,MAKEINTRESOURCE(IDC_PEN1));
00091 ShowWindow (hWnd,SW_SHOWNA);
00092 PostMessage(hWnd,WM_COMMAND,(WPARAM)IDM_DRAWIT,0);
00093 while(GetMessage (&msg,NULL,0,0)){
00094 TranslateMessage (&msg);
00095 DispatchMessage (&msg);
00096 }
00097 DestroyWindow(hWnd);
00098 if(hcurPen1 != NULL)DeleteObject(hcurPen1);
00099 UnregisterClass(wndclass.lpszClassName,wndclass.hInstance);
00100 if(TVlist != NULL)X__Free(TVlist); TVlist=NULL; Nv=0;
00101 if(TElist != NULL)X__Free(TElist); TElist=NULL; Ne=0;
00102 return TRUE;
00103 }
00104
00105 LRESULT CALLBACK MainWndProc(HWND hWnd,UINT iMessage,WPARAM wParam,
00106 LPARAM lParam){
00107 static BOOL bToolCaptured=FALSE;
00108 static HCURSOR hCursorSave;
00109 static POINT LastPt;
00110 PAINTSTRUCT ps;
00111 HDC hDC;
00112 int i;
00113 RECT rc;
00114 POINT pt;
00115 switch (iMessage) {
00116 case WM_DESTROY:
00117 break;
00118 case WM_COMMAND:
00119 return MenuCommand(hWnd,LOWORD(wParam));
00120 break;
00121 case WM_RBUTTONUP:
00122 if(!bToolCaptured)break;
00123 if(tracetool == 1)DrawRubberLine(hWnd,LOWORD(lParam),HIWORD(lParam));
00124 if(tracetool == 2){
00125 DrawRubberLines(hWnd,LOWORD(lParam),HIWORD(lParam));
00126 MoveVertex(hWnd,LOWORD(lParam),HIWORD(lParam));
00127 }
00128 SetCursor(hCursorSave);
00129 ClipCursor(NULL);
00130 ReleaseCapture();
00131 bToolCaptured=FALSE;
00132 Lv= -1;
00133 break;
00134 case WM_LBUTTONDOWN:
00135 if(tracetool == 0 || bToolCaptured)break;
00136 else if(tracetool == 2){
00137 if((Fv=GetVertexAtCursor(LOWORD(lParam),HIWORD(lParam))) < 0)break;
00138 }
00139 else if(tracetool == 3){
00140 if((Fv=GetVertexAtCursor(LOWORD(lParam),HIWORD(lParam))) >= 0){
00141 if(Ne > 0 && TElist != NULL)for(i=0;i<Ne;i++){
00142 if(TElist[i].v1 == Fv || TElist[i].v2 == Fv)TElist[i].inc=FALSE;
00143 }
00144 TVlist[Fv].inc=FALSE;
00145 InvalidateRect(hWnd,NULL,FALSE);
00146 Fv= -1;
00147 }
00148 break;
00149 }
00150 else if(tracetool == 4){
00151 if((Fv=GetVertexAtCursor(LOWORD(lParam),HIWORD(lParam))) >= 0){
00152 TraceSubdivide(Fv);
00153 InvalidateRect(hWnd,NULL,FALSE);
00154 Fv= -1;
00155 }
00156 break;
00157 }
00158 bToolCaptured=TRUE;
00159 SetCapture(hWnd);
00160 hCursorSave=SetCursor(hcurPen1);
00161 GetClientRect(hWnd,&rc);
00162 pt.x=rc.left; pt.y=rc.top;
00163 ClientToScreen(hWnd,&pt);
00164 rc.left=pt.x; rc.top=pt.y;
00165 pt.x=rc.right; pt.y=rc.bottom;
00166 ClientToScreen(hWnd,&pt);
00167 rc.right=pt.x; rc.bottom=pt.y;
00168 ClipCursor(&rc);
00169 break;
00170 case WM_MOUSEMOVE:
00171 if(!bToolCaptured)break;
00172 if(tracetool == 1){
00173 DrawRubberLine(hWnd,(int)LastPt.x,(int)LastPt.y);
00174 LastPt.x=LOWORD(lParam); LastPt.y=HIWORD(lParam);
00175 DrawRubberLine(hWnd,(int)LastPt.x,(int)LastPt.y);
00176 }
00177 if(tracetool == 2){
00178 DrawRubberLines(hWnd,(int)LastPt.x,(int)LastPt.y);
00179 LastPt.x=LOWORD(lParam); LastPt.y=HIWORD(lParam);
00180 DrawRubberLines(hWnd,(int)LastPt.x,(int)LastPt.y);
00181 }
00182 break;
00183 case WM_LBUTTONUP:
00184 if(!bToolCaptured)break;
00185 if(tracetool == 1){
00186 LastPt.x=LOWORD(lParam); LastPt.y=HIWORD(lParam);
00187 if(Lv >= 0)DrawRubberLine(hWnd,(int)LastPt.x,(int)LastPt.y);
00188 AddTraceVertex((int)LOWORD(lParam),(int)HIWORD(lParam));
00189 DrawList(hWnd,NULL);
00190 DrawRubberLine(hWnd,(int)LastPt.x,(int)LastPt.y);
00191 }
00192 else if(tracetool == 2){
00193 if(Lv < 0){
00194 Lv=Fv; Fv=-1;
00195 LastPt.x=LOWORD(lParam); LastPt.y=HIWORD(lParam);
00196 DrawRubberLines(hWnd,(int)LastPt.x,(int)LastPt.y);
00197 }
00198 else{
00199 DrawRubberLines(hWnd,LOWORD(lParam),HIWORD(lParam));
00200 MoveVertex(hWnd,LOWORD(lParam),HIWORD(lParam));
00201 SetCursor(hCursorSave);
00202 ClipCursor(NULL);
00203 ReleaseCapture();
00204 bToolCaptured=FALSE;
00205 Lv= -1;
00206 }
00207 }
00208 break;
00209 case WM_PAINT:
00210 hDC = BeginPaint(hWnd, &ps);
00211 GetClientRect(hWnd,&rc);
00212 PatBlt(hDC,0,0,rc.right,rc.bottom,PATCOPY);
00213 DrawList(hWnd,hDC);
00214 EndPaint(hWnd,&ps);
00215 break ;
00216 case WM_SIZE:
00217 InvalidateRect(hWnd,NULL,FALSE);
00218 return 0;
00219 default:
00220 return DefWindowProc (hWnd, iMessage, wParam, lParam) ;
00221 }
00222 return 0L ;
00223 }
00224
00225 BOOL MenuCommand (HWND hWnd, WORD id){
00226 int i;
00227 switch (id) {
00228 case IDM_PEN_RED : pen=0; goto PENID;
00229 case IDM_PEN_WHITE: pen=1; goto PENID;
00230 case IDM_PEN_BLACK: pen=2; goto PENID;
00231 case IDM_PEN_CYAN : pen=3; goto PENID;
00232 PENID:
00233 CheckMenuItem(GetMenu(hWnd),IDM_PEN_RED,MF_UNCHECKED);
00234 CheckMenuItem(GetMenu(hWnd),IDM_PEN_WHITE,MF_UNCHECKED);
00235 CheckMenuItem(GetMenu(hWnd),IDM_PEN_BLACK,MF_UNCHECKED);
00236 CheckMenuItem(GetMenu(hWnd),IDM_PEN_CYAN,MF_UNCHECKED);
00237 if(pen == 0)CheckMenuItem(GetMenu(hWnd),IDM_PEN_RED,MF_CHECKED);
00238 if(pen == 1)CheckMenuItem(GetMenu(hWnd),IDM_PEN_WHITE,MF_CHECKED);
00239 if(pen == 2)CheckMenuItem(GetMenu(hWnd),IDM_PEN_BLACK,MF_CHECKED);
00240 if(pen == 3)CheckMenuItem(GetMenu(hWnd),IDM_PEN_CYAN,MF_CHECKED);
00241 DrawList(hWnd,NULL);
00242 break;
00243 case IDM_ADD:
00244 Lv= -1;
00245 EnableMenuItem(GetMenu(hWnd),IDM_ADD,MF_GRAYED);
00246 EnableMenuItem(GetMenu(hWnd),IDM_MOVE,MF_ENABLED);
00247 EnableMenuItem(GetMenu(hWnd),IDM_DELETE,MF_ENABLED);
00248 EnableMenuItem(GetMenu(hWnd),IDM_INSERT,MF_ENABLED);
00249 DrawMenuBar(hWnd);
00250 tracetool=1;
00251 break;
00252 case IDM_MOVE:
00253 Lv= -1;
00254 EnableMenuItem(GetMenu(hWnd),IDM_ADD,MF_ENABLED);
00255 EnableMenuItem(GetMenu(hWnd),IDM_MOVE,MF_GRAYED);
00256 EnableMenuItem(GetMenu(hWnd),IDM_DELETE,MF_ENABLED);
00257 EnableMenuItem(GetMenu(hWnd),IDM_INSERT,MF_ENABLED);
00258 DrawMenuBar(hWnd);
00259 tracetool=2;
00260 break;
00261 case IDM_DELETE:
00262 Lv= -1;
00263 EnableMenuItem(GetMenu(hWnd),IDM_ADD,MF_ENABLED);
00264 EnableMenuItem(GetMenu(hWnd),IDM_MOVE,MF_ENABLED);
00265 EnableMenuItem(GetMenu(hWnd),IDM_DELETE,MF_GRAYED);
00266 EnableMenuItem(GetMenu(hWnd),IDM_INSERT,MF_ENABLED);
00267 DrawMenuBar(hWnd);
00268 tracetool=3;
00269 break;
00270 case IDM_INSERT:
00271 Lv= -1;
00272 EnableMenuItem(GetMenu(hWnd),IDM_ADD,MF_ENABLED);
00273 EnableMenuItem(GetMenu(hWnd),IDM_MOVE,MF_ENABLED);
00274 EnableMenuItem(GetMenu(hWnd),IDM_DELETE,MF_ENABLED);
00275 EnableMenuItem(GetMenu(hWnd),IDM_INSERT,MF_GRAYED);
00276 DrawMenuBar(hWnd);
00277 tracetool=4;
00278 break;
00279 case IDM_EXIT:
00280 BuildFromTrace(hWnd);
00281 case IDM_ABORT:
00282 PostQuitMessage(0);
00283 break;
00284 default:
00285 break;
00286 }
00287 return TRUE;
00288 }
00289
00290 static void DrawRubberLine(HWND hwnd, int x, int y){
00291 HPEN hOldPen,MyPen;
00292 int oldROP;
00293 HDC hDClocal;
00294 if(Lv < 0)return;
00295 hDClocal=GetDC(hwnd);
00296 if(pen == 0)MyPen=CreatePen(PS_SOLID,0,RGB(255,0,0));
00297 if(pen == 1)MyPen=CreatePen(PS_SOLID,0,RGB(0,0,255));
00298 if(pen == 2)MyPen=CreatePen(PS_SOLID,0,RGB(0,0,0));
00299 if(pen == 3)MyPen=CreatePen(PS_SOLID,0,RGB(0,255,0));
00300 hOldPen=SelectObject(hDClocal,MyPen);
00301 oldROP=SetROP2(hDClocal,R2_NOT);
00302 MoveToEx(hDClocal,x,y,NULL);
00303 LineTo(hDClocal,TVlist[Lv].x,TVlist[Lv].y);
00304 SetROP2(hDClocal,oldROP);
00305 SelectObject(hDClocal,hOldPen);
00306 DeleteObject(MyPen);
00307 ReleaseDC(hwnd,hDClocal);
00308 }
00309
00310 static void DrawRubberLines(HWND hwnd, int x, int y){
00311 int i,v1,v2;
00312 HPEN hOldPen;
00313 int oldROP;
00314 HDC hDClocal;
00315 if(Lv < 0 || Ne == 0)return;
00316 hDClocal=GetDC(hwnd);
00317 hOldPen=SelectObject(hDClocal,GetStockObject(WHITE_PEN));
00318 oldROP=SetROP2(hDClocal,R2_NOT);
00319 for(i=0;i<Ne;i++){
00320 if(!TElist[i].inc)continue;
00321 v1=TElist[i].v1; v2=TElist[i].v2;
00322 if(TVlist[v1].inc && v1 == Lv){
00323 MoveToEx(hDClocal,x,y,NULL);
00324 LineTo(hDClocal,TVlist[v2].x,TVlist[v2].y);
00325 }
00326 else if(TVlist[v2].inc && v2 == Lv){
00327 MoveToEx(hDClocal,x,y,NULL);
00328 LineTo(hDClocal,TVlist[v1].x,TVlist[v1].y);
00329 }
00330 }
00331 SetROP2(hDClocal,oldROP);
00332 SelectObject(hDClocal,hOldPen);
00333 ReleaseDC(hwnd,hDClocal);
00334 }
00335
00336 static void DrawList(HWND hwnd, HDC hDC){
00337 int i,x,y;
00338 HPEN hOldPen,MyPen;
00339 HBRUSH hOldBrush;
00340 HDC hDClocal;
00341 if(hDC == NULL){
00342 hDClocal=GetDC(hwnd);
00343 }
00344 else hDClocal=hDC;
00345 if(pen == 0)MyPen=CreatePen(PS_SOLID,0,RGB(255,0,0));
00346 if(pen == 1)MyPen=CreatePen(PS_SOLID,0,RGB(0,0,255));
00347 if(pen == 2)MyPen=CreatePen(PS_SOLID,0,RGB(0,0,0));
00348 if(pen == 3)MyPen=CreatePen(PS_SOLID,0,RGB(0,255,0));
00349 hOldPen=SelectObject(hDClocal,MyPen);
00350 hOldBrush=SelectObject(hDClocal,GetStockObject(BLACK_BRUSH));
00351 if(Ne > 0 && TElist != NULL){
00352 for(i=0;i<Ne;i++){
00353 if(!TElist[i].inc)continue;
00354 x=TVlist[TElist[i].v1].x; y=TVlist[TElist[i].v1].y;
00355 MoveToEx(hDClocal,x,y,NULL);
00356 x=TVlist[TElist[i].v2].x; y=TVlist[TElist[i].v2].y;
00357 LineTo(hDClocal,x,y);
00358 }
00359 }
00360 if(Nv > 0 && TVlist != NULL){
00361 for(i=0;i<Nv;i++)if(TVlist[i].inc)Rectangle(hDClocal,
00362 TVlist[i].x-2,TVlist[i].y-2,TVlist[i].x+2,TVlist[i].y+2);
00363 }
00364 SelectObject(hDClocal,hOldPen);
00365 SelectObject(hDClocal,hOldBrush);
00366 DeleteObject(MyPen);
00367 if(hDC == NULL){
00368 ReleaseDC(hwnd,hDClocal);
00369 }
00370 }
00371
00372 static void AddTraceVertex(int x,int y){
00373 int i,id,found=0,flag=0;
00374 struct TVLIST *v;
00375 struct TELIST *e;
00376 if(Nv > 0){
00377 for(i=0;i<Nv;i++){
00378 if(TVlist[i].inc && abs(x-TVlist[i].x) < 4 && abs(y-TVlist[i].y) < 4){
00379 found=1;
00380 if(Lv >= 0)flag=1;
00381 id=i;
00382 }
00383 }
00384 }
00385 if(!found){
00386 if(TVlist == NULL){
00387 if((v=(struct TVLIST *)X__Malloc(sizeof(struct TVLIST))) == NULL)return;
00388 }
00389 else{
00390 if((v=(struct TVLIST *)X__Realloc(TVlist,(Nv+1)*sizeof(struct TVLIST))) == NULL)return;
00391 }
00392 TVlist=v;
00393 v[Nv].x=x; v[Nv].y=y; v[Nv].inc=TRUE;
00394 id=Nv;
00395 Nv++;
00396 }
00397 if(Lv < 0){
00398 Lv=id;
00399 }
00400 else{
00401 if(TElist == NULL){
00402 if((e=(struct TELIST *)X__Malloc(sizeof(struct TELIST))) == NULL)return;
00403 }
00404 else{
00405 if((e=(struct TELIST *)X__Realloc(TElist,(Ne+1)*sizeof(struct TELIST))) == NULL)return;
00406 }
00407 TElist=e;
00408 e[Ne].v1=id; e[Ne].v2=Lv; e[Ne].inc=TRUE;
00409 Lv=id;
00410 Ne++;
00411 }
00412 if(flag)Lv= -1;
00413 }
00414
00415 static void MoveVertex(HWND hWnd,int x, int y){
00416 if(Lv < 0)return;
00417 TVlist[Lv].x=x; TVlist[Lv].y=y;
00418 InvalidateRect(hWnd,NULL,FALSE);
00419 return;
00420 }
00421
00422 int GetVertexAtCursor(int x, int y){
00423 int i,id= -1;
00424 if(Nv > 0)for(i=0;i<Nv;i++){
00425 if(TVlist[i].inc && abs(x-TVlist[i].x) < 4 && abs(y-TVlist[i].y) < 4)id=i;
00426 }
00427 return id;
00428 }
00429
00430 static void TraceSubdivide(long vv){
00431 struct TVLIST *v;
00432 struct TELIST *e;
00433 int ne1,i,x,y;
00434 if(Nv == 0 || Ne == 0 || TVlist == NULL || TElist == NULL)return;
00435 ne1=Ne; for(i=0;i<ne1;i++){
00436 if(!TElist[i].inc)continue;
00437 x=(TVlist[TElist[i].v1].x+TVlist[TElist[i].v2].x)/2;
00438 y=(TVlist[TElist[i].v1].y+TVlist[TElist[i].v2].y)/2;
00439 if(TElist[i].v1 == vv){
00440 if((v=(struct TVLIST *)X__Realloc(TVlist,(Nv+1)*sizeof(struct TVLIST))) == NULL)return;
00441 TVlist=v; v[Nv].x=x; v[Nv].y=y; v[Nv].inc=TRUE;
00442 TElist[i].v1=Nv;
00443 if((e=(struct TELIST *)X__Realloc(TElist,(Ne+1)*sizeof(struct TELIST))) == NULL)return;
00444 TElist=e; e[Ne].v1=Nv; e[Ne].v2=vv; e[Ne].inc=TRUE;
00445 Ne++;
00446 Nv++;
00447 }
00448 else if(TElist[i].v2 == vv){
00449 if((v=(struct TVLIST *)X__Realloc(TVlist,(Nv+1)*sizeof(struct TVLIST))) == NULL)return;
00450 TVlist=v; v[Nv].x=x; v[Nv].y=y; v[Nv].inc=TRUE;
00451 TElist[i].v2=Nv;
00452 if((e=(struct TELIST *)X__Realloc(TElist,(Ne+1)*sizeof(struct TELIST))) == NULL)return;
00453 TElist=e; e[Ne].v1=Nv; e[Ne].v2=vv; e[Ne].inc=TRUE;
00454 Ne++;
00455 Nv++;
00456 }
00457 }
00458 }
00459
00460 static void BuildFromTrace(HWND hWnd){
00461 RECT rc;
00462 long Scale,v1,v2;
00463 int i,vc=0,ec=0;
00464 GetClientRect(hWnd,&rc);
00465 if(Nv == 0 || TVlist == NULL)return;
00466 Scale=100;
00467 for(i=0;i<Nv;i++){
00468 if(TVlist[i].inc)vc++;
00469 TVlist[i].id = -1;
00470 }
00471 if(vc == 0)return;
00472 UpdateVertexHeap(Nvert+vc);
00473 for(i=0;i<Nv;i++){
00474 if(!TVlist[i].inc)continue;
00475 CreateVertex();
00476 (MainVp+Nvert-1)->xyz[0]=TVlist[i].x*Scale;
00477 (MainVp+Nvert-1)->xyz[1]=NpointerY;
00478 (MainVp+Nvert-1)->xyz[2]=(rc.bottom-TVlist[i].y)*Scale;
00479 TVlist[i].id=Nvert-1;
00480 }
00481 if(Ne == 0)return;
00482 for(i=0;i<Ne;i++)if(TVlist[i].inc)ec++;
00483 if(ec == 0)return;
00484 UpdateEdgeHeap(Nedge+vc);
00485 for(i=0;i<Ne;i++){
00486 if(!TElist[i].inc)continue;
00487 v1=TVlist[TElist[i].v1].id; v2=TVlist[TElist[i].v2].id;
00488 if(v1 >= 0 && v2 >= 0)CreateEdge(v1,v2);
00489 }
00490 }
00491
00492 #if __WATCOMC__
00493 int APIENTRY LibMain(HANDLE hDLL, DWORD dwReason, LPVOID lpReserved){
00494 #else
00495 BOOL WINAPI DllMain(HANDLE hDLL, DWORD dwReason, LPVOID lpReserved){
00496 #endif
00497 switch (dwReason) {
00498 case DLL_PROCESS_ATTACH: {
00499 hThisInstance=hDLL;
00500 if(hDLL == NULL)MessageBox ( GetFocus()," NULL instance",NULL, MB_OK);
00501 break;
00502 }
00503 case DLL_PROCESS_DETACH:
00504 break;
00505 }
00506 return TRUE;
00507 }
00508
00509 #if __SC__
00510 #pragma startaddress(DllMain)
00511 #endif
00512
00513 BOOL _Xmodeler
00514 (HWND parent_window,HWND info_window,X__STRUCTURE *lpevi){
00515 lpEVI=lpevi;
00516 tracetool=0;
00517 hParent=parent_window;
00518 return Viewer();
00519 }