VC6.0调试,一个下午也没弄清原因,求助

蜗牛工作室 2011-02-27 03:07:30
DEBUG下报错:
CBCGPRibbonQuickAccessToolbar::SetCommands: Ribbon element with ID = 57664 not found
Warning: skipping non-radio button in group.
Warning: skipping non-radio button in group.
SetActiveTab: illegal tab number -1
Loaded 'D:\02_SourceCode\BinD\BCGPStyle2007Luna150.dll', no matching symbolic information found.
Loaded 'C:\Windows\System32\riched20.dll', no matching symbolic information found.
CoCreateInstance of OLE control {D45FD31B-5C6E-11D1-9EC1-00C04FD7081F} failed.
>>> Result code: 0x80040154
>>> Is the control is properly registered?



请问如何解决?
...全文
245 13 打赏 收藏 转发到动态 举报
写回复
用AI写文章
13 条回复
切换为时间正序
请发表友善的回复…
发表回复
蜗牛工作室 2011-03-01
  • 打赏
  • 举报
回复
[Quote=引用 11 楼 sinfee 的回复:]
是不是没用用AfxInitRichEdit2()?
应该是那个D45FD31B-5C6E-11D1-9EC1-00C04FD7081F MSAgent控件没有注册好
[/Quote]

问题已经解决,就是这个原因。下载MsAgent.exe安装注册即可
向立天 2011-03-01
  • 打赏
  • 举报
回复
应该是配置的问题
你做的东西有没有什么例子可以参考
看一下相关配置
sinfee 2011-03-01
  • 打赏
  • 举报
回复
是不是没用用AfxInitRichEdit2()?
应该是那个D45FD31B-5C6E-11D1-9EC1-00C04FD7081F MSAgent控件没有注册好
Eleven 2011-03-01
  • 打赏
  • 举报
回复
[Quote=引用 9 楼 sxqinge 的回复:]
if (!ProcessShellCommand(&cmdInfo))
[/Quote]
没有写错,
就是
if (!ProcessShellCommand(cmdInfo))
CWinApp类的
BOOL ProcessShellCommand(
CCommandLineInfo& rCmdInfo
);
该函数的参数是引用类型
sxqinge 2011-02-28
  • 打赏
  • 举报
回复
if (!ProcessShellCommand(&cmdInfo))
蜗牛工作室 2011-02-28
  • 打赏
  • 举报
回复
[Quote=引用 6 楼 sxqinge 的回复:]
应该不是程序问题,是不是哪里配置不正确了?
[/Quote]

我编译链接没错,单步调试出错
用到了BCG,不知道是少了什么东西或配置错了,该怎么弄呢
MYNAMEISLIULI 2011-02-28
  • 打赏
  • 举报
回复
应该不是程序问题,是不是哪里配置不正确了?
sxqinge 2011-02-28
  • 打赏
  • 举报
回复
应该不是程序问题,是不是哪里配置不正确了?
蜗牛工作室 2011-02-28
  • 打赏
  • 举报
回复
[Quote=引用 4 楼 sxqinge 的回复:]
单步调试,看是哪行出错了,然后改下吧
LZ的代码风格看上去不错呢,内容太长了,哈哈帮顶个先
[/Quote]

if (!ProcessShellCommand(cmdInfo))//运行到此就报错
return FALSE;
sxqinge 2011-02-28
  • 打赏
  • 举报
回复
单步调试,看是哪行出错了,然后改下吧
LZ的代码风格看上去不错呢,内容太长了,哈哈帮顶个先
蜗牛工作室 2011-02-28
  • 打赏
  • 举报
回复
who can help me?
蜗牛工作室 2011-02-27
  • 打赏
  • 举报
回复

