|
If may understanding is correct.. , I think you want to create a new file programatically. In order to do this use CreateFile Function.
Regards,
Rane
|
|
|
|
|
Are you trying to build the executable from the command line?
|
|
|
|
|
hi.
you can write specific ?
when you press Control + F5 in VC++6.0 ==> your application will file abc.exe. now I want write file abc.bat and when double click this file ==> made file abc.exe.
I wish you help me. thanks very much
|
|
|
|
|
Ctrl+F5 will run your application (and rebuild if necessary).
I think I know what you are trying to do.
You'll have to create the batch file that builds your "abc.exe":
Solution 1:
1. Export a makefile for your project (Project -> Export Makefile)
2. Create the batch file, example (where "MyProject" is the name of your project):
set PROJECT=MyProject
@NMAKE /F %PROJECT%.mak /NOLOGO CFG="%PROJECT% - Win32 Release"
Solution 2:
With VC6, you can build from the command line like this:
Create the batch file, example (where "MyProject" is the name of your project):
set PROJECT=MyProject
msdev.com %PROJECT%.dsp /MAKE "%PROJECT% - Win32 Release"
or
set PROJECT=MyProject
msdev.com %PROJECT%.dsw /MAKE "%PROJECT% - Win32 Release"
Obviously, all this requires that your environment variables for compiler, libraries, etc. are properly set.
modified on Wednesday, September 10, 2008 11:16 PM
|
|
|
|
|
That is the first time I work with it, so, could you show me how to work with it step by step?
|
|
|
|
|
phan xuan nguyen wrote: show me how to work with it step by step
That's what I did. What do you not understand?
|
|
|
|
|
can you write specific step by step in source visualc++ when new project by makefile. thanks
|
|
|
|
|
You lost me...
|
|
|
|
|
you guide step by step new project by feature makefile in visualc++6.0. thanks
|
|
|
|
|
Select Export Makefile from the Project menu.
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
Are you trying to confuse the enemy?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
No exactly but its near to reality.
|
|
|
|
|
phan xuan nguyen wrote: e.g : created file abc.bat, when double click this file ==> make file abc.exe
This would require you to use the command-line compiler and linker (CL.EXE and LINK.EXE), from within your ABC.BAT file. Why are you not using a MAKEFILE instead?
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
Please don't shout: some sleeping people here...
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
You don't need VC6. Just copy this into your batch file:
ren abc.bat abc.exe
Phil
The opinions expressed in this post are not necessarily those of the author, especially if you find them impolite, inaccurate or inflammatory.
|
|
|
|
|
If you want to make a new file when you clicked a button you can use of CFile class if you want to compile your project you can use of Ctrl+F5 or maybe you want to make an exe file yourself without any compiler?
|
|
|
|
|
Hi masters!
-----------
I'm coding a system-wide keyboard hook and have a thread with a simple message loop at the end.
I have a DLL file that sends keyboard messages to my EXE using PostThreadMessage().
The problem lies in this that I'm not able to translate keyboard messages using
TranslateMessage() within EXE file! I don't know why, But it returns 0 all time!
Here's a piece of the EXE file:
-------------------------------
MSG msg;
while( GetMessage( &msg, NULL, 0, 0 ) )
{
if(!TranslateMessage(&msg))
.
.
.
Thanks in advance
|
|
|
|
|
It appears the DLL is not sending character messagges to your executable.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Yes it does!
Because I tested it in this way:
if(msg.wParam == WM_KEYDOWN)MessageBox("Something");
After that I received the above message (within MessageBox()) whenever I pressed a key any where!
|
|
|
|
|
Get the extended error information using GetLastError function.
Regards,
Rane
|
|
|
|
|
Usef Marzbani wrote: if(msg.wParam == WM_KEYDOWN)
Huh? Why would WM_KEYDOWN be in msg.wParam?
Is that how you post the message?
That's fine if you do, but TranslateMessage isn't going to understand
that message.
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Is there a way to send signals/messages to a console window? I need control the behavior of a console application from another application.
I'm not sure if signals or messages is what i'm looking for but i wouldn't like to use pipes or shared memory for this simple task
Thanks
|
|
|
|
|
You can redirect it's I/O so that your parent app can read what the child app writes with printf and your parent app can write what the child app receives from scanf. There's a class CRedirector[^] that implements this.
There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition.
Blaise Pascal
|
|
|
|
|
I know but that's exactly what I'm looking for. I'd like the child app to handle messages during its sleep time as it happens with CTRL_C_EVENT if I call SetConsoleCtrlHandler
|
|
|
|
|
Hi all,
I am using VISTA and vc++ (using VS-2008).
In my application I am creating one .bat file using CreateFile function, after creating it I am writing three commands in to this file using WriteFile. Now I am running it by using Shellexecute() function.
The code piece is-
CString csRunCommands = _T("bcdedit /set {bootmgr} device boot > d:\\zzz1.txt");
HANDLE hBatFile = CreateFile(_T("D:\\myBat.bat"),GENERIC_READ | GENERIC_WRITE,FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE,NULL,OPEN_ALWAYS,0,NULL);
WriteFile(hBatFile,csRunCommands,csRunCommands.GetLength()*2,&dwReturnVal,NULL);
CloseHandle(hBatFile);
iReturn = (int)ShellExecute(NULL,_T("Open"),csFilePath,NULL,NULL,SW_SHOWNORMAL);
csRunCommands is a CString variable that contains the commands to be written.
All the code is running without problem. Return value of ShellExecute is 42 ie gretaer than 32 it means file is getting executed.
In the command that I am writing into file I have mention pipe that save the output in to one text file (D:\zzz1.txt). But after executing the code I am not seeing any zzz1.txt file in D:\ drive.
If I make a .bat file manually(say man.bat) and edit that by writing same command and run it as administrator then it is saving the output of command in to this text file as "The Operation completed successfully".
Please suggest me so that I can execute this .bat file by my code.
Thanks
|
|
|
|