VS2013MFC中这段代码请帮忙详细解释一下

BITMAPINFO *m_pBmpInfo;

char m_chBmpBuf[2048];

m_pBmpInfo= (BITMAPINFO *)m_chBmpBuf

0

3个回答

1 BITMAPINFO m_pBmpInfo //创建结构体BITMAPINFO的指针
2 char m_chBmpBuf[2048]; //分配缓冲(内存2048字节)
3 m_pBmpInfo= (BITMAPINFO *)m_chBmpBuf //让指针m_pBmpInfo指向刚刚分配的内存,并强制转换char
到BITMAPINFO *指针

0

其实相当于new了一个BITMAPINFO对象(大小为2048字节),并把这个对象的地址赋给指向BITMAPINFO的指针变量 m_pBmpInfo,不过如果楼主的三行代码那就相当于尚未对new的对象未初始化。

1

BITMAPINFO结构定义了Windows设备无关位图(DIB)的度量和颜色信息,m_pBmpInfo= (BITMAPINFO *)m_chBmpBuf的意思是初始化BITMAPINFO 结构

0
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的。是时候展现真正的技术了!
其他相关推荐
请帮忙解释一下这段代码
初学汇编,在看王爽的汇编语言。其中有段代码理解不了rn---------------------------------------------------------------------------------rn程序段中的指令 指令执行后AX中的数据 指令执行后AX中的数据rnmov ax, 001AH 001AH 0000Hrnmov bx, 0026H 001AH 0026Hrnadd al,bl 0040H 0026Hrnadd,ah,bl 2640H 0026Hrnadd,bh,al 2640H 4026Hrn---------------------------------------------------------------------------------rn代码的第4行,AX的执行前的值为0040H,AX的高位ah的值应该没有啊,低位al为40,bl低位为26H。rn那么ah和bl相加怎么会是2640H?第5行的也是同样的问题。望高手解答!
正确的函数定义
请修复给定的 js 代码中,函数定义存在的问题 function functions(flag) {     if (flag) {       function getValue() { return 'a'; }     } else {       { return 'b'; }     }
VC++代码
我这段代码里面有模糊查询的,我不知道错误在哪,请高手帮忙看下,谢谢了!
帮忙解释一下这段代码
[code=JScript]rnvar attEventList = function()rn rn this.eventList = [];rnrn;rnrnattEventList.prototype = rn rn processTime : 20,rn add : function(fn,context,arrParam)rn rn this.eventList.push(rn rn fn : fn,rn context : context, //这里干嘛用的?rn param : arrParam //这里干嘛用的?rn rn );rn rn ,rn start : function()rn rn var that = this;rn setTimeout(function()rn that.process();rn ,that.processTime);rn rn ,rn process : function()rn rn var ev = this.eventList.shift(); //这里干嘛用的?rn if(!ev)rn rn return;rn rn ev.fn.apply(ev.context,ev.param); //这里干嘛用的?rn ev = null; //这里干嘛用的,为什么要这么做?rn this.start();rn rn rn rn;rn[/code]rnrn求指点谢谢。。。。。。。
帮忙解释一下这段代码。
typedef structrnrn int (*Init)(void * hinstance ,void *wndproc)rn ...rnrefexport_t;rn...rnextern refexport_t re;rn...rnre.Init(global_hInstance,MianWndProc);rnrn...
请详细得解释一下这段代码吧
rn$(document).ready(function()rnrn$("#LunWenZuoZheGH2").change(function()rn $("#LunWenZuoZheGH2").val($.trim($("#LunWenZuoZheGH2").val()));rn if($("#LunWenZuoZheGH2").val()!="")rn rn $.get("valid2.php", LunWenZuoZheGH:$("#LunWenZuoZheGH2").val(),rn function(data)rn eval(data);rn );rn rnrn);rnrn);rn请详细得解释一下这段代码,越详细越好,谢谢rn
请解释一下这段代码
添加网页加载进度窗口rnrn1: rn2: rn3: rn6: The Main Pagern7: rn8: rn9: This is the main pagern10: rn11: rnrnrn1.这里的var placeHolder = window.open('holder.html','placeholder','width=200,height=200');window.open是在什么时候运行的?页面加载前,中,后?rn2.body onLoad='placeHolder.close()'这个是在页面加载后运行的吗?rn3.open('holder.html','placeholder','width=200,height=200');是什么意思 ?rnrn不知道为什么,这段时间打开csdn的页面,就会出现一个js的错误,语法错误,代码0,url=http://scm.symantec....
python 前向引用,递归,变量的作用域,函数编程,匿名函数(lambda)
def foo(): print('from foo') bar() foo() #name 'bar' is not defined def bar(): print('from bar')在定义foo()函数之后bar()函数定义之前会报错,因为调用foo()函数的时候bar还未定义。def foo(): print('from foo') bar() ...
请大家帮忙分析,解释一下这段代码
各位高手:rn 你们好!rn 我现在想实现用代码直接创建数据库.但是如果把这些代码全部写到VB中.我怕以后不方便修改及更新.所以考虑是否要用VB调入一个文件.然后对文件进行数据的调用及运行.来达到创建数据库结构的目的.rn 但是如果我把创建代码放到一个文本文件中.有很多的问题.比如读写的问题,等等..rn 这里想问一下高手们!希望可以提一些意见.rn 1.如果要实现我这样的功能.需要怎么实现.rn 2.从外文件调用是否可行.又该怎样调用.rn 最好.可以有相关例子.谢谢!!!!急!rn 以下是在VB里面加载的代码!但是我觉得如果要按照这样写的话!实在太麻烦!而且比较累!rn==========================================================================rn '定义表与字段rn Dim DefDatabase As Databasern Dim DefTable As TableDef, DefField As Fieldrn '打开 VB-CODE.MDB 数据库rn Set DefDatabase = Workspaces(0).OpenDatabase(App.Path & "\VB-CODE.MDB", 0, False)rn '创建名为中国的数据表rn Set DefTable = DefDatabase.CreateTableDef("中国")rn '创建NAME的字段rn Set DefField = DefTable.CreateField("Name", dbText, 8)rn DefTable.Fields.Append DefFieldrn '结束数据表的创建rn DefDatabase.TableDefs.Append DefTablern Set DefDatabase.closern set DefDatabase = nothing
请高手帮忙解释一下这段代码的意思?
private bool SaveBill()rn rn if (this.txtBillNo.Text.Trim() == string.Emptyrn || this.txtBillNo.Text.Trim().ToUpper() == this.BillPrefix)rn rn this.ShowInfo("请按规则录入单号。");rn this.txtBillNo.Focus();rn return false;rn rn if (this.cboStorage.SelectedIndex < 0)rn rn this.ShowInfo("请选择仓库。");rn this.cboStorage.Focus(); rn return false;rn rn if (this.txtBizer.Tag == null)rn rn this.ShowInfo("请输入" + this.BizerTitle + "。");rn this.txtBizer_GotFocus(null, null);rn this.cboStorage.Focus(); //光标定位rn return false;rn rn if (_grid.Count == 0)rn rn this.ShowInfo("没有记录保存。");rn return false;rn rn BizerInfo bizer = (BizerInfo)this.txtBizer.Tag;rn BizBillInfo info = new BizBillInfo();rn info.BillNo = this.txtBillNo.Text.Trim();rn info.BillDate = DateTime.Now;rn info.StorageId = int.Parse(this.cboStorage.SelectedValue.ToString());rn info.StorageName = this.cboStorage.Text.Trim();rn info.BizerId = bizer.BizerId;rn info.BizerName = bizer.BizerName;rn info.InputMan = "mobile";rn info.Remark = string.Empty;rn info.Amount = _grid.Amount;rn info.Money = _grid.Money;rn this.ShowStatus("正在保存信息");rn this.SaveBill(info, _grid.ProductList.ToArray());rn this.HideStatus();rn this.HasSaved = true;rn return true;rn
请大侠帮忙解释一下这段代码的作用!
constrn SavedApplication : TApplication = nil;rn SavedScreen : TScreen = nil;rnrn// export this procedure and call it after loading the DLLrnprocedure Init(anApplicationHandle, aScreenHandle: LongWord);rnbeginrn if not Assigned(SavedApplication) thenrn beginrn SavedApplication := Application;rn Application := TApplication(anApplicationHandle);rn end;rnrn if not Assigned(SavedScreen) thenrn beginrn // ....same...rn end;rnend;rnrninitializationrnrnfinalizationrn if Assigned(SavedApplication) thenrn beginrn Application := SavedApplication;rn end;rnrn if Assigned(SavedScreen) thenrn beginrn // ....same.....rn end;rnend.rnrnrnrnrn、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、rn rn 原帖地址:http://www.delphifaq.com/faq/delphi/vcl/f287.shtml
请大牛们帮忙解释一下这段代码
这个是从微软的CRT中找到得strlen的代码片段,谁大牛们帮忙解释一下这段代码,谢谢rn[code=Assembly]rn ; 上面保证ecx 是4字节对齐,ecx中存放的是字符串指针rn mov eax,dword ptr [ecx] ; read 4 bytesrn mov edx,7efefeffhrn add edx,eaxrn xor eax,-1rn xor eax,edxrn add ecx,4rn test eax,81010100hrn je short main_looprnrn ;执行到这里就证明4个字节中包含0的字节,为什么??rn[/code]rnrn这段代码实在是看不明白,但是编译器这么实现了应该是因为其效率高吧,求解rn
请详细解释一下代码!
string connstr = "provider = Microsoft.Jet.OLEDB.4.0;Data Source ="rn + Server.MapPath(@".\mdb\PedicureManage.mdb")rn + ";Mode = Share Deny None; Persist Security Info = False";rn
请帮忙解释一下这段ACL
intface serial0rnrn  ip access-group 107 inrnrn  access-list 107 remark allow traffic to tom's pcrn  access-list 107 ip any host 198.78.46.8rnrn  access-list 107 remark allow only web traffic to webserverrnrn  access-list 107 tcp any host 198.78.46.12 eq 80rnrn  access-list 107 remark block everything elsernrn  access-list 107 deny any anyrnrn能每句都解释一下吗?rneq 80什么意思啊,还有一些单词组成的命令,什么意思啊rn谢了
请帮忙解释一下这段程序
private sub command1_click()rn print p1(3,7)rnend subrnrnpublic function p1(s as single,n as integer) as singlern if n=0 thenrnrn p1=1rn elsern if n mod 2=1 thenrn [color=#FF0000]p1=x*p1(x,n\2)[/color] 这句有点看不懂,调用时执行这行,为什么这个结果会是27呢,请说详细些谢谢。 rn elsern p1=p1(x,n\2)\xrn end ifrn end ifrnend functionrnrn
帮忙解释一下这段代码(很短)
[code=C/C++]#includern#includernrnint index=0;rnint tickets=100;rnHANDLE hMutex;rnDWORD WINAPI FunProc1(LPVOID lpParameter)rnrn while(1)rn rn WaitForSingleObject(hMutex,INFINITE);rn if(tickets>0)rn cout<<"Thread1 is telling ticket:"<0)rn cout<<"Thread2 is telling ticket:"<
帮忙解释一下这段ASP代码?
<%rndim bwdbobjrnrnfunction db_connect(byref dbName) 'dbName为数组参数rn   if not isobject(bwdbobj) thenrn Set bwdbobj = Server.CreateObject("baiwei.db")rn end ifrnrn if isobject(bwdbobj) thenrn db_connect = bwdbobj.db_connectX(dbName)rn elsern response.write "System error ""db_connect"" - call technical support "rn end ifrnrnend functionrn%>rnrn
大家帮忙解释一下这段代码
[code=C#]rn public string GetStringByControl(Control _Control)/*获取控件HTML*/rn rn StringBuilder sb = new StringBuilder();rn StringWriter sw = new StringWriter(sb);rn HtmlTextWriter htw = new HtmlTextWriter(sw);rn _Control.RenderControl(htw);rn return sb.ToString();rn rn[/code]rn这是一个用来截取HTML页面中控件的类,其中的StringBuilder、StringWriter、HtmlTextWriter、RenderControl分别指的是什么呢
这段随机代码帮忙解释一下。
1、 rncount(i) = Int(((12-1+ 1) * Rnd) + 1)rn这里的12-1+1是什么意思?简化成12行吗?rnrn2、rnfor j=1 to i-1 rn这里为什么不是for j=1 to irnrn3、在其它地方看到一段教程:rn****************************************************rn例如,下面的脚本产生一个50到75之间的随机数(包括50和75):rn<%=INT((75-50+1)*RND+50)%>rn****************************************************rn因此,我感觉这里的代码count(i) = Int(((12-1+ 1) * Rnd) + 1)rn是不是应该改为count(i) = Int(((12-1+ 1) * Rnd) + 12)rnrnrnrn从1-12数中随机选择5个不相同的数。rnrn<% dim count(5)rnsub rand(i)rnRandomizerncount(i) = Int(((12-1+ 1) * Rnd) + 1)rnfor j=1 to i-1 rnif count(i)=count(j) thenrnrand irnend ifrnnext rnend subrnrnfor i=1 to 5rnrand irnnextrnrnFor i = 1 To 5 rnresponse.write count(i)&" " rnrnnextrn %>rn
帮忙解释一下这段代码.谢!
function showtip2(current,e,text)rnrnif (document.all&&document.readyState=="complete")rndocument.all.tooltip2.innerHTML=''+text+''rndocument.all.tooltip2.style.pixelLeft=event.clientX+document.body.scrollLeft+10rndocument.all.tooltip2.style.pixelTop=event.clientY+document.body.scrollTop+10rndocument.all.tooltip2.style.visibility="visible"rn
谁能帮忙解释一下这段代码?
#include rn #define NONBLANK 'a'rn main()rn rn int c,lastc;rn lastc=NONBLANK;rn while ((c=getchar())!=EOF) rn if(c!=' ')rn putchar(c);rn if(c==' ')rn if(lastc!=' ')rn putchar(c);rn lastc=c;rn rn
这段代码大家帮忙解释一下
CEx04aView::CEx04aView():m_rectEllipse(0,0,200,200)rnrn m_nColor=GRAY_BRUSH;rnrn那个m_rectEllipse(0,0,200,200)不是返回一个对象吗?怎么能从对象中派生呢?
帮忙解释一下这段C代码!
for (offset = 0; offset < FLASH_SIZE; offset += MMU_SECTION_SIZE) rn cached_addr += offset;rn uncached_addr += offset;rn *(mmu_tlb_base + (cached_addr >> 20)) = \ //***rn (cached_addr | MMU_SECDESC | MMU_CACHEABLE);rn *(mmu_tlb_base + (uncached_addr >> 20)) = \ //***rn (cached_addr | MMU_SECDESC);rn rnrn感觉不是很能理解,特别是标注***的地方!谢谢了。
谁能帮忙解释一下这段代码???
class Time rnpublic:rn Time(int c=0, int i=1);rnprivate:rn int count;rn const int time;rnrnrnTime::Time(int c, int i)rn : time(i) // 什么意思???rnrncount=c;rn
帮忙解释一下这段代码吧!
Private operator As StringrnPrivate operators As Collectionrnrnoperators.Add UCase(rs("OPEGRANT"), rs("OPENAME"))rnrnPublic Function createCoilAuthorized() As Booleanrn createCoilAuthorized = Falsern On Error Resume Nextrn createCoilAuthorized = operators(operator) Like "*C*"rn Err.clearrnEnd Functionrn对collection 不熟悉,那位办忙解释一下。
如何实现邀请好友帮抢票功能?
近期,如何实现更加便捷的邀请好友帮抢票成为了各类抢票app拉新、促活的有效方案,而目前主流社交平台无非就是微信、微博、QQ,所以如何运用好这三个平台,合理规划分享内容与app相关联就显得尤为重要。 仔细思考后问题确定为如何通过分享一个链接给好友,好友点击后能够直接回到app去操作,确定好这一方案后就开始找市场上有没有已经成熟的解决方案,经过一些搜索,对比后找到下面这样一个demo,先给大家看一下
请帮忙解释一下代码
constrn DosDelimSet : set of Char = ['\', ':', #0]; ///////这里不明白,rn CITEMNAME='收费项目';rn CPatientInfo= 'IC_CARDNO,s,50,就诊卡号' +'|'+////以下全不明白..rn 'VISITID,s,50,就诊号' +'|'+rn 'CARDNO,s,50,病人号' +'|'+rn 'IDNO,s,32,身份证号' +'|'+rn 'NAME,s,60,中文名称' +'|'+rn 'PYCODE,s,50,英文/拼音名称'+'|'+rn 'BIRTHDAY,s,50,出生日期' +'|'+rn 'AGE,s,10,年龄' +'|'+rn 'SEX,s,16,性别' +'|'+rn 'TELEPHONE,s,50,电话号码' +'|'+rn 'ADDRESS,s,200,地址' +'|'+rn 'DISTRICT,s,50,籍贯' +'|'+rn 'PROFESSION,s,50,职业' +'|'+rn 'PATIENTTYPE,s,50,患者类型'+'|'+rn 'APPLYDATE,s,50,申请日期' +'|'+rn 'BOOKDATE,s,50,临床预约日期时间'+'|'+rn 'APPLYID,s,50,申请流水号' +'|'+rn 'RECIPE,s,50,病人号' +'|'+rn 'ITEMID,s,50,检查项目ID' +'|'+rn 'ITEMNAME,s,200,检查项目名称'+'|'+rn 'DEPT,s,50,科室名称' +'|'+rn 'CONFIRMTIMES,s,50,确认次数' +'|'+rn 'EXECUTETIMES,s,50,需确认总次数'+'|'+rn 'ROOM,s,50,病房' +'|'+rn 'BED,s,10,床号' +'|'+rn 'APPLYDOC,s,50,申请医师' +'|'+rn 'CHECKCAUSE,s,200,检查目的' +'|'+rn 'PART,s,200,检查部位' +'|'+rn 'METHOD,s,100,检查方法' +'|'+rn 'DIAGNOS,s,200,临床诊断' +'|'+rn 'DISEASE,s,200,病理诊断' +'|'+rn 'HISTORY,s,200,病史' +'|'+rn 'SYMPTOM,s,200,症状' +'|'+rn 'STATUS,s,50,体征';rn rn CBookInfo= 'IC_CARDNO,s,50,就诊卡号' +'|'+rn 'CARDNO,s,50,病人号' +'|'+rn 'BOOK_ITEM,s,16,设备类型' +'|'+rn 'BOOK_TYPE,s,10,来源' +'|'+rn 'BOOK_DATE,s,24,预约日期' +'|'+rn 'NOON_CODE,s,10,午别' +'|'+rn 'OPER_CODE,s,50,操作员' +'|'+rn 'OPER_DATE,s,24,操作时间' +'|'+rn 'VALID_STATE,s,10,有效' +'|'+rn 'EXEC_DEPT,s,50,执行部门' +'|'+rn 'MEMO2,s,200,备注' +'|'+rn 'BEGIN_TIME,s,24,开始时间' +'|'+rn 'END_TIME,s,24,结束时间' +'|'+rn 'CHECK_SEQ,s,16,检查序列';rnrn CCheckFeeInfo='ITEM_CODE,s,50,项目代码'+'|'+rn 'ITEM_NAME,s,200,项目名称'+'|'+rn 'UNIT_PRICE,f,18,单价';rnrnrn小弟不才,没见过这种写法,望各位解释一下!
请给我解释一下这段代码
rnPrivate Sub cmdApply_Click()rn '定义变量和对象rn Dim adText As AcadTextrn Dim adMText As AcadMTextrn Dim adSS As AcadSelectionSetrn 上面这个定义什么样的变量啊?这是CAD二次的一段代码.......
请帮我解释一下这段代码
请问如下函数是怎样解释的?rnclass Class1rnstatic int MaxValue(int[] intArray)rn int maxVal=intArray[0] ;rnfor (int i = 1;i < intArray.length;i++)rnrnif (intArray[i]> maxVal)rnmaxVal = intArray[i];rnrnreturn maxVal;rnrn static void Main (string[] args )rnint [] myArray = 1,8,3,6,2,5,9,3,0,2;rnint maxVal = MaxValue(myArray);rnConsole.WriteLine("The maximum value in myArray is 0 ", maxVal);rnrnrnrnrnrn在这一段代码中我有几点有点不太懂请高手指教rnrnfor (int i = 1;i < intArray.length;i++)rnrnif (intArray[i]> maxVal)rnmaxVal = intArray[i];rnrn
请帮我解释一下这段代码!
Sub TT()rnDim Rs As New ADODB.RecordsetrnRs.ActiveConnection = Application.CurrentProject.ConnectionrnRs.LockType = adLockOptimisticrnRs.CursorType = adOpenDynamicrnRs.Open "qiyeming"rnDim db As DAO.DatabasernDim tRs As DAO.RecordsetrnSet db = Application.CurrentDb()rnSet tRs = db.OpenRecordset("lizheng", dbOpenTable)rntRs.Index = "timing"rnDo Until Rs.EOFrn temp = Trim(Rs!qiyeming & "")rn For i = Len(temp) To 1 Step -1rn For j = Len(temp) - i To 1 Step -1rn tRs.Seek "=", Mid(temp, j, i)rn If Not tRs.NoMatch Thenrn tRs.Editrn tRs!q = tRs!q + 1rn tRs.Updatern GoTo xxrn End Ifrn Next jrn Next irnxx:rn n = n + 1rn If n Mod 100 = 0 Thenrn Debug.Print nrn DoEventsrn End Ifrn Rs.MoveNextrnLooprnEnd Subrn
请高手解释一下这段代码
rn主要讲一下for循环的逻辑.谢了.
请帮我解释一下这段代码……
是关于快速排序的。rnrn[code=C/C++]void swap(int *a, int *b)rn rn int t=*a; *a=*b; *b=t; rnrnrnvoid quicksort(int arr[],int beg,int end)rnrn if (end >= beg + 1) rn rn int piv = arr[beg], k = beg + 1, r = end;rn rn while (k < r) rn rn if (arr[k] < piv) rn k++;rn else rn swap(&arr[k], &arr[r--]);//这里rn rn if (arr[k] < piv)rn rn swap(&arr[k],&arr[beg]);//这里rn rn quicksort(arr, beg, k);rn quicksort(arr, r, end); rn else rn if (end - beg == 1)rn return;rn rn swap(&arr[--k],&arr[beg]);//这里rn quicksort(arr, beg, k);rn quicksort(arr, r, end); rn rn rn rn[/code]
请大家帮忙详细解释一下!
m_AddMsgLIst.SendMessage(LB_SETHORIZONTALEXTENT,0,0);rn查了msdn,还是觉得没有理解透,希望各位兄台帮帮忙,谢谢!
请解释一下什么是“语义化的 HTML”。
随着 CSS 的深入人心,结构、表现与行为的逐渐分离,HTML 语义化成了炙手可热的卖点。 语义化的 HTML 首先要强调 HTML 结构一个网页就好像一幢房子,HTML 结构就是钢筋混泥土的墙,一幢房子如果没有钢筋混泥土的墙那就是一堆废砖头,也就称不上是房子了。CSS 是装饰材料,是油漆,是用来装饰房子的。CSS 如果没有 HTML 结构那也就什么都不是了,没有了实际使用价值。CSS 完全依靠
高人 帮忙解释一下这段代码(读取文件代码)
得到这段代码 但看得迷糊,希望高手帮忙,最好给每句代码加上注释!多谢了!rnrnFunction GetPage(url) rn Set Retrieval = CreateObject("Microsoft.XMLHTTP") rn With Retrieval rn .Open "Get", url, False, "", "" rn .Send rn GetPage = BytesToBstr(.ResponseBody)rn End With rn Set Retrieval = Nothing rnEnd FunctionrnrnFunction BytesToBstr(body)rn dim objstreamrn set objstream = Server.CreateObject("adodb.stream")rn objstream.Type = 1rn objstream.Mode =3rn objstream.Openrn objstream.Write bodyrn objstream.Position = 0rn objstream.Type = 2rn objstream.Charset = "GB2312"rn BytesToBstr = objstream.ReadText rn objstream.Closern set objstream = nothingrnEnd Functionrn
请大家帮忙看看这段代码,不太理解,帮忙解释一下~~~~~~~~~`
假设[oblog_setup] 表中的数据为:rn字段1 字段2 字段3 字段4rn1 2 3 4rnrn<%Class class_sysrn Public Sub ReloadSetup()rn Dim sql, rs, i rn sql = "select * from [oblog_setup] " rn Set rs = execute(sql)rn name = "setup" ' 这个name 是怎么意思呢?(不是变量)rn Value = rs.GetRows(1) ' 同上 rs.GetRows(1)读出来的数据到底是什么?rn Set rs = Nothingrn Application.Lock ' 下面的也不太理解 rn Application(cache_name & "index_update") = Truern Application(cache_name & "list_update") = Truern Application.unLockrn End Subrn end class %>rn
在32位小端的机器上,如下代码输出是什么?
在32位小端的机器上,如下代码输出是什么:char array[12] = {0x01 , 0x02 , 0x03 , 0x04 , 0x05 , 0x06 ,0x07 , 0x08}; short *pshort = (short *)array; int *pint = (int *)array; int64 *pint64 = (int64 *)array;
请详细解释一下这段程序的计算原理?
st = Year(Date) - 1rnst = st & "-12-31"rnm = Month(Date)rnd = DateAdd("m", m, DateValue(st))rnd = Day(d)rnMsgBox m & "月份最后一日是:" & d
哪位大虾能详细解释一下这段代码;
这是拖放Url的代码interfacernrnusesrn Windows, ActiveX, ComObj,Dialogs,Sysutils;rnrntypern TDropEvent = procedure(Sender:TObject;Msg:Pchar)of rnobject;rn TTMyDrop = class(TComObject, IDropTarget)rn privatern FOnDroped: TDropEvent;rn procedure SetOnDroped(const Value: TDropEvent);rn protectedrn Declare IDropTarget methods herern function DragEnter(const dataObj: IDataObject; rngrfKeyState: Longint;rn pt: TPoint; var dwEffect: Longint): HResult; rnstdcall;rn function DragOver(grfKeyState: Longint; pt: rnTPoint;rn var dwEffect: Longint): HResult; stdcall;rn function DragLeave: HResult; stdcall;rn function Drop(const dataObj: IDataObject; rngrfKeyState: Longint; pt: TPoint;rn var dwEffect: Longint): HResult; stdcall;rn publicrn property OnDroped:TDropEvent read FOnDroped rnwrite SetOnDroped;rn end;rnrnconstrn Class_TMyDrop: TGUID = rn'846C94F8-7649-11D2-9836-0000E82EA1B1';rnrnimplementationrnrnuses ComServ,unit1;rnrn TTMyDrop rnrnfunction TTMyDrop.DragEnter(const dataObj: rnIDataObject;rn grfKeyState: Integer; pt: TPoint; var dwEffect: rnInteger): HResult;rnvarrn enumFormatEtc: IEnumFormatEtc;rn f:TFORMATETC;rn count:Integer;rn Found:boolean;rnbeginrn dataObj.EnumFormatEtc(DATADIR_GET,enumFormatEtc);rn Found:=false;rn while (enumFormatEtc.Next(1,f,@count)=S_OK)and rn(count>0) dorn beginrn if (f.cfFormat=CF_TEXT) thenrn beginrn Found:=true;rn Break;rn end;rn end;rn if Found thenrn Result:=S_OKrn elsern beginrn result:=E_INVALIDARG;rn dwEffect:=DROPEFFECT_NONE;rn end;rnend;rnrnfunction TTMyDrop.DragLeave: HResult;rnbeginrn result := S_OK;rnend;rnrnfunction TTMyDrop.DragOver(grfKeyState: Integer; pt: rnTPoint;rn var dwEffect: Integer): HResult;rnbeginrn result := S_OK;rnend;rnrnfunction TTMyDrop.Drop(const dataObj: IDataObject; rngrfKeyState: Integer;rn pt: TPoint; var dwEffect: Integer): HResult;rnvarrn enumFormatEtc: IEnumFormatEtc;rn f:TFORMATETC;rn count:Integer;rn Found:boolean;rn medium: TStgMedium;rnbeginrn dataObj.EnumFormatEtc(DATADIR_GET,enumFormatEtc);rn Found:=false;rn while (enumFormatEtc.Next(1,f,@count)=S_OK)and rn(count>0) dorn beginrn if (f.cfFormat=CF_TEXT) thenrn beginrn Found:=true;rn Break;rn end;rn end;rn if not Found thenrn beginrn result:=E_INVALIDARG;rn dwEffect:=DROPEFFECT_NONE;rn Exit;rn end;rn dataObj.GetData(f,medium);rn if medium.tymed =1 thenrn beginrn if Assigned(fOnDroped) thenrn beginrn fOnDroped(Self,PChar(GlobalLock(medium.hglobalrn)));rn GlobalUnLock(medium.hglobal);rn end;rn result := S_OK;rn end;rnrnend;rnrnprocedure TTMyDrop.SetOnDroped(const Value: rnTDropEvent);rnbeginrn FOnDroped := Value;rnend;rnrninitializationrn TComObjectFactory.Create(ComServer, TTMyDrop, rnClass_TMyDrop,rn 'TMyDrop', '', ciMultiInstance, tmApartment);rnend.rnrn
大神解释一下这段代码,详细一点,3Q
using System;rnusing System.Collections.Generic;rnusing System.Linq;rnusing System.Text;rnusing System.Management;rnrnnamespace 代码清单3._4rnrn class Programrn rn public static void Main(string[] args)rn rn string temp = "";rn ManagementClass MyDisk = new ManagementClass("Win32_LogicalDisk");rn ManagementObjectCollection disks;rn disks = MyDisk.GetInstances();rn foreach(ManagementObject disk in disks)rn rn temp = "";rn temp+="ID:"+disk["DeviceID"];rn temp+="名称:"+disk["Name"];rn temp+="卷标:"+disk["VolumeName"];rn if(disk["FileSystem"].ToString()!="")rn rn temp+="文件系统:"+disk["FileSystem"];rn temp+="描述:"+disk["Description"];rn if(System.Convert.ToInt64(disk["Size"])>0)rn rn temp += "大小:" + System.Convert.ToInt64(disk["Size"].ToString());rn rn temp += "类型:" + System.Convert.ToInt16(disk["DriveType"].ToString());rn rn Console.WriteLine(temp);rn Console.ReadKey();rn rn rn rnrn