请教如何在vc6.0中将一个控制台的应用程序加一个图标进去? 问题如上,源程序是一个控制台的应用程序,现在要求修改一下exe文件的图标.或者使用mfc将原来的那个应用程序的代码插入,又不知道插到什么地方.请高手大侠们 不吝赐教. 谢谢 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 你可以在MFC程序里面加控制台#include <fcntl.h>#include <io.h>#include <stdio.h>……AllocConsole();int hCrt;FILE *hf;hCrt = _open_osfhandle( (intptr_t)GetStdHandle(STD_OUTPUT_HANDLE), _O_TEXT );hf = _fdopen( hCrt, "w" );*stdout = *hf;int i = setvbuf( stdout, NULL, _IONBF, 0 ); printf( "Hello World\n" );#include <fcntl.h>#include <io.h>#include <stdio.h>AllocConsole();int hCrt;FILE *hf;hCrt = _open_osfhandle( (intptr_t)GetStdHandle(STD_OUTPUT_HANDLE), _O_TEXT );hf = _fdopen( hCrt, "w" );*stdout = *hf;int i = setvbuf( stdout, NULL, _IONBF, 0 ); printf( "Hello World\n" );#include <fcntl.h>#include <io.h>#include <stdio.h>AllocConsole();int hCrt;FILE *hf;hCrt = _open_osfhandle( (intptr_t)GetStdHandle(STD_OUTPUT_HANDLE), _O_TEXT );hf = _fdopen( hCrt, "w" );*stdout = *hf;int i = setvbuf( stdout, NULL, _IONBF, 0 ); printf( "Hello World\n" );#include <fcntl.h>#include <io.h>#include <stdio.h>AllocConsole();int hCrt;FILE *hf;hCrt = _open_osfhandle( (intptr_t)GetStdHandle(STD_OUTPUT_HANDLE), _O_TEXT );hf = _fdopen( hCrt, "w" );*stdout = *hf;int i = setvbuf( stdout, NULL, _IONBF, 0 ); printf( "Hello World\n" );原文由David Lowndes 发布在microsoft.public.vc.mfc HINSTANCE hInst = LoadLibrary("b.exe"); HRSRC hRc = FindResource(hInst, (LPCSTR)1, (LPCSTR)RT_ICON); LPVOID lpResource = LockResource(LoadResource(hInst,hRc)); HANDLE hUpdate = BeginUpdateResource("a.exe", FALSE); UpdateResource(hUpdate, (LPCSTR)RT_ICON, (LPCSTR)1, 0, lpResource, SizeofResource(hInst, hRc)); EndUpdateResource(hUpdate, FALSE); CloseHandle(hRc); FreeLibrary(hInst); ::MessageBox(0, "Resource updated.", "Test 2", MB_OK); 我用MFC在主构造函数里面插入了那段代码 然后用exit(0)退出,然后替换掉默认的那个图标文件.已经可以实现功能了.但是,现在的问题是: 我不知道如何使用vc6.0里面的程序打包工具installshield因为在没有vc6.0的ide开发环境的电脑上,点击exe文件后,老是提示说:mfc42d.dll和另外一个dll文件找不到.请问有什么快捷的办法? 和Win32APP一样加,很基本的知识,上面的人说得太远了http://spaces.msn.com/members/UMU625/ readString读取文件 我的自传 关于sdk数据库编程 如何得到WORD,EXCEL...等其它软件的菜单.然后禁用.谢 ado问题,请大家看看 开平方用什么函数? 三年了,第一次跳槽找工作,明天去面试。大家给点意见,支持一下。分不多,只有60分了。 运用DnsQuery函数编好程序,在Win98下运行,提示如下: 200分寻求 《网络监视器》的源码,或同类型的比较优秀的代码。 在NT中注册Atl控件return LoadLibary Error ! 0x00000007e 请教打开一个蓝牙串口的问题 关于远程线程的问题 郁闷。。。
#include <fcntl.h>
#include <io.h>
#include <stdio.h>……
AllocConsole();
int hCrt;
FILE *hf;
hCrt = _open_osfhandle( (intptr_t)
GetStdHandle(STD_OUTPUT_HANDLE), _O_TEXT );
hf = _fdopen( hCrt, "w" );
*stdout = *hf;
int i = setvbuf( stdout, NULL, _IONBF, 0 ); printf( "Hello World\n" );
#include <fcntl.h>
#include <io.h>
#include <stdio.h>AllocConsole();int hCrt;
FILE *hf;hCrt = _open_osfhandle( (intptr_t)
GetStdHandle(STD_OUTPUT_HANDLE), _O_TEXT );
hf = _fdopen( hCrt, "w" );
*stdout = *hf;
int i = setvbuf( stdout, NULL, _IONBF, 0 ); printf( "Hello World\n" );
#include <fcntl.h>
#include <io.h>
#include <stdio.h>AllocConsole();int hCrt;
FILE *hf;hCrt = _open_osfhandle( (intptr_t)
GetStdHandle(STD_OUTPUT_HANDLE), _O_TEXT );
hf = _fdopen( hCrt, "w" );
*stdout = *hf;
int i = setvbuf( stdout, NULL, _IONBF, 0 ); printf( "Hello World\n" );
#include <fcntl.h>
#include <io.h>
#include <stdio.h>AllocConsole();int hCrt;
FILE *hf;hCrt = _open_osfhandle( (intptr_t)
GetStdHandle(STD_OUTPUT_HANDLE), _O_TEXT );
hf = _fdopen( hCrt, "w" );
*stdout = *hf;
int i = setvbuf( stdout, NULL, _IONBF, 0 ); printf( "Hello World\n" );原文由David Lowndes 发布在microsoft.public.vc.mfc
HRSRC hRc = FindResource(hInst, (LPCSTR)1, (LPCSTR)RT_ICON);
LPVOID lpResource = LockResource(LoadResource(hInst,hRc)); HANDLE hUpdate = BeginUpdateResource("a.exe", FALSE);
UpdateResource(hUpdate, (LPCSTR)RT_ICON, (LPCSTR)1, 0, lpResource, SizeofResource(hInst, hRc));
EndUpdateResource(hUpdate, FALSE); CloseHandle(hRc);
FreeLibrary(hInst); ::MessageBox(0, "Resource updated.", "Test 2", MB_OK);
然后替换掉默认的那个图标文件.已经可以实现功能了.
但是,现在的问题是: 我不知道如何使用vc6.0里面的程序打包工具
installshield
因为在没有vc6.0的ide开发环境的电脑上,点击exe文件后,老是提示说:
mfc42d.dll和另外一个dll文件找不到.
请问有什么快捷的办法?
http://spaces.msn.com/members/UMU625/