vc源码下载(下载的vc++源代码怎样使用)

本文目录
- 下载的vc++源代码怎样使用
- vc99源文件在哪下载
- 求一个控制摄像头小程序的源码,要求VC下编译运行
- 求免费c,c++,vc源代码下载网站网址
- 怎么从VC中导出源代码
- 求VC++源代码,200行左右,要有详细注释,悬赏!!!
- VC++6.0问题:下载源代码存在E盘,双击其.dsw文件打开问题,
下载的vc++源代码怎样使用
如果没有.dsw和dsp,只有makefile之类的东东,那么新建一个工程,把扩展名为cpp、h 和rc的文件加到工程中。然后查看所有cpp文件有没有包含"stdafx.h",如果没有,就在CPP首部加上"stdafx.h".
然后编译。
vc99源文件在哪下载
vc99源文件在GitHub,Gitee,SourceForge等途径来下载。
1、GitHub:VC99的源代码可以在GitHub上进行下载,GitHub是一个全球最大的开源社区,VC99的源代码也是在GitHub上进行托管和维护的。
2、Gitee:Gitee是一个国内的开源代码托管平台,也可以在Gitee上获取VC99的源代码。
3、SourceForge:SourceForge是一个免费的开源软件代码托管平台,您也可以在SourceForge上获取VC99的源代码。
求一个控制摄像头小程序的源码,要求VC下编译运行
VC-摄像头控制SDK源码
#include 《windows.h》
#include 《stdio.h》
#include 《vfw.h》
#pragma comment(lib,"vfw32.lib")
HWND ghWndCap ; //捕获窗的句柄
CAPDRIVERCAPS gCapDriverCaps ; //视频驱动器的能力
CAPSTATUS gCapStatus ; //捕获窗的状态
char szCaptureFile = "MYCAP.AVI";
char gachBuffer;
LRESULT CALLBACK WndProc(HWND,UINT,WPARAM,LPARAM);
LRESULT CALLBACK StatusCallbackProc(HWND hWnd,int nID,LPSTR lpStatusText)
{
if(!ghWndCap)return FALSE;//获得捕获窗的状态
capGetStatus(ghWndCap,&gCapStatus,sizeof(CAPSTATUS));//更新捕获窗的大小
SetWindowPos(ghWndCap,NULL,0,0,gCapStatus.uiImageWidth,gCapStatus.uiImageHeight,SWP_NOZORDER|SWP_NOMOVE);
if(nID==0){//清除旧的状态信息
SetWindowText(ghWndCap,(LPSTR)"hello");
return (LRESULT)TRUE;
}//显示状态ID和状态文本
wsprintf(gachBuffer,"Status# %d: %s",nID,lpStatusText);
SetWindowText(ghWndCap,(LPSTR)gachBuffer);
return (LRESULT)TRUE;
}
LRESULT CALLBACK ErrorCallbackProc(HWND hWnd,int nErrID,LPSTR lpErrorText)
{
if(!ghWndCap)return FALSE;
if(nErrID==0)return TRUE;//清除旧的错误
wsprintf(gachBuffer,"Error# %d",nErrID);//显示错误标识和文本
MessageBox(hWnd, lpErrorText, gachBuffer,MB_OK | MB_ICONEXCLAMATION);
return (LRESULT) TRUE;
}
LRESULT CALLBACK FrameCallbackProc(HWND hWnd,LPVIDEOHDR lpVHdr)
{
FILE *fp;
fp=fopen("caram.dat","w");
if(!ghWndCap)return FALSE;//假设fp为一打开的.dat文件指针
fwrite(lpVHdr-》lpData,1,lpVHdr-》dwBufferLength,fp);
return (LRESULT)TRUE;
}
int WINAPI WinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance,PSTR szCmdLine,int iCmdShow)
{
static TCHAR szAppName=TEXT("HelloWin");
HWND hwnd;
MSG msg;
WNDCLASS wndclass;
wndclass.style=CS_HREDRAW|CS_VREDRAW;
wndclass.lpfnWndProc=WndProc;
wndclass.cbClsExtra=0;
wndclass.cbWndExtra=0;
wndclass.hInstance=hInstance;
wndclass.hIcon=LoadIcon(NULL,IDI_APPLICATION);
wndclass.hCursor=LoadCursor(NULL,IDC_ARROW);
wndclass.hbrBackground=(HBRUSH)GetStockObject(WHITE_BRUSH);
wndclass.lpszMenuName=NULL;
wndclass.lpszClassName=szAppName;
if(!RegisterClass(&wndclass))
{
MessageBox(NULL,TEXT("This program requires WindowsNT!"),szAppName,MB_ICONERROR);
return 0;
}
hwnd=CreateWindow(szAppName,TEXT("The Hello Program"),WS_OVERLAPPEDWINDOW,CW_USEDEFAULT,CW_USEDEFAULT,CW_USEDEFAULT,CW_USEDEFAULT,NULL,NULL,hInstance,NULL);
ShowWindow(hwnd,iCmdShow);
UpdateWindow(hwnd);
while(GetMessage(&msg,NULL,0,0))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
return msg.wParam;
}
LRESULT CALLBACK WndProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam)
{
HDC hdc;
PAINTSTRUCT ps;
RECT rect;
switch(message)
{
case WM_CREATE:
{
ghWndCap=capCreateCaptureWindow((LPSTR)"Capture Window",WS_CHILD|WS_VISIBLE,0,0,300,240,(HWND)hwnd,(int)0);
capSetCallbackOnError(ghWndCap,(FARPROC)ErrorCallbackProc);
capSetCallbackOnStatus(ghWndCap,(FARPROC)StatusCallbackProc);
capSetCallbackOnFrame(ghWndCap,(FARPROC)FrameCallbackProc);
capDriverConnect(ghWndCap,0); // 将捕获窗同驱动器连接
//获得驱动器的能力,相关的信息放在结构变量gCapDriverCaps中
capDriverGetCaps(ghWndCap,&gCapDriverCaps,sizeof(CAPDRIVERCAPS));
capPreviewRate(ghWndCap, 66); // 设置Preview模式的显示速率
capPreview(ghWndCap, TRUE); //启动Preview模式
if(gCapDriverCaps.fHasOverlay) //检查驱动器是否有叠加能力
capOverlay(ghWndCap,TRUE); //启动Overlay模式
if(gCapDriverCaps.fHasDlgVideoSource)capDlgVideoSource(ghWndCap); //Video source 对话框
if(gCapDriverCaps.fHasDlgVideoFormat)capDlgVideoFormat(ghWndCap); // Video format 对话框
if(gCapDriverCaps.fHasDlgVideoDisplay)capDlgVideoDisplay(ghWndCap); // Video display 对话框
capFileSetCaptureFile( ghWndCap, szCaptureFile); //指定捕获文件名
capFileAlloc(ghWndCap, (1024L * 1024L * 5)); //为捕获文件分配存储空间
capCaptureSequence(ghWndCap); //开始捕获视频序列
capGrabFrame(ghWndCap); //捕获单帧图像
}
return 0;
case WM_PAINT:
hdc=BeginPaint(hwnd,&ps);
GetClientRect(hwnd,▭);
DrawText(hdc,TEXT("Hello,Windows98!"),-1,▭,DT_SINGLELINE|DT_CENTER|DT_VCENTER);
EndPaint(hwnd,&ps);
return 0;
case WM_DESTROY:
{
capSetCallbackOnStatus(ghWndCap,NULL);
capSetCallbackOnError(ghWndCap,NULL);
capSetCallbackOnFrame(ghWndCap,NULL);
capCaptureAbort(ghWndCap);//停止捕获
capDriverDisconnect(ghWndCap); //将捕获窗同驱动器断开
PostQuitMessage(0);
}
return 0;
}
return DefWindowProc(hwnd,message,wParam,lParam);
}
求免费c,c++,vc源代码下载网站网址
www.vchome.net
www.vckbase.net
www.code365.com
www.vccode.net
www.czvc.net
www.csdn.net
怎么从VC中导出源代码
自带的编译环境是不带这个功能的,不过你直接保存的工程文件可以直接用记事本打开,和txt没区别的。如果你想拿到手机上看或者只需要txt格式的话,可以写一个批处理程序,新建文本文件,写入“ren *.* *.txt”然后改txt后缀为bat放在你你要转换为txt的源码文件同一目录下然后双击就行了。希望采纳
求VC++源代码,200行左右,要有详细注释,悬赏!!!
哈弗曼压缩
#include 《string.h》
#include 《stdlib.h》
#include《iostream.h》
#include《fstream.h》
#define MaxNodes 512
#define MaxBufSize 512
#define MaxBits 256
struct Node
{
unsigned char b;
int count;
int parent,lch,rch;
char bits;
}Nodes;
ifstream ifile;
ofstream ofile;
char *fname=new char();
unsigned char c;
char buf;
int flen;
int NodesNum;
void decompress();
void compress();
void charCount();
void initNodes();
void creatHuffTree();
void huffCoding();
void sortByCount();
int FindMin(int curlen);
void comToFile();
void decomToFile();
void clearSDS();
void locChar(int loc,int i);
void main()
{
char choice;
while(1)
{
cout《《" ------------------------------------------------------"《《endl;
cout《《" # 0.退出 #"《《endl;
cout《《" # 1.压缩 #"《《endl;
cout《《" # 2.解压 #"《《endl;
cout《《" ------------------------------------------------------"《《endl;
do
{
cout《《"请选择:"《《endl;
cin》》choice;
if(choice!=’0’ && choice!=’1’ && choice!=’2’)
{
cout《《"输入出错!请重新输入!"《《endl;
}
}
while(choice!=’0’ && choice!=’1’ && choice!=’2’);
switch(choice)
{
case ’0’:cout《《"成功退出!"《《endl;exit(0); break;
case ’1’:compress();break;
case ’2’:decompress();break;
}
}
}
void compress()
{
cout《《"请输入待压缩的文件名:";
cin》》fname;
ifile.open(fname,ios::nocreate|ios::binary);
if(!ifile)
{
cout《《"文件不存在!"《《endl;
return;
}
charCount();
initNodes();
sortByCount();
creatHuffTree();
huffCoding();
cout《《"请输入压缩后的文件名:";
cin》》fname;
ofile.open(fname,ios::binary);
ofile.write((char*)&NodesNum,sizeof(NodesNum));
ofile.write((char*)&flen,sizeof(flen));
for(int i=0;i《NodesNum;i++)
{
ofile.write((char*)&Nodes.b));
ofile.write((char*)&Nodes.count));
}
comToFile();
ifile.close();
ofile.close();
clearSDS();
}
void decompress()
{
clearSDS();//不加此句,关闭程序再解压,会提示BUF出错
cout《《"请输入待解压的文件名:";
cin》》fname;
ifile.open(fname,ios::nocreate|ios::binary);
if(!ifile)
{
cout《《"文件不存在!"《《endl;
return;
}
ifile.read((char*)&NodesNum,sizeof(NodesNum));
ifile.read((char*)&flen,sizeof(flen));
cout《《NodesNum《《" "《《flen《《endl;
for(int i=0;i《NodesNum;i++)
{
ifile.read((char*)&Nodes.b));
ifile.read((char*)&Nodes.count));
}
creatHuffTree();
cout《《"请输入解压后的文件名:";
cin》》fname;
ofile.open(fname);
decomToFile();
ifile.close();
ofile.close();
clearSDS();
}
void clearSDS()//SDS is short for Shared Data Structure
{
NodesNum=flen=c=0;
for(int i=0;i《MaxNodes;i++)
{
Nodes.b=0;
Nodes.count=0;
Nodes.rch=-1;
buf=0;
for(int j=0;j《MaxBits;j++) Nodes=0;
}
}
void comToFile()
{
ifile.clear();
ifile.seekg(0);
char tbuf="00000000";
while(ifile.get(c))
{
for(int i=0;i《NodesNum;i++)
{
if(c==Nodes.b)
{
strcat(buf,Nodes.bits);
break;
}
}
while(strlen(buf)》=8)
{
memcpy(tbuf,buf,8);
c=(char)strtol (tbuf,NULL,2);
memmove(buf,buf+8,strlen(buf)+1-8);
ofile.write((char*)&c,sizeof(c));
}
}
if(strlen(buf)》0)//剩余
{
strcat(buf,"0000000");//最多接7个0即可
memcpy(tbuf,buf,8);
c=(char)strtol (tbuf,NULL,2);
ofile.write((char*)&c,sizeof(c));
}
}
void decomToFile()
{
while (ifile.get(c)) //while(!ifile.eof()),老样子
{ //ifile.read((char*)&c,sizeof(c));
char tbuf="00000000";
char rbuf="00000000";
itoa((int)c,rbuf,2);
strcpy(tbuf+8-strlen(rbuf),rbuf);
memmove(buf+strlen(buf),tbuf,8);//末尾会多一个tbuf,无碍
while(strlen(buf)》255&&flen》0) locChar(2*NodesNum-2,0);
}
while(strlen(buf)》0&&flen》0) locChar(2*NodesNum-2,0);
}
void locChar(int loc,int i)//递归得出字符
{
if((Nodes.rch==-1))
{
ofile.write((char*)&Nodes.b));
flen--;
//memmove(buf,buf+i,strlen(buf)-i+1);
//memmove(buf,buf+i,512-i);//Very improtant code modified at here!
memcpy(buf,buf+i,512-i);//Same result Like the line Above!Maybe not effective
return;
}
else
{
switch( buf)
{
case ’0’: loc=Nodes.lch;break;
case ’1’: loc=Nodes.rch;break;
default: cout《《"buf中出错!"《《endl;break;
}
i++;
locChar(loc,i);
}
}
void charCount()//统计字符出现次数
{
while(ifile.get(c))
{
Nodes.count++;
flen++;//得出文件长度
}
}
void initNodes()//初始化
{
for(int i=0;i《MaxNodes;i++)
{
if(Nodes.count!=0)
Nodes.b=(unsigned char)i;
else Nodes.b=0;
Nodes.rch=-1;
}
}
void creatHuffTree()//建树
{
int t=2*NodesNum-1;
for(int i=NodesNum;i《t;i++)
{
int loc=FindMin(i);
Nodes.count;
Nodes.parent=i;
Nodes.lch=loc;
loc=FindMin(i);
Nodes.count;
Nodes.parent=i;
Nodes.rch=loc;
}
Nodes.parent=-1;
}
int FindMin(int curlen)//找没有父结点,且Count最小的节点
{
int loc=curlen-1;//找不到,返回最后一个,最后一个不在查找范围
for(int i=0;i《curlen;i++)
{
if(Nodes.count)
{
if(Nodes.parent==-1)
loc=i;
}
}
return loc;
}
void huffCoding()//根据树来编码
{
int Pid,t;//Parent id
for(int i=0;i《NodesNum;i++)
{
t=i;
while(Nodes.parent!=-1)
{
Pid=Nodes.parent;
if(Nodes.lch==t) //置左分支编码0
{ //函数原型:void *memmove( void *dest, const void *src, size_t count );
memmove(Nodes.bits)+1);
Nodes=’0’;
}
else //置右分支编码1
{
memmove(Nodes.bits)+1);
Nodes=’1’;
}
t=Pid;
}
}
}
//降序
void sortByCount()
{
Node tempNode;
for(int i=0;i《MaxNodes;i++)
for(int j=MaxNodes-1;j》i;j--)
{
if(Nodes.count)
{
tempNode=Nodes;
Nodes;
Nodes=tempNode;
}
}
for(i=0;i《MaxNodes;i++) if(Nodes.count==0) break;
NodesNum=i;//关键得出有效叶子结点个数NodesNum
}
VC++6.0问题:下载源代码存在E盘,双击其.dsw文件打开问题,
visual sourcesoft 是微软为中小型软件项目开发而提供的一个版本管理工具。
大家简称为VSS ,你就知道这个软件是管理代码的就可以了。
说明白点,就是C/S结构,把代码放到服务器上,多个客户机都可同时用检出代码,最后把每个人修改的代码再融合在一起,形成完整的代码,这样方便管理代码。
你现在的问题是你这个程序应该是以前在服务器上检出的程序,所以打开时会提示visual sourcesoft login对话框

