前几天做了一个打包的程序,是用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的博客没有编辑代码的功能郁闷!