ClistCtrl的SetItemText函数不能显示数据

CListCtrl数据显示问题 问题描述:将CListCtrl无法正常显示数据,第一次显示数据时完全正常,第二次显示数据时,控件不显示数据,利用强制刷新也不行。经调试发现,数据已经写入CListCtrl控件内存,只是因为某种原因无法呈现出来。 原因:第一次显示数据之后,首先清空了控件中的所有记录,然后清空了所有的标题条目;在下一次数据显示之前,重新初始化标题栏,添加记录。清空标题栏的代码注释掉之后,数据就能正常显示了。 解决 阅读详情

最近学习MFC编程,与access打交道,初步想实现有表中读取数据中的内容,采用SetItemText函数,原来代码为:

 

但在clistctr控件中的m_content.InsertColumn()又能显示,调试跟踪,可以读取到数据库中的字符串,但就是数据无法显示,后来在网上查了许多资料才知道:每一列的第一个数据要用InsertItem()插入,修改代码如下,实现了数据显示功能。

 

另外如果InsertColumn()中的内容也没显示出来,即列表框中空白什么都没有,那么先把clistctr的VIEW属性设置为report。

 

 

关于MFC中CListCtrl::InsertColumn()和InsertItem()和SetItemText()的一些认识 才开始写博客,有很多不懂的或者表达不清楚的,请谅解!还有因为是自己在自学,所有可能有些话是错的,所以请朋友们看到后留言指出错误,大家一起学习,非常感谢!! 刚刚在学习MFC中的List Control控件的时候遇到一些问题,就是InsertColumn()和InsertItem()和SetItemText()这几个函数。我是看的和我弟学校合作的培训学校的视频学习的,那个老师虽然能力还不错,但是表 阅读详情

相关推荐

怎样使用CListCtrl控件中InsertItem和SettItemtext函数

最近做一个小项目用到CListCtrl控件中InsertItem和SettItemtext函数这两个函数,用了好大劲才明白,希望以后少走弯路内容如下:InsertItem在MSDN中的函数原型如下        int InsertItem( const LVITEM* pItem );       int InsertItem( int nItem, LPCTSTR lpszItem ); 

山海的专栏 7702

SetItemText