更多文章:
Windows批处理命令和使用教程(几个简单的Bat批处理)?怎么批处理文件名
2025年9月16日 07:45
windowsinstaller下载(如何下载Windows Installer Clean Up)
2025年6月24日 21:45
spring festival简笔画(春节怎么画简单又漂亮 二年级)
2026年8月27日 12:00
filesystemobject同时读写(ASP 读取txt 然后累加在写入txt)
2025年11月11日 23:45
marble columns什么意思(matlab里面 column 1 through 3 什么意思)
2026年3月17日 04:30
select按钮什么意思(2ds按键start和select是干什么的)
2025年7月22日 07:45
默克尔: 那时的乌克兰可不是今天(默克尔这番话,武契奇:“颠覆认知”)
2026年7月16日 15:00
datetime数据类型使用几个字符来表示日期和时间(日期的表示方法有几种)
2026年8月24日 22:45
img格式照片画质(img大小怎么设置可以适应不同分辨率的excell)
2025年11月19日 19:00
performclick翻译(帮我把下列英语翻译成中文,急用!)
2026年7月26日 15:00
substring只有一个参数(jquery的substring 怎么使用)
2025年5月26日 11:00
jqc遇到u头上两点要去掉(为什么j q x后加:ü时要去掉两点)
2025年11月16日 12:45
pipeline platform(JDK 7确定B计划 部分特性延迟到JDK 8)
2025年6月13日 18:15