BOOL CWaterSurveyApp::InitInstance()
{

AfxGetModuleState()->m_dwVersion = 0x0601;//使应用程序支持Dao3.6

//设置BCG的资源
CFileFind find;
static CString strt;
strt = CWsOperator::GetAppDir();
if(find.FindFile(CWsOperator::GetAppDir()+"\\BCGCBProRes*.dll"))
{
find.FindNextFile();
CString strResFile = find.GetFilePath();

m_hResourceModule = ::LoadLibrary(strResFile);
if ( m_hResourceModule != NULL )
{
BCGCBProSetResourceHandle(m_hResourceModule);
}
}


SmSetVisibleGeometrySize(327670000); //最大可见对象点数


// Initialize OLE libraries
if (!AfxOleInit())
{
AfxMessageBox(IDP_OLE_INIT_FAILED);
return FALSE;
}


globalData.SetDPIAware ();

AfxEnableControlContainer();

// Standard initialization
// If you are not using these features and wish to reduce the size
// of your final executable, you should remove from the following
// the specific initialization routines you do not need.

#ifdef _AFXDLL
Enable3dControls(); // Call this when using MFC in a shared DLL
#else
Enable3dControlsStatic(); // Call this when linking to MFC statically
#endif

// Change the registry key under which our settings are stored.
// TODO: You should modify this string to be something appropriate
// such as the name of your company or organization.
//注册信息
SetRegistryKey(gProducerRegister.strRegistryKey);

m_pSplashThread = (CSplashThread*) AfxBeginThread(RUNTIME_CLASS(CSplashThread), THREAD_PRIORITY_NORMAL, 0, CREATE_SUSPENDED);
if (m_pSplashThread == NULL)
{
AfxMessageBox(_T("Failed to create splash screen"), MB_OK | MB_ICONSTOP);
return FALSE;
}
ASSERT(m_pSplashThread->IsKindOf(RUNTIME_CLASS(CSplashThread)));
DWORD code = -1;
//tBitmapToUse(const CString& sFilename);
CString strStartPicture = CWsOperator::GetAppDir() + _T("setup.bmp");

if(CSmToolkit::IsFileExisted(strStartPicture))//by shiww,have setup.bmp file,2006.5.30
{
m_pSplashThread->SetBitmapToUse(strStartPicture);
}

m_pSplashThread->ResumeThread();

short sYear = CSmToolkit::GetYear(); //当前时间的年值
short sMonth = CSmToolkit::GetMonth(); //当前时间的月值
short sDay = CSmToolkit::GetDay(); //当前时间的日值

if(sYear>2011
|| (sYear==2011 && sMonth>11) )
{
AfxMessageBox("本软件只能在2010年11月30日前使用.\r\n您已经过了试用期.\r\n如您需要继续使用软件,请与北京超图联系.");

m_pSplashThread->ExitInstance(); //退出

return FALSE;
}
else if( sYear==2010 && sMonth==11 && 30-sDay<=5)
{
CString strRemain;
strRemain.Format("本软件只能在2010年11月30日前使用.\r\n您离试用期结束还有%d天.",30-sDay);
AfxMessageBox(strRemain);
}

ReadSystemPara();

/*//
m_nNPolygonEdgeCount = GetProfileInt(gProducerRegister.strSystemPara, _T("NPolygonEdgeCount"), m_nNPolygonEdgeCount);
CString str = GetProfileString(gProducerRegister.strSystemPara, _T("GridRowSpace"));
if (!str.IsEmpty())
m_dGridRowSpace = _tcstod(str, NULL);
str = GetProfileString(gProducerRegister.strSystemPara, _T("GridColSpace"));
if (!str.IsEmpty())
m_dGridColSpace = _tcstod(str, NULL);
///////////////////////////////////////////////////////////////////////

//加载插件
LoadPlgIn();
int i = 0;
CSvPlugIn *pSvPlugIn = NULL;
for (; i < m_dPlugInfile.GetSize(); i++)
{
CREATEPLGIN CreatePlgIn =
(CREATEPLGIN)GetProcAddress((HINSTANCE)m_dPlugInfile.GetAt(i), _T("CreatePlugIn"));
if(CreatePlgIn != NULL)
{
pSvPlugIn = (CSvPlugIn *)CreatePlgIn();
if(pSvPlugIn != NULL)
{
m_dSvPlgIn.Add((DWORD)pSvPlugIn);
}
}
pSvPlugIn = NULL;
}
*/
//{{add by houpg, check whether commanding parameter files is exist
CString strAppPath = CWsOperator::GetAppDir()+"paras";//added by shiww,2006.4.30
CString strParaPath =CSmToolkit::GetTempPath();
strParaPath=strParaPath.Mid(0,strParaPath.GetLength()-1);

m_svPara.m_strParaPath = strParaPath;

//暂时先测试一下,by shiww,2006.5.22
//ADO 初始化

CAdoDataBase *pAdodatabase=new CAdoDataBase;// by shiww,没必要删除,m_svPara析构时会删除。
pAdodatabase->m_bShowError=FALSE;

TCHAR filepath[MAX_PATH];
GetModuleFileName(AfxGetApp()->m_hInstance,filepath, MAX_PATH-1);
CString strPath = CWsOperator::ExtractFilePath(filepath);
if (!pAdodatabase->ConnectMDB(strPath + _T("\\para\\para.mdb"), _T("")))
return FALSE;

m_svPara.SetAdoDatabase(pAdodatabase);

CSvToolkit::GetParaFileFromDB(pAdodatabase,m_svPara.m_strParaPath);

if(!m_svPara.LayerToLayerGroup())//出错处理
{
pAdodatabase->Close();
delete pAdodatabase;
pAdodatabase=NULL;
//m_pSplashThread->SetMessage(WM_COMMAND,WM_CLOSE,0);
GetExitCodeThread(m_pSplashThread, &code);
ExitProcess(code);
return FALSE;
}
gSysEnvironment = m_svPara.m_SysEvn;
//参数读取之后,MainFrame创建之前将其转移到上下文中,解决多个dll间无法共享静态变量问题
POSITION pos = m_svPara.m_mapVarients.GetStartPosition();
CString strKey;
CString strValue;
while (NULL != pos)
{
m_svPara.m_mapVarients.GetNextAssoc(pos, strKey, strValue);
InstanceContext->SetVarient(strKey, strValue);
}

// 获得实体描述
m_mapEntityIDtoDescription.RemoveAll();
CAdoRecordset *pRS = pAdodatabase->Query(_T("select ClassID, Description from Entity"), SMADO::adOpenForwardOnly);
if (pRS != NULL && !pRS->IsEmpty())
{
pRS->MoveFirst();
while (!pRS->IsEOF())
{
COleVariant var;
pRS->GetFieldValue(_T("ClassID"), var);
long nID = var.lVal;
pRS->GetFieldValue(_T("Description"), var);
m_mapEntityIDtoDescription.SetAt(nID, CString(var.bstrVal));
pRS->MoveNext();
}
}
pAdodatabase->ReleaseRecordset(pRS);


LoadStdProfileSettings(); // Load standard INI file options (including MRU)

SetRegistryBase (_T("Settings"));

// Initialize all Managers for usage. They are automatically constructed
// if not yet present
InitContextMenuManager();
InitKeyboardManager();

// TODO: Remove this if you don't want extended tooltips:
// InitTooltipManager();

// CBCGPToolTipParams params;
// params.m_bVislManagerTheme = TRUE;

// theApp.GetTooltipManager ()->SetTooltipParams (
// BCGP_TOOLTIP_TYPE_ALL,
// RUNTIME_CLASS (CBCGPToolTipCtrl),
// ¶ms);

// Register the application's document templates. Document templates
// serve as the connection between documents, frame windows and views.

CSingleDocTemplate* pDocTemplate;
pDocTemplate = new CSingleDocTemplate(
IDR_MAINFRAME,
RUNTIME_CLASS(CWaterSurveyDoc),
RUNTIME_CLASS(CMainFrame), // main SDI frame window
RUNTIME_CLASS(CWaterSurveyView));
AddDocTemplate(pDocTemplate);

// Parse command line for standard shell commands, DDE, file open
CCommandLineInfo cmdInfo;
ParseCommandLine(cmdInfo);

// Dispatch commands specified on the command line
if (!ProcessShellCommand(cmdInfo))//运行到此就报错
return FALSE;


// The one and only window has been initialized, so show and update it.
m_pMainWnd->ShowWindow(SW_MAXIMIZE);
m_pMainWnd->UpdateWindow();

///////////////////////


EnableShellOpen();
RegisterShellFileTypes();
// The main window has been initialized, so show and update it.
// pMainFrame->ShowWindow(m_nCmdShow);


m_pSplashThread->HideSplash();

return TRUE;
}
yiruirui0507 2011-02-27
  • 打赏
  • 举报