SetItemText有两种方式,一种是在插入行时候调用,一种是在插完行后调用 BOOL SetItemText( int nItem, int nSubItem, LPTSTR lpszText ); 一:插入行时候调用 void CDYWorkingFilesManageDlg::ShowMachineFiles(const z_net_client_handle_t hNetCli

云淡风轻 1万+

Figma汉化教程

Figma汉化教程

cc蒲公英的博客 1万+

CListCtrl::SetItemText() 不显示的问题

//原来不会显示 m_grid.SetItemText(nRow,1,_T("行号"));// 这一句就是显示不成功 //修改一下可以显示 int nIndex =m_grid.InsertItem(nRow,_T("行号"));  m_grid.SetItemText(nIndex,_T("数据"));  nRow同步! //add: 如果还是不显示,记得把ListCtrl

Miss_Easy的专栏 7690

基于FPGA的图像预处理系统(图)

 北京机械工业学院 韩娟娟 邓文怡 娄小平 由于获取图像的工具或手段的影响,使获取图像无法完全体现原始图像的全部信息。因此,对图像进行预处理就显得非常重要。预处理的目的是改善图像数据,抑制不需要的变形或者增强某些对于后续处理来说比较重要的图像特征。通常根据预处理目的的不同,把预处理技术归为图像增强技术和图像分割技术两类。图像对比度处理是空间域图像增强的一种方法。由于图像灰度范围狭窄会使

lyzhangxianglove的专栏 1782

C# .NET6 TesseractOCR 图片文字识别

在你的项目中的tessdata-main文件夹找到这几个文件,并右键->属性设置为【如果较新则复制】有几个需要用到的模型,需要生成的时候复制到输出目录中,在项目中设置即可。TesseractOCR兼容 x86 与 x64。附 :ImageUtils.RegionCropping()源码。Visual Studio 2022 社区版。下载完成后解压在你的项目中,如图所示。从官方项目中获取模型数据, 网址为。

qq_44121554的博客 3860

VC++中InsertItem和SetItemText的区别

InsertItem 只操作CListCtrl的第一列,如果只有一列就用这个 SetItemText通常用于操作CListCtrl第一列之外的列,并应该在InsertItem第一列之后操作 //插入表头 m_ListCtrl.InsertColumn(0,_T("序号"),LVCFMT_CENTER,50); m_ListCtrl.InsertColumn(1,_T("姓名"),LVCFMT_CENTER,100); m_ListCtrl.InsertColumn(2,_T("性别"),LVCFMT_C

coder_Alger 的博客 3118

信号处理必看:单目标测向中CRLB的两种推导方法对比

本文深入探讨了单目标测向中Cramér-Rao下界(CRLB)的两种经典推导方法:基于正弦信号参数估计的间接推导与基于阵列测向模型的直接推导。通过理论分析和Matlab仿真验证,揭示了两种方法的内在统一性及其在阵列信号处理中的实际应用价值,为工程实践提供了重要参考。

weixin_33701251的博客 354

CListCtrl控件中InsertItem和SetItemText函数

vc 为什么我用m_list.SetItemText(1, 0, "KKK")设置列表内容 该函数CListCtr::InsertItem一般和CListCtr::SetItemText一起使用。   list.InsertItem(0,"主数据");   插入数据"主数据"到第一行的主项,你可以认为是第一列。   list.SetItemText(0,1,"子数据");   将第一行第

qq_31209383的博客 7442

告别PXE!用iPXE在CentOS 8.5上搭建一个能同时装Win11和Linux的万能网络启动盘

本文详细介绍了如何在CentOS 8.5上使用iPXE搭建支持Windows 11和Linux双系统部署的全能网络启动盘。通过对比传统PXE的局限性,展示了iPXE在HTTP协议支持、多架构适配和智能脚本方面的优势,提供从环境准备、服务配置到智能菜单开发的完整解决方案,显著提升系统部署效率。

weixin_29278805的博客 275

IMDb影评数据集:从下载到情感分析实战指南

本文提供了IMDb影评数据集从下载、探索到情感分析建模的完整实战指南。详细介绍了数据预处理、TF-IDF向量化方法,并对比了逻辑回归、随机森林、SVM及LSTM深度学习模型在情感分析任务上的应用与效果评估,帮助读者系统掌握自然语言处理的核心流程。

weixin_29052717的博客 460

CListCtrl 类中InsertItem, InsertColumn, SetItemText 的使用

1.InsertColumn   函数功能:在报告模式下插入一列  函数原型:int InsertColumn(int nCol, const LVCOLUMN* pColumn);  int InsertColumn(int nCol, LPCTSTR lpszColumnHeading, int nFormat = LVCFMT_LEFT, int nWidth = -1, in

lanmeng_smile的专栏 4320

【教程4>第4章>第15节】基于FPGA的costas环的设计构架

目录1.costas环的整体实现结构2. FPGA设计构架3.参考文献 Costas 环是一种用于载波同步的闭环反馈控制系统,主要应用于通信系统中的相干解调。其基本原理是通过鉴相器(Phase Detector,PD)比较接收信号与本地载波信号的相位差,将这个相位差信息经过环路滤波器(Loop Filter,LF)滤波后,去控制数控振荡器(Numerically Controlled Oscillator,NCO)的输出频率和相位,使得本地载波能够跟踪接收信号的载波,最终实现载波同步。我们在《F

FPGA/MATLAB学习教程/源码/项目合作开发 579

CListCtrl控件中InsertItem和SettItemtext函数的用法简介

        本人初次用CListCtrl控件的时候,对于 InsertItem和SetrtItemtext两个函数的作用始终不是太懂,比如如果不先调用InsertItem这个函数,后面的InsertItemtext函数写了,也不起作用.查了MSDN,也没有收获,经过有人点拔,才恍然大悟.今天将经验说一下,希望有共同爱好者少走弯路.        InsertItem在MSDN中的函数原型如

ct_hero0902的专栏 5万+

点云从入门到精通技术详解100篇-基于点云语义分割的电力线提取及聚类研究

在现代社会,电力一直扮演着最重要的角色之一。它不仅与人民的生活息息相关,更是一个国家发展的命脉。近年来,随着我国各特高压输电线路建成(比如2022年1月份白鹤滩江苏特高压输电线路的放线)以及电网规模的不断扩大,我国年发电量稳步上升,人民的生活水平越来越高。我国土地辽阔,输电线路分布广泛,再加上地形环境复杂多样,电力线可能遭受风吹雨晒甚至是冰雪寒灾的影响。因此,为了保障电力线的可靠供电,防止停电意外发生,电力部门要定期对输电线路进行检查。目前我国主要。

getusushu的博客 1014

数学建模模型总结

这是本人在两年内准备参加数学建模竞赛搜集到的模型资料,已经经过了本人的筛选和整理,希望能够对准备参加数学建模竞赛的学弟学妹们提供一些帮助!

CListCtrl控件中InsertItem和SetItemText函数及CTreeCtrl::SetItemText

如果不先调用InsertItem这个函数,后面的SetItemText函数写了,也不起作用。 InsertItem在MSDN中的函数原型如下         int InsertItem( const LVITEM* pItem );        int InsertItem( int nItem, LPCTSTR lpszItem );        int InsertItem( i

heary29的专栏 1992

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

CListCtrl控件的InsertItem和SetItemText和SetItem三个函数的区别

本人初次用CListCtrl控件的时候,对于 InsertItem和SetItemText两个函数的作用始终不是太懂,比如如果不先调用InsertItem这个函数,后面的SetItemText函数写了,也不起作用.查了MSDN,也没有收获,经过有人点拔,才恍然大悟.今天将经验说一下,希望有共同爱好者少走弯路.           InsertItem在MSDN中的函数原型如下

ITer_Luo的专栏 1万+

WINCC7.3破解文件

WINCC7.3硬件够破解文件,有需要的下载!WINCC7.3硬件够破解文件,有需要的下载!

最新的sdio 4.0 spec 协议标准 带书签 高清完整PDF版

Part-E1-SDIO-Specification-Ver4.00-Final-120220.pdf:最新的sdio 4.0 spec 协议标准 带书签 高清完整PDF版,包括SDIO 接口的外设,SDIO 接口官方协议等。

上一篇: extern用法详解(转)
下一篇: LNK2001错误(转)
cumirror
博客等级 码龄18年 103粉丝 51原创
评论 1
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值