Changeset 500 in dev for trunk/ab5.0/abdev


Ignore:
Timestamp:
Apr 23, 2008, 1:57:14 PM (16 years ago)
Author:
dai_9181
Message:

いくつかのメニューをMainFrameに実装しなおした

Location:
trunk/ab5.0/abdev/abdev
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/ab5.0/abdev/abdev/abdev.cpp

    r499 r500  
    8888#endif
    8989
    90 
    91 void CreateProcessWithStdHandle( const std::string &appPath, const std::string &cmdLine)
    92 {
    93     std::string argsStr = (std::string)"\"" + appPath + "\" " + cmdLine;
    94     STARTUPINFO si;
    95     PROCESS_INFORMATION pi;
    96     memset(&si,0,sizeof(STARTUPINFO));
    97     si.cb=sizeof(STARTUPINFO);
    98     si.dwFlags = STARTF_USESTDHANDLES | STARTF_USESHOWWINDOW;
    99     si.wShowWindow = SW_HIDE;
    100     si.hStdOutput = GetStdHandle(STD_OUTPUT_HANDLE);
    101     si.hStdInput = GetStdHandle(STD_INPUT_HANDLE);
    102     si.hStdError = GetStdHandle(STD_ERROR_HANDLE);
    103    
    104     char args[8192];
    105     lstrcpy( args, argsStr.c_str() );
    106 
    107     CreateProcess( NULL, args, NULL, NULL, FALSE, NORMAL_PRIORITY_CLASS, NULL, NULL, &si, &pi );
    108 }
    10990
    11091void ToBigChar(char str[]){
     
    13441325LRESULT CALLBACK WindowFunc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
    13451326    int i,i2,WndNum;
    1346     char str[MAX_PATH],temporary[1024],temp2[MAX_PATH],temp3[MAX_PATH],*pTemp;
     1327    char str[MAX_PATH],temporary[1024],temp2[MAX_PATH],*pTemp;
    13471328    HWND hChild;
    13481329    RECT rect;
     
    13501331    HDROP hDrop;
    13511332    HGLOBAL hGlobal;
    1352     HANDLE hFile;
    13531333
    13541334    static COLORREF colorUser=RGB(255,255,255);
     
    13741354
    13751355#ifndef THETEXT
    1376                 case IDM_DEBUG:
    1377                     if(pobj_Debugger->IsDebugging()){
    1378                         pobj_Debugger->DebugContinue();
    1379                         return 0;
    1380                     }
    1381 
    1382                     hChild=GetWindow(hClient,GW_CHILD);
    1383                     if(ProjectInfo.name[0]){
    1384                         //プロジェクトが開かれている場合
    1385                         if(!SetProjectToRun()) return 0;
    1386 
    1387                         //デバッグ用のコマンドライン及び実行可能ファイル(DLLのみ)
    1388                         sprintf(temporary,"%s\r\n%s",ProjectInfo.szExePath,ProjectInfo.szCmdLine);
    1389                         sprintf(temp2,"%spgm.tmp",pj_editor_Dir);
    1390                         hFile=CreateFile(temp2,GENERIC_WRITE,0,NULL,CREATE_ALWAYS,FILE_ATTRIBUTE_ARCHIVE|FILE_ATTRIBUTE_HIDDEN|FILE_ATTRIBUTE_TEMPORARY,NULL);
    1391                         DWORD dwAccessBytes;
    1392                         WriteFile(hFile,temporary,lstrlen(temporary),&dwAccessBytes,NULL);
    1393                         CloseHandle(hFile);
    1394 
    1395                         //ソースファイル名をtemp2へ
    1396                         ProjectInfo.pobj_DBFileInfo->ppobj_FileInfo[0]->GetFullPath(temp2);
    1397 
    1398                         //出力ファイル名をtemp3へ
    1399                         lstrcpy(temp3,ProjectInfo.lpszOutput_Debug);
    1400                         GetFullPath(temp3,ProjectInfo.dir);
    1401 
    1402                         if(IsNeedCompileForProject(1))
    1403                             sprintf(temporary,"\"%s\" \"%s\" /debug /run /wnd:%08x",temp2,temp3,hwnd);
    1404                         else
    1405                             sprintf(temporary,"\"%s\" \"%s\" /run /wnd:%08x",temp2,temp3,hwnd);
    1406 
    1407                         //DLLオプション
    1408                         if(ProjectInfo.dwModuleType==MT_DLL) lstrcat(temporary," /dll");
    1409 
    1410                         //Unicodeオプション
    1411                         if(ProjectInfo.dwOption & PJ_OP_UNICODE) lstrcat(temporary," /unicode");
    1412 
    1413                         //ブレークポイントをセーブ
    1414                         ProjectInfo.pobj_DBBreakPoint->SaveToTempFile();
    1415                     }
    1416                     else{
    1417                         //単独ソースコード
    1418                         if(!SetRunning(hChild)) return 0;
    1419                         if(IsNeedCompile(MdiInfo[GetWndNum(hChild)].path,1))
    1420                             sprintf(temporary,"\"%s\" /debug /run /wnd:%08x",MdiInfo[GetWndNum(hChild)].path,hwnd);
    1421                         else
    1422                             sprintf(temporary,"\"%s\" /run /wnd:%08x",MdiInfo[GetWndNum(hChild)].path,hwnd);
    1423 
    1424                         //ブレークポイントをセーブ
    1425                         pobj_DBBreakPoint->SaveToTempFile();
    1426                     }
    1427 
    1428                     //コンパイルビューをクリップするかどうか
    1429                     if(bClipCompileView){
    1430                         lstrcat(temporary," /clip_compile_view");
    1431 
    1432                         //コンパイラビューを閉じる
    1433                         if(hCompileView==(HWND)-1) return 0;
    1434                         if(hCompileView){
    1435                             hChild=hCompileView;
    1436                             hCompileView=(HWND)-1;
    1437                             SendMessage(hChild,WM_COMMAND,IDCANCEL,0);
    1438                         }
    1439 
    1440                         //重複起動防止のため
    1441                         hCompileView=(HWND)-1;
    1442                     }
    1443 
    1444                     //インクルードディレクトリ
    1445                     sprintf(temp2," /include_dir:\"%s\"",pobj_nv->GetIncludeDirFullPath().c_str());
    1446                     lstrcat(temporary,temp2);
    1447 
    1448                     CreateProcessWithStdHandle( ActiveBasic::Common::Environment::GetCompilerExePath( selectingPlatform ), temporary );
    1449 
    1450                     return 0;
    1451                 case IDM_DEBUGCOMPILE:
    1452                     hChild=GetWindow(hClient,GW_CHILD);
    1453                     if(ProjectInfo.name[0]){
    1454                         //プロジェクトが開かれている場合
    1455                         if(!SetProjectToRun()) return 0;
    1456 
    1457                         //ソースファイル名をtemp2へ
    1458                         ProjectInfo.pobj_DBFileInfo->ppobj_FileInfo[0]->GetFullPath(temp2);
    1459 
    1460                         //出力ファイル名をtemp3へ
    1461                         lstrcpy(temp3,ProjectInfo.lpszOutput_Debug);
    1462                         GetFullPath(temp3,ProjectInfo.dir);
    1463 
    1464                         sprintf(temporary,"\"%s\" \"%s\" /debug /wnd:%08x",temp2,temp3,hwnd);
    1465 
    1466                         //DLLオプション
    1467                         if(ProjectInfo.dwModuleType==MT_DLL) lstrcat(temporary," /dll");
    1468 
    1469                         //Unicodeオプション
    1470                         if(ProjectInfo.dwOption & PJ_OP_UNICODE) lstrcat(temporary," /unicode");
    1471                     }
    1472                     else{
    1473                         //単独ソースコード
    1474                         if(!SetRunning(hChild)) return 0;
    1475                         sprintf(temporary,"\"%s\" /debug /wnd:%08x",MdiInfo[GetWndNum(hChild)].path,hwnd);
    1476                     }
    1477 
    1478                     //コンパイルビューをクリップするかどうか
    1479                     if(bClipCompileView){
    1480                         lstrcat(temporary," /clip_compile_view");
    1481 
    1482                         //コンパイラビューを閉じる
    1483                         if(hCompileView==(HWND)-1) return 0;
    1484                         if(hCompileView){
    1485                             hChild=hCompileView;
    1486                             hCompileView=(HWND)-1;
    1487                             SendMessage(hChild,WM_COMMAND,IDCANCEL,0);
    1488                         }
    1489 
    1490                         //重複起動防止のため
    1491                         hCompileView=(HWND)-1; 
    1492                     }
    1493 
    1494                     //インクルードディレクトリ
    1495                     sprintf(temp2," /include_dir:\"%s\"",pobj_nv->GetIncludeDirFullPath().c_str());
    1496                     lstrcat(temporary,temp2);
    1497 
    1498                     CreateProcessWithStdHandle( ActiveBasic::Common::Environment::GetCompilerExePath( selectingPlatform ), temporary );
    1499 
    1500                     return 0;
    1501                 case IDM_ATTACH:
    1502                     int idProcess;
    1503                     DWORD dwPlatform;
    1504                     idProcess=DialogBoxParam(hResInst,MAKEINTRESOURCE(IDD_ATTACH),hwnd,(DLGPROC)DlgAttach,(LPARAM)&dwPlatform);
    1505                     if(idProcess==0) return 0;
    1506 
    1507                     sprintf(temporary,"/attach:%08x /wnd:%08x",idProcess,hwnd);
    1508 
    1509                     //コンパイルビューをクリップするかどうか
    1510                     if(bClipCompileView){
    1511                         lstrcat(temporary," /clip_compile_view");
    1512 
    1513                         //コンパイラビューを閉じる
    1514                         if(hCompileView==(HWND)-1) return 0;
    1515                         if(hCompileView){
    1516                             hChild=hCompileView;
    1517                             hCompileView=(HWND)-1;
    1518                             SendMessage(hChild,WM_COMMAND,IDCANCEL,0);
    1519                         }
    1520 
    1521                         //重複起動防止のため
    1522                         hCompileView=(HWND)-1;
    1523                     }
    1524 
    1525                     //インクルードディレクトリ
    1526                     sprintf(temp2," /include_dir:\"%s\"",pobj_nv->GetIncludeDirFullPath().c_str());
    1527                     lstrcat(temporary,temp2);
    1528 
    1529                     ActiveBasic::Common::Platform::EnumType platform;
    1530                     if(dwPlatform==IMAGE_FILE_MACHINE_I386)
    1531                     {
    1532                         platform = ActiveBasic::Common::Platform::X86;
    1533                     }
    1534                     else if(dwPlatform==IMAGE_FILE_MACHINE_AMD64)
    1535                     {
    1536                         platform = ActiveBasic::Common::Platform::X64;
    1537                     }
    1538                     else
    1539                     {
    1540                         throw;
    1541                     }
    1542 
    1543                     CreateProcessWithStdHandle( ActiveBasic::Common::Environment::GetCompilerExePath( platform ), temporary );
    1544 
    1545                     return 0;
    1546                 case IDM_RELEASECOMPILE:
    1547                     hChild=GetWindow(hClient,GW_CHILD);
    1548                     if(ProjectInfo.name[0]){
    1549                         //プロジェクトが開かれている場合
    1550                         if(!SetProjectToRun()) return 0;
    1551 
    1552                         //ソースファイル名をtemp2へ
    1553                         ProjectInfo.pobj_DBFileInfo->ppobj_FileInfo[0]->GetFullPath(temp2);
    1554 
    1555                         //出力ファイル名をtemp3へ
    1556                         lstrcpy(temp3,ProjectInfo.lpszOutput_Release);
    1557                         GetFullPath(temp3,ProjectInfo.dir);
    1558 
    1559                         sprintf(temporary,"\"%s\" \"%s\" /wnd:%08x",temp2,temp3,hwnd);
    1560 
    1561                         //DLLオプション
    1562                         if(ProjectInfo.dwModuleType==MT_DLL) lstrcat(temporary," /dll");
    1563 
    1564                         //Unicodeオプション
    1565                         if(ProjectInfo.dwOption & PJ_OP_UNICODE) lstrcat(temporary," /unicode");
    1566                     }
    1567                     else{
    1568                         //単独ソースコード
    1569                         if(!SetRunning(hChild)) return 0;
    1570                         sprintf(temporary,"\"%s\" /wnd:%08x",MdiInfo[GetWndNum(hChild)].path,hwnd);
    1571                     }
    1572 
    1573                     //コンパイルビューをクリップするかどうか
    1574                     if(bClipCompileView){
    1575                         lstrcat(temporary," /clip_compile_view");
    1576 
    1577                         //コンパイラビューを閉じる
    1578                         if(hCompileView==(HWND)-1) return 0;
    1579                         if(hCompileView){
    1580                             hChild=hCompileView;
    1581                             hCompileView=(HWND)-1;
    1582                             SendMessage(hChild,WM_COMMAND,IDCANCEL,0);
    1583                         }
    1584 
    1585                         //重複起動防止のため
    1586                         hCompileView=(HWND)-1;
    1587                     }
    1588 
    1589                     //インクルードディレクトリ
    1590                     sprintf(temp2," /include_dir:\"%s\"",pobj_nv->GetIncludeDirFullPath().c_str());
    1591                     lstrcat(temporary,temp2);
    1592 
    1593                     CreateProcessWithStdHandle( ActiveBasic::Common::Environment::GetCompilerExePath( selectingPlatform ), temporary );
    1594 
    1595                     return 0;
    1596                 case IDM_RELEASERUN:
    1597                     hChild=GetWindow(hClient,GW_CHILD);
    1598                     if(ProjectInfo.name[0]){
    1599 /*                      //プロジェクトが開かれている場合
    1600                         if(!SetProjectToRun()) return 0;
    1601 
    1602                         //必要であればリリースコンパイル
    1603                         if(IsNeedCompileForProject(0))
    1604                             SendMessage(hwnd,WM_COMMAND,IDM_RELEASECOMPILE,0);*/
    1605 
    1606                         if(ProjectInfo.dwModuleType==MT_DLL){
    1607                             lstrcpy(temporary,ProjectInfo.szExePath);
    1608                         }
    1609                         else{
    1610                             lstrcpy(temporary,ProjectInfo.lpszOutput_Debug);
    1611                             GetFullPath(temporary,ProjectInfo.dir);
    1612                         }
    1613                     }
    1614                     else{
    1615 /*                      //必要であればリリースコンパイル
    1616                         if(!SetRunning(hChild)) return 0;
    1617 
    1618                         if(IsNeedCompile(MdiInfo[GetWndNum(hChild)].path,0))
    1619                             SendMessage(hwnd,WM_COMMAND,IDM_RELEASECOMPILE,0);*/
    1620 
    1621                         //単独ソースコード
    1622                         _splitpath(MdiInfo[GetWndNum(hChild)].path,temporary,temp2,temp3,NULL);
    1623                         lstrcat(temporary,temp2);
    1624                         lstrcat(temporary,temp3);
    1625                         lstrcat(temporary,".exe");
    1626                     }
    1627 
    1628                     //インクルードディレクトリ
    1629                     sprintf(temp2," /include_dir:\"%s\"",pobj_nv->GetIncludeDirFullPath().c_str());
    1630                     lstrcat(temporary,temp2);
    1631 
    1632                     ShellExecute(hwnd,"open",temporary,NULL,NULL,SW_SHOWNORMAL);
    1633                     return 0;
    16341356
    16351357
  • trunk/ab5.0/abdev/abdev/include/MainFrame.h

    r499 r500  
    140140    // 「オプション」メニューがクリックされた
    141141    void OnCmdSet( UINT uNotifyCode, int nID, CWindow wndCtl );
     142
     143    // 「デバッグ実行」メニューがクリックされた
     144    void OnCmdDebug( UINT uNotifyCode, int nID, CWindow wndCtl );
     145
     146    // 「デバッグビルド」メニューがクリックされた
     147    void OnCmdDebugCompile( UINT uNotifyCode, int nID, CWindow wndCtl );
     148
     149    // 「アタッチ」メニューがクリックされた
     150    void OnCmdAttach( UINT uNotifyCode, int nID, CWindow wndCtl );
     151
     152    // 「リリースビルド」メニューがクリックされた
     153    void OnCmdReleaseCompile( UINT uNotifyCode, int nID, CWindow wndCtl );
     154
     155    // 「リリース実行」メニューがクリックされた
     156    void OnCmdReleaseRun( UINT uNotifyCode, int nID, CWindow wndCtl );
    142157
    143158private:
     
    207222#endif
    208223        COMMAND_ID_HANDLER_EX( IDM_SET, OnCmdSet )
     224        COMMAND_ID_HANDLER_EX( IDM_DEBUG, OnCmdDebug )
     225        COMMAND_ID_HANDLER_EX( IDM_DEBUGCOMPILE, OnCmdDebugCompile )
     226        COMMAND_ID_HANDLER_EX( IDM_ATTACH, OnCmdAttach )
     227        COMMAND_ID_HANDLER_EX( IDM_RELEASECOMPILE, OnCmdReleaseCompile )
     228        COMMAND_ID_HANDLER_EX( IDM_RELEASERUN, OnCmdReleaseRun )
    209229    END_MSG_MAP()
    210230};
  • trunk/ab5.0/abdev/abdev/src/MainFrame.cpp

    r499 r500  
    746746    DlgOptionSetting( m_hWnd );
    747747}
     748
     749void CreateProcessWithStdHandle( const std::string &appPath, const std::string &cmdLine)
     750{
     751    std::string argsStr = (std::string)"\"" + appPath + "\" " + cmdLine;
     752    STARTUPINFO si;
     753    PROCESS_INFORMATION pi;
     754    memset(&si,0,sizeof(STARTUPINFO));
     755    si.cb=sizeof(STARTUPINFO);
     756    si.dwFlags = STARTF_USESTDHANDLES | STARTF_USESHOWWINDOW;
     757    si.wShowWindow = SW_HIDE;
     758    si.hStdOutput = GetStdHandle(STD_OUTPUT_HANDLE);
     759    si.hStdInput = GetStdHandle(STD_INPUT_HANDLE);
     760    si.hStdError = GetStdHandle(STD_ERROR_HANDLE);
     761   
     762    char args[8192];
     763    lstrcpy( args, argsStr.c_str() );
     764
     765    CreateProcess( NULL, args, NULL, NULL, FALSE, NORMAL_PRIORITY_CLASS, NULL, NULL, &si, &pi );
     766}
     767
     768void MainFrame::OnCmdDebug( UINT uNotifyCode, int nID, CWindow wndCtl )
     769{
     770    char temporary[1024], temp2[1024], temp3[1024];
     771    if(pobj_Debugger->IsDebugging()){
     772        pobj_Debugger->DebugContinue();
     773        return;
     774    }
     775
     776    HWND hChild = ::GetWindow(hClient,GW_CHILD);
     777    if(ProjectInfo.name[0]){
     778        //プロジェクトが開かれている場合
     779        if(!SetProjectToRun()) return;
     780
     781        //デバッグ用のコマンドライン及び実行可能ファイル(DLLのみ)
     782        sprintf(temporary,"%s\r\n%s",ProjectInfo.szExePath,ProjectInfo.szCmdLine);
     783        sprintf(temp2,"%spgm.tmp",pj_editor_Dir);
     784        HANDLE hFile=CreateFile(temp2,GENERIC_WRITE,0,NULL,CREATE_ALWAYS,FILE_ATTRIBUTE_ARCHIVE|FILE_ATTRIBUTE_HIDDEN|FILE_ATTRIBUTE_TEMPORARY,NULL);
     785        DWORD dwAccessBytes;
     786        WriteFile(hFile,temporary,lstrlen(temporary),&dwAccessBytes,NULL);
     787        CloseHandle(hFile);
     788
     789        //ソースファイル名をtemp2へ
     790        ProjectInfo.pobj_DBFileInfo->ppobj_FileInfo[0]->GetFullPath(temp2);
     791
     792        //出力ファイル名をtemp3へ
     793        lstrcpy(temp3,ProjectInfo.lpszOutput_Debug);
     794        GetFullPath(temp3,ProjectInfo.dir);
     795
     796        if(IsNeedCompileForProject(1))
     797            sprintf(temporary,"\"%s\" \"%s\" /debug /run /wnd:%08x",temp2,temp3,m_hWnd);
     798        else
     799            sprintf(temporary,"\"%s\" \"%s\" /run /wnd:%08x",temp2,temp3,m_hWnd);
     800
     801        //DLLオプション
     802        if(ProjectInfo.dwModuleType==MT_DLL) lstrcat(temporary," /dll");
     803
     804        //Unicodeオプション
     805        if(ProjectInfo.dwOption & PJ_OP_UNICODE) lstrcat(temporary," /unicode");
     806
     807        //ブレークポイントをセーブ
     808        ProjectInfo.pobj_DBBreakPoint->SaveToTempFile();
     809    }
     810    else{
     811        //単独ソースコード
     812        if(!SetRunning(hChild)) return;
     813        if(IsNeedCompile(MdiInfo[GetWndNum(hChild)].path,1))
     814            sprintf(temporary,"\"%s\" /debug /run /wnd:%08x",MdiInfo[GetWndNum(hChild)].path,m_hWnd);
     815        else
     816            sprintf(temporary,"\"%s\" /run /wnd:%08x",MdiInfo[GetWndNum(hChild)].path,m_hWnd);
     817
     818        //ブレークポイントをセーブ
     819        extern CDBBreakPoint *pobj_DBBreakPoint;
     820        pobj_DBBreakPoint->SaveToTempFile();
     821    }
     822
     823    //コンパイルビューをクリップするかどうか
     824    extern BOOL bClipCompileView;
     825    if(bClipCompileView){
     826        lstrcat(temporary," /clip_compile_view");
     827
     828        //コンパイラビューを閉じる
     829        extern HWND hCompileView;
     830        if(hCompileView==(HWND)-1) return;
     831        if(hCompileView){
     832            hChild=hCompileView;
     833            hCompileView=(HWND)-1;
     834            SendMessage(hChild,WM_COMMAND,IDCANCEL,0);
     835        }
     836
     837        //重複起動防止のため
     838        hCompileView=(HWND)-1;
     839    }
     840
     841    //インクルードディレクトリ
     842    sprintf(temp2," /include_dir:\"%s\"",pobj_nv->GetIncludeDirFullPath().c_str());
     843    lstrcat(temporary,temp2);
     844
     845    extern ActiveBasic::Common::Platform::EnumType selectingPlatform;
     846    CreateProcessWithStdHandle( ActiveBasic::Common::Environment::GetCompilerExePath( selectingPlatform ), temporary );
     847}
     848
     849void MainFrame::OnCmdDebugCompile( UINT uNotifyCode, int nID, CWindow wndCtl )
     850{
     851    char temporary[1024], temp2[1024], temp3[1024];
     852
     853    HWND hChild=::GetWindow(hClient,GW_CHILD);
     854    if(ProjectInfo.name[0]){
     855        //プロジェクトが開かれている場合
     856        if(!SetProjectToRun()) return;
     857
     858        //ソースファイル名をtemp2へ
     859        ProjectInfo.pobj_DBFileInfo->ppobj_FileInfo[0]->GetFullPath(temp2);
     860
     861        //出力ファイル名をtemp3へ
     862        lstrcpy(temp3,ProjectInfo.lpszOutput_Debug);
     863        GetFullPath(temp3,ProjectInfo.dir);
     864
     865        sprintf(temporary,"\"%s\" \"%s\" /debug /wnd:%08x",temp2,temp3,m_hWnd);
     866
     867        //DLLオプション
     868        if(ProjectInfo.dwModuleType==MT_DLL) lstrcat(temporary," /dll");
     869
     870        //Unicodeオプション
     871        if(ProjectInfo.dwOption & PJ_OP_UNICODE) lstrcat(temporary," /unicode");
     872    }
     873    else{
     874        //単独ソースコード
     875        if(!SetRunning(hChild)) return;
     876        sprintf(temporary,"\"%s\" /debug /wnd:%08x",MdiInfo[GetWndNum(hChild)].path,m_hWnd);
     877    }
     878
     879    //コンパイルビューをクリップするかどうか
     880    extern BOOL bClipCompileView;
     881    if(bClipCompileView){
     882        lstrcat(temporary," /clip_compile_view");
     883
     884        //コンパイラビューを閉じる
     885        extern HWND hCompileView;
     886        if(hCompileView==(HWND)-1) return;
     887        if(hCompileView){
     888            hChild=hCompileView;
     889            hCompileView=(HWND)-1;
     890            SendMessage(hChild,WM_COMMAND,IDCANCEL,0);
     891        }
     892
     893        //重複起動防止のため
     894        hCompileView=(HWND)-1; 
     895    }
     896
     897    //インクルードディレクトリ
     898    sprintf(temp2," /include_dir:\"%s\"",pobj_nv->GetIncludeDirFullPath().c_str());
     899    lstrcat(temporary,temp2);
     900
     901    extern ActiveBasic::Common::Platform::EnumType selectingPlatform;
     902    CreateProcessWithStdHandle( ActiveBasic::Common::Environment::GetCompilerExePath( selectingPlatform ), temporary );
     903
     904}
     905
     906void MainFrame::OnCmdAttach( UINT uNotifyCode, int nID, CWindow wndCtl )
     907{
     908    char temporary[1024], temp2[1024];
     909
     910    int idProcess;
     911    DWORD dwPlatform;
     912    idProcess=DialogBoxParam(hResInst,MAKEINTRESOURCE(IDD_ATTACH),m_hWnd,(DLGPROC)DlgAttach,(LPARAM)&dwPlatform);
     913    if(idProcess==0) return;
     914
     915    sprintf(temporary,"/attach:%08x /wnd:%08x",idProcess,m_hWnd);
     916
     917    //コンパイルビューをクリップするかどうか
     918    extern BOOL bClipCompileView;
     919    if(bClipCompileView){
     920        lstrcat(temporary," /clip_compile_view");
     921
     922        //コンパイラビューを閉じる
     923        extern HWND hCompileView;
     924        if(hCompileView==(HWND)-1) return;
     925        if(hCompileView){
     926            HWND hChild=hCompileView;
     927            hCompileView=(HWND)-1;
     928            SendMessage(hChild,WM_COMMAND,IDCANCEL,0);
     929        }
     930
     931        //重複起動防止のため
     932        hCompileView=(HWND)-1;
     933    }
     934
     935    //インクルードディレクトリ
     936    sprintf(temp2," /include_dir:\"%s\"",pobj_nv->GetIncludeDirFullPath().c_str());
     937    lstrcat(temporary,temp2);
     938
     939    ActiveBasic::Common::Platform::EnumType platform;
     940    if(dwPlatform==IMAGE_FILE_MACHINE_I386)
     941    {
     942        platform = ActiveBasic::Common::Platform::X86;
     943    }
     944    else if(dwPlatform==IMAGE_FILE_MACHINE_AMD64)
     945    {
     946        platform = ActiveBasic::Common::Platform::X64;
     947    }
     948    else
     949    {
     950        throw;
     951    }
     952
     953    extern ActiveBasic::Common::Platform::EnumType selectingPlatform;
     954    CreateProcessWithStdHandle( ActiveBasic::Common::Environment::GetCompilerExePath( platform ), temporary );
     955}
     956
     957void MainFrame::OnCmdReleaseCompile( UINT uNotifyCode, int nID, CWindow wndCtl )
     958{
     959    char temporary[1024], temp2[1024], temp3[1024];
     960
     961    HWND hChild=::GetWindow(hClient,GW_CHILD);
     962    if(ProjectInfo.name[0]){
     963        //プロジェクトが開かれている場合
     964        if(!SetProjectToRun()) return;
     965
     966        //ソースファイル名をtemp2へ
     967        ProjectInfo.pobj_DBFileInfo->ppobj_FileInfo[0]->GetFullPath(temp2);
     968
     969        //出力ファイル名をtemp3へ
     970        lstrcpy(temp3,ProjectInfo.lpszOutput_Release);
     971        GetFullPath(temp3,ProjectInfo.dir);
     972
     973        sprintf(temporary,"\"%s\" \"%s\" /wnd:%08x",temp2,temp3,m_hWnd);
     974
     975        //DLLオプション
     976        if(ProjectInfo.dwModuleType==MT_DLL) lstrcat(temporary," /dll");
     977
     978        //Unicodeオプション
     979        if(ProjectInfo.dwOption & PJ_OP_UNICODE) lstrcat(temporary," /unicode");
     980    }
     981    else{
     982        //単独ソースコード
     983        if(!SetRunning(hChild)) return;
     984        sprintf(temporary,"\"%s\" /wnd:%08x",MdiInfo[GetWndNum(hChild)].path,m_hWnd);
     985    }
     986
     987    //コンパイルビューをクリップするかどうか
     988    extern BOOL bClipCompileView;
     989    if(bClipCompileView){
     990        lstrcat(temporary," /clip_compile_view");
     991
     992        //コンパイラビューを閉じる
     993        extern HWND hCompileView;
     994        if(hCompileView==(HWND)-1) return;
     995        if(hCompileView){
     996            hChild=hCompileView;
     997            hCompileView=(HWND)-1;
     998            SendMessage(hChild,WM_COMMAND,IDCANCEL,0);
     999        }
     1000
     1001        //重複起動防止のため
     1002        hCompileView=(HWND)-1;
     1003    }
     1004
     1005    //インクルードディレクトリ
     1006    sprintf(temp2," /include_dir:\"%s\"",pobj_nv->GetIncludeDirFullPath().c_str());
     1007    lstrcat(temporary,temp2);
     1008
     1009    extern ActiveBasic::Common::Platform::EnumType selectingPlatform;
     1010    CreateProcessWithStdHandle( ActiveBasic::Common::Environment::GetCompilerExePath( selectingPlatform ), temporary );
     1011}
     1012
     1013void MainFrame::OnCmdReleaseRun( UINT uNotifyCode, int nID, CWindow wndCtl )
     1014{
     1015    char temporary[1024], temp2[1024], temp3[1024];
     1016
     1017    HWND hChild=::GetWindow(hClient,GW_CHILD);
     1018    if(ProjectInfo.name[0]){
     1019/*                      //プロジェクトが開かれている場合
     1020        if(!SetProjectToRun()) return;
     1021
     1022        //必要であればリリースコンパイル
     1023        if(IsNeedCompileForProject(0))
     1024            SendMessage(WM_COMMAND,IDM_RELEASECOMPILE,0);*/
     1025
     1026        if(ProjectInfo.dwModuleType==MT_DLL){
     1027            lstrcpy(temporary,ProjectInfo.szExePath);
     1028        }
     1029        else{
     1030            lstrcpy(temporary,ProjectInfo.lpszOutput_Debug);
     1031            GetFullPath(temporary,ProjectInfo.dir);
     1032        }
     1033    }
     1034    else{
     1035/*                      //必要であればリリースコンパイル
     1036        if(!SetRunning(hChild)) return;
     1037
     1038        if(IsNeedCompile(MdiInfo[GetWndNum(hChild)].path,0))
     1039            SendMessage(WM_COMMAND,IDM_RELEASECOMPILE,0);*/
     1040
     1041        //単独ソースコード
     1042        _splitpath(MdiInfo[GetWndNum(hChild)].path,temporary,temp2,temp3,NULL);
     1043        lstrcat(temporary,temp2);
     1044        lstrcat(temporary,temp3);
     1045        lstrcat(temporary,".exe");
     1046    }
     1047
     1048    //インクルードディレクトリ
     1049    sprintf(temp2," /include_dir:\"%s\"",pobj_nv->GetIncludeDirFullPath().c_str());
     1050    lstrcat(temporary,temp2);
     1051
     1052    ShellExecute(m_hWnd,"open",temporary,NULL,NULL,SW_SHOWNORMAL);
     1053}
Note: See TracChangeset for help on using the changeset viewer.