前幾天做了一個打包的程式,是用COM建立對象的方式啟動的CAD,可是使用者老是說慢,我想應該是啟動起來沒有出現CAD啟動畫面,而且COM一啟動起來就啟動起來了,並沒有顯示初始化的東東,所以使用者老說慢,而且使用者的配置都很低,好像沒有獨立顯卡,只好改為從註冊表啟動,然後載入,可是這種方法還是不完美,困為老是感覺操作註冊表有一點危險,然後就所有代碼靜態檢查,如果函數失敗,就再用COM啟動,現在只好這樣了,困為客戶有的裝了兩個系統,所以有點危險,如果您有什麼好的方法,可以給我留言一起討論啊,順便把標頭檔貼出來:
// TitleBarColorDlg.h : header file
//
#if !defined(AFX_TITLEBARCOLORDLG_H__8E60EA5A_49D5_414B_9C57_49F96F372A39__INCLUDED_)
#define AFX_TITLEBARCOLORDLG_H__8E60EA5A_49D5_414B_9C57_49F96F372A39__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "XPButton.h"
#include "OwnerEdit.h"
#include "afxwin.h"
//#include "CAcadApplication.h"
/////////////////////////////////////////////////////////////////////////////
// CTitleBarColorDlg dialog
class CTitleBarColorDlg : public CDialog
{
// Construction
public:
CRect m_rtIcon; //程式表徵圖位置
void DrawTitleBar(CDC *pDC); //畫標題
CTitleBarColorDlg(CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(CTitleBarColorDlg)
enum { IDD = IDD_TITLEBARCOLOR_DIALOG };
//}}AFX_DATA
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CTitleBarColorDlg)
public:
virtual BOOL PreTranslateMessage(MSG* pMsg);
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
virtual LRESULT DefWindowProc(UINT message, WPARAM wParam, LPARAM lParam);
//}}AFX_VIRTUAL
// Implementation
protected:
HICON m_hIcon;
// Generated message map functions
//{{AFX_MSG(CTitleBarColorDlg)
virtual BOOL OnInitDialog();
afx_msg void OnPaint();
afx_msg HCURSOR OnQueryDragIcon();
afx_msg BOOL OnEraseBkgnd(CDC* pDC); //背景
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); //改變視窗邊框為圓角
afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor); //改變著色
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
public:
CXPButton m_quit;
CXPButton m_enter;
CComboBox m_combo;
CString strCAD2004;
CString strCAD2006;
CString strOldSupportPath;
CString SetContent_S;
afx_msg void OnBnClickedButtonEnter();
afx_msg void OnBnClickedButtonQuit();
int OnQueryCADCount();
void SetEnvironmentPath();
CString GetThisPath();
CString OnQueryCADPath(CString A,CString B) ;
CString OnQueryCADEdition(CString strEdition);
CString WaitROFChangeR16();
BOOL StartUpCAD_COM(); //START CAD PROCESS (COM)
BOOL StartUpCAD();
LONG PidRegDeleteKeyEx(HKEY hKey, const char* lpSubKey);
BOOL DeletePIDCADProfiles(BOOL cad04or06);
void OnCreateProcess(LPTSTR lpCommandLine) ;
int SetValue_S (struct HKEY__*ReRootKey,TCHAR *ReSubKey,TCHAR *ReValueName,LPBYTE ReSetContent_S);
int SetValue_D (struct HKEY__*ReRootKey,TCHAR *ReSubKey,TCHAR *ReValueName,int ReSetContent_D[256]);
int DeleteValue (struct HKEY__*ReRootKey,TCHAR *ReSubKey,TCHAR *ReKeyName);
BOOL OnAddKey(CString strArx,CString R16,BOOL ModeIconARX);
void OnDeleteKey(CString strArx,CString R16);
BOOL AddSupportPath(CString R16);
BOOL DelSupportPath(CString R16);
CString GetConfigName(CString R16);
int Substr(CString str,CString sub);
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_TITLEBARCOLORDLG_H__8E60EA5A_49D5_414B_9C57_49F96F372A39__INCLUDED_)
//為什麼偶的代碼在VS 裡很整齊,在這裡一粘貼上來就亂七八ZAO的了,難道CSDN的部落格沒有編輯代碼的功能鬱悶!