|
Create a new resource file (File/New...) and add it to your project like you would any other source file. Then you can add an icon to the resource file. I haven't used VC++5, but it shouldn't be too difficult.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
I am using the following structure in a console app (C++)
***********************************
SHELLEXECUTEINFO ShExecInfo = {0};
ShExecInfo.cbSize = sizeof(SHELLEXECUTEINFO);
ShExecInfo.fMask = SEE_MASK_NOCLOSEPROCESS;
ShExecInfo.hwnd = NULL;
ShExecInfo.lpVerb = NULL;
ShExecInfo.lpFile = "c:\\MyProgram.exe";
ShExecInfo.lpParameters = "";
ShExecInfo.lpDirectory = NULL;
ShExecInfo.nShow = SW_SHOW;
ShExecInfo.hInstApp = NULL;
ShellExecuteEx(&ShExecInfo);
WaitForSingleObject(ShExecInfo.hProcess,INFINITE);
***************************************************
It works great the only problem is that MyProgram.exe (creates bunch of files)takes a long time and it is hard to tell if it completed or not, I have to keep looking at the folder to see if all files are there. How can I display a dialog windows "This process will take few minutes, plese wait" when is completed?
|
|
|
|
|
It's a console app - why don't you output 'please wait for this process to end', and then after waiting for the process to end, put up a message to report you are done ?
In a Windows app, I just create a modeless dialog, and pull it down when the process returns.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I would do the launching of the external application in a background thread so that you can continue to pump messages, and create a modeless (non-modal) window with the "Please Stand By..." message. You would then wait for that background thread to exit (with an appropriate sane timeout, of course).
Peace!
-=- James If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Tip for new SUV drivers: Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! DeleteFXPFiles & CheckFavorites (Please rate this post!)
|
|
|
|
|
when we execute the visual c++(not .net) then a folder is made named debug and exe is present in that. somebody told me there is anothe way to make the exe present in the release folder i want to know through which option that folder and exe is made in that folder which is compatiblw with win32.
ddd
|
|
|
|
|
If you have no exe in the release folder, you've not built a release version. You must not give anyone your debug version. I assume from your .NET comment that you're using a .NET compatible compiler. Go to build/configuration settings and change the setting to release. Not per project, the one at the top. From memory, that option was somewhere else in VC6, but the same principle applies.
The folder is irrelevant, you can have them build where ever you want. But a release build is the optimised build, linking to release libraries and having no debug dependancies or behaviour.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
What is actually your question?
Is it "how to set the project configuration to release mode?"
If thats your question,go to build->Set Active Configuration and choose
the Release option.
if thats not your question,well - i don't understand your question
Regards,
Eli.
|
|
|
|
|
yes my question was exactaly that how to make the release folder which had been made through option u had mentioned, but if i have static linked libraries will it work for that also.
ddd
|
|
|
|
|
i think you must add the DLL.dll,DLL.lib and DLL.exp in your's Project directory.
Regards,
Eli
|
|
|
|
|
Hello everyone:
Nowadays,i want to make a formview,which can popup and fit the client area when a message is sent. howerver, i don't know how to create it use a function like DoModal() of modal dialog .
i am sooooo confused now.is there anyone who can help me?anything will be appreciated ,especially some samples or articles.thankx in advance
|
|
|
|
|
A formview is a full client window project, it will get started when you run the project. You want a formview as a child window of an existing view ? Why ? Do you need toolbars or something else that a dialog can't offer you ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
i have create a formview inherited from CDialog,and i use myFormView.DoModal()to create it.however,the dialog can'tbe a full client window and the controls on it can't be used either.what can i do with that , sir?
thanks in advance!
|
|
|
|
|
I don't believe you're supposed to call DoModal on a FormView, it's meant to be a view, not a dialog. Create a new project inherited from FormView.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I’m creating a tool with MFC that uses both split views and Property pages (tabbed Dialogs). My problem is this, when a make a change in one view’s property page I want to have it effect what is displayed, without having to press a button, in the other views active property page. I know this can be done but for some reason I’m drawing a complete blank on how to do this.
|
|
|
|
|
I'm going to be modifying an existing Visual C++ GUI. Currently the GUI is one honking big form that fills more than a whole screen and is loaded with separate menus, scroll boxes, displays, etc.
Is there a simple approach to separating out the sub GUIs of a form like this? For example, is there some way to "cut and paste" existing portions of the form, or to breaking out parts of the form to be separate GUIs?
Or am I stuck with recreating new GUIs from scratch?
Thanks for any help.
|
|
|
|
|
I believe that you can drag and select a range of controls in your project, cut, and then paste onto a new form.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hi, there!
Recently I want to build my project from command line.
Below is the example from MSDN Library
msdev MyProject.dsp /MAKE "MyProject – Win32 Debug" /REBUILD
To test I create a simple SDI project test.dsp by using the MFC AppWizard.
Then under the dos command window I type:
msdev test.dsp /MAKE "test – Win32 Debug" /REBUILD
But the msdev response with the following error:
Warning: ignore unkown project: test - Win32 Debug
Error: There is no valid targets to build.
I check the test.dsp file, the content are as follow:
===========================================================
!IF "$(CFG)" == "test - Win32 Release"
.....
!ELSEIF "$(CFG)" == "test - Win32 Debug"
.....
# Begin Target
# Name "test - Win32 Release"
# Name "test - Win32 Debug"
# Begin Group "Source Files"
....
===========================================================
I did see anything missing, it's standard application
generated by the wizard.
Is there anybody know what's wrong with my approach?
Any comment and feedback are greatly appreciated.
Best Regards,
Wayne King
|
|
|
|
|
Are you running this from the command line in the same folder that the test.dsp file is in ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Thanks for your quick response. Yes, I run the command from the same folder that the test.dsp is in. By the way, my OS is Windows 2000 with Service Pack4. I also try it with my Laptop which installed with a WindowsXP, both got the same error.
[Of course, I need to set the proper path for the DOS command to find the MSdev.exe and other compiler tools].
Any further comments?
Regards,
Wayne King
|
|
|
|
|
Yeah, I thought your error message meant it must have found the dsp. I've never done this before, but if I was doing it now, I'd simplify the string that's being checked for ( after making a backup ) and then seeing what happened from there. I'd also look in the IDE to see if it shows you the string that it uses to do a build ( from memory, it does show you that somewhere in the project settings ).
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Check inside the IDE, the string is there.
Thank you very much for your comments. Change the dsp contents won't work. Just try that, it casue the MSdev to crash. But to my surprise, after crash(It just crash the MSdev without affecting the system) I simple close the crash application. Restore my dsp and re-try the command line complie again, it works fine.
I have no idea why It behave like this. I need to try it again on my Laptop see what will happen then.
Best Regards,
Wayne King
|
|
|
|
|
I really need some help to simply move a Unicode filename into an array. The only way I know how to read files is by doing a system call.
Is there some way to just supply a directory like C:\temp and get the filenames into an array in Unicode format?
Please help I've spent countless time looking how to do this.
Thanks
|
|
|
|
|
Look at FindFirstFileW() and FindNextFileW()
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
I had been playing around with FindFirstFileW but couldn't get it work. Here's the code I've dabbled using.
Does anyone have a link or small clip of code including #includes that works?
//THIS CODE DOESN'T WORK
#include "stdafx.h"
#include <iostream>
#include <fstream>
using namespace std;
#define _WIN32_WINNT 0x0501
#include <windows.h>
#include <stdio.h>
int main(int argc, char *argv[])
{
WIN32_FIND_DATAW FindFileData;
LPCWSTR lpFileName = (const unsigned short *) "*";
HANDLE hFind;
ofstream outfile("new.txt");
hFind = FindFirstFileW(lpFileName, &FindFileData);
if (hFind == INVALID_HANDLE_VALUE)
{
printf ("Invalid File Handle. GetLastError reports %d\n",
GetLastError ());
return (0);
}
else
{
printf ("The first file found is %s\n", FindFileData.cFileName);
while (FindNextFileW(hFind, &FindFileData) != 0)
{
printf ("Next file name is %s\n", FindFileData.cFileName);
outfile << FindFileData.cFileName << endl;
}
FindClose(hFind);
return (1);
}
}
|
|
|
|
|
stvprg wrote:
LPCWSTR lpFileName = (const unsigned short *) "*"
That's the problem. You're assigning a non-unicode string constant to a unicode string pointer. You need to use a true unicode string:
LPCWSTR lpFileName = L"*";
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|