我想用
TextOut(m_hdc,nStartingXPixel,nStartingYPixel,(LPCTSTR)temp[j],strlen(temp[j]));
打印汉字,怎么也打印不出来

解决方案 »

  1.   

    请问你确认m_hdc,nStartingXPixel,nStartingYPixel这些参数值都正确么?还有temp[j]是一个字符串数组或是二维数组么?
      

  2.   

    可能是nStartingXPixel,nStartingYPixel的定位有错
      

  3.   

    位置没错,出来的不是汉字,是乱玛
        我是用ATL做了个控件,在2000下编译的,WEB应用在客户端是98系统时,打印的是乱玛,请问是系统的原因吗?
      

  4.   

    把temp的定义,及赋值语句贴出来
      

  5.   

    就是以\0结束的字符串
            可以这样
            char temp[100];
            strcpy(temp,"中国人民");
         TextOut(m_hdc,
                 nStartingXPixel,
                 nStartingYPixel,
                 (LPCTSTR)temp,
                 strlen(temp));         char tempsz[300];
    char temp[10][100];
    char cutsz[100],*leftsz;
        unsigned short maxlength=0;
    strcpy(tempsz,m_TextContent);  
    int rows=0;
        while((leftsz=strstr(tempsz,"\n"))!=NULL)
    {
    strncpy(cutsz,tempsz,strlen(tempsz)-strlen(leftsz));
    cutsz[strlen(tempsz)-strlen(leftsz)]='\0';
            strcpy(temp[rows],cutsz);
    strcpy(tempsz,leftsz+1);
    if(strlen(temp[rows])>maxlength)
                maxlength=strlen(temp[rows]);
    rows++;
    }
        strcpy(temp[rows],tempsz);
    if(strlen(temp[rows])>maxlength)
           maxlength=strlen(temp[rows]);
      

  6.   

    谢谢各位,我想我的问题是出在bitblt上了,问题现在解决了,谢谢大家