回复
楼主贴代码吧,不贴是不行的
VC6下安装与配置 Wikipedia,自由的百科全书 本手册适应 OpenCV 1.0 安装。 目录 [隐藏] 1 安装Visual C++ 6.0 2 安装OpenCV 3 配置Windows环境变量 4 配置Visual C++ 6.0 4.1 全局设置 4.2 项目设置 [编辑]安装Visual C++ 6.0 略。 [编辑]安装OpenCV 从http://www.opencv.org.cn/ 下载OpenCV安装程序。假如要将OpenCV安装到C:\\Program Files\\OpenCV。(下面附图为OpenCV 1.0rc1的安装界面,OpenCV 1.0安装界面与此基本一致。)在安装时选择\"将\\OpenCV\\bin加入系统变量\"(Add\\OpenCV\\bin to the systerm PATH)。 [编辑]配置Windows环境变量 检查C:\\Program Files\\OpenCV\\bin是否已经被加入到环境变量PATH,如果有,请加入。 [编辑]配置Visual C++ 6.0 [编辑]全局设置 菜单Tools->Options->Directories:先设置lib路径,选择Library files,在下方填入路径: C:\\Program Files\\OpenCV\\lib 然后选择include files,在下方填入路径: C:\\Program Files\\OpenCV\\cxcore\\include C:\\Program Files\\OpenCV\\cv\\include C:\\Program Files\\OpenCV\\cvaux\\include C:\\Program Files\\OpenCV\\ml\\include C:\\Program Files\\OpenCV\\otherlibs\\highgui C:\\Program Files\\OpenCV\\otherlibs\\cvcam\\include [编辑]项目设置 每创建一个将要使用OpenCV的VC Project,都需要给它指定需要的lib。菜单:Project->Settings,然后将Setting for选为All Configurations,然后选择右边的link标签,在Object/library modules附加上 cxcore.lib cv.lib ml.lib cvaux.lib highgui.lib cvcam.lib 如果你不需要这么多lib,你可以只添加你需要的lib。

16,472

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC相关问题讨论
社区管理员
  • 基础类社区
  • Web++
  • encoderlee
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

        VC/MFC社区版块或许是CSDN最“古老”的版块了,记忆之中,与CSDN的年龄几乎差不多。随着时间的推移,MFC技术渐渐的偏离了开发主流,若干年之后的今天,当我们面对着微软的这个经典之笔,内心充满着敬意,那些曾经的记忆,可以说代表着二十年前曾经的辉煌……
        向经典致敬,或许是老一代程序员内心里面难以释怀的感受。互联网大行其道的今天,我们期待着MFC技术能够恢复其曾经的辉煌,或许这个期待会永远成为一种“梦想”,或许一切皆有可能……
        我们希望这个版块可以很好的适配Web时代,期待更好的互联网技术能够使得MFC技术框架得以重现活力,……

试试用AI创作助手写篇文章吧