Jiangsheng的CSDN Digest (Dec 2005)[2]

[入库:2006年2月23日] [更新:2007年3月24日]

本文简介:


It is handled differently by operation systems. For example, in windows 2000 and above, it is registered as a hotkey by winlogon.exe, and is handled in a window on the SAS desktop, not the application desktop. You need to open the SAS desktop, and broadcast a WM_HOTKEY message. However, I doubt you can do this in your java virtual machine.

Reference:
www.codeproject.com/system/alt_control_delete.asp


基于对话框的数据库应用程序问题(VC/MFC 界面 )


我的程序用ado实现。现在想加入一个打印功能。查了一下资料,好象只有视图类有可以加打印。但我的程序是基于对话框的。比方说有个查询功能,结果显示在一个对话矿上,如何将它打印呢?


http://msdn.microsoft.com/library/en-us/dncdev00/html/vc0300.asp


如何获得rm,rmvb,avi,wmv,mp3...等文件的头信息? (专题开发/技术/项目 多媒体/流媒体开发 )


如题,能得到播放时间,视频大小。。。tag信息
有通用的函数吗?
请高手指教,最好有源码,delphi的最好


没有通用的函数。
你可以用Windows Media Format SDK里面的WMReader对象打开Windows Media Player支持的文件,之后读取相关信息。参见http://msdn.microsoft.com/library/en-us/wmform95/htm/aboutthewindowsmediaformatsdk.asp。Real的SDK中有rm、rmvb的格式规范(或者查Real提供给IETF的Internet Draft-RealMedia File Format)。mp3可以去查MPEG-1(ISO 11172)的标准文档。AVI文件中的信息可以用AVIFileInfo来获取。


关于gdi+中Image类显示图片的问题 (VC/MFC 基础类 )


通常我们可以用Image(L"c:\\1.jpg")来加载显示图片
但如果图片文件包含在其它文件中,需要用CFile来读到缓冲区中,再加载,
以下段代码为什么不能正常显示图片?谢谢!
void CMy1Dlg::OnPaint()
{
if (IsIconic())
{
CPaintDC dc(this); // device context for painting

SendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0);

// Center icon in client rectangle
int cxIcon = GetSystemMetrics(SM_CXICON);
int cyIcon = GetSystemMetrics(SM_CYICON);
CRect rect;
GetClientRect(&rect);
int x = (rect.Width() - cxIcon + 1) / 2;
int y = (rect.Height() - cyIcon + 1) / 2;

// Draw the icon
dc.DrawIcon(x, y, m_hIcon);
}
else
{
CDialog::OnPaint();
}

CFile file;
file.Open("c:\\1.jpg", CFile::modeRead);
int bufSize = (int)file.GetLength();
char *pBuf = new char[bufSize];
file.Read(pBuf, bufSize);
WCHAR *ws = new WCHAR[bufSize];
MultiByteToWideChar(CP_ACP, 0,pBuf, bufSize,ws, bufSize);

Graphics graphics(GetDC()->m_hDC);
Image image(ws);
graphics.DrawImage(&image,0, 0, 400, 300);
}


Use COleStreamFile instead of CFile, and use CreateMemoryStream to create a stream in memory.

COleStreamFile image_stream ;
image_stream.CreateMemoryStream(NULL);
img.Save(image_stream.GetStream(), Gdiplus::ImageFormatBMP);

Before reading from the memory stream returned by GetStream, call SeekToBegin.


高分提问!如何对XML文件排序?100分送上,UP有分!(.NET技术 VB.NET )


两个问题:
比如我有如下XML文档,读取时如何根据level和finishDate对每个shmItem排序?
我尝试使用XPathDocument和XPathNavigator,但是如果xml文档中包含中文,初始化就很慢,请各位指教是怎么回事?

<?xml version="1.0" encoding="gb2312"?>
<!--Powered By Ranran.-->
<shemes>
<shmItem>
<id>632698120068125000</id>
<title>文章一</title>
<level>0</level>
<finishDate>2005-12-10</finishDate>
<tips>中文内容
</tips>
</shmItem>
<shmItem>
<id>632698120068125300</id>
<title>titles23</title>
<level>3</level>
<finishDate>2005-12-10</finishDate>
<tips>some content
</tips>
</shmItem>
</shemes>


<?xml version="1.0" encoding=>指明文档使用的编码。写一个XSLT来转。用XSLT查询XML的时候排序。


工程能够正常修改,使用,但是左边工作区里ClassView下一个对话框的类不见了, FileView里有相应的.cpp.h文件,怎么才能使得那个类重新显示(VC/MFC 基础类 )

VC保存时,文件莫名其妙的没了...


保存文件时,经常有这样的警告“有其他进程正在使用本文件”。一般情况下,忽略警告,第二次保存文件时就没有警告了。在某次保存时,出现警告,多按了几次CTRL+S,结果文件没了。不幸中的万幸,我用FinalData把那个丢失的文件找回来了,原文件里大半是乱码,工程目录下多了个MVCDD.TMP的文件,里面就是丢失的代码,完好。想弄清楚这到底是VC的问题还是VA的问题,或是其他问题。


如果使用的是VC6,而且没有打SP6补丁,那么关闭Norton防火墙,或者升级VC。这个问题的详细资料参考微软知识库文章FIX: "Cannot Save File" Error Message in the Visual C++ IDE http://support.microsoft.com/kb/822856/


如何将asf格式的文件分成包发送到网络上?(专题开发/技术/项目 多媒体/流媒体开发 )


问题描述:结点A有一个asf格式的文件,结点B以流媒体的形式从结点A那里获得数据,然后调用media player进行播放。
现在是,结点A如何将asf格式的文件以包的形式发送出去???

本文关键:Jiangsheng的CSDN Digest (Dec 2005)
  相关方案
Google
 

本站最佳浏览方式为 分辨率 1024x768 IE 6.0(或更高版本的 IE浏览器)

go top