|
sorry,
with:
#include <stdio.h>
#include <stdlib.h>
I am so upset to get it right!
yes, win32 checked and sub console too in the linker option too!
Thanks for your very helpful help.
Knowing finally how to deal with C files on Visual C++ would be of the utmost importance!
Best Regards,
Please, feel free to send me any screenshots.....I welcome you!
T.
Switzerland
|
|
|
|
|
thierrypp wrote: May I know how to work with c files on a visual C++ 6.0 IDE?
Two possibilities:
1. You want to keep the project as a c-project, then you need to change the calling convention in your project settings.
2. You do not care about it being c or c++, then simply rename your .c files .cpp and everything will be ok.
Hope this helps
~RaGE();
|
|
|
|
|
thanks for the informations but in fact, the problem remains......
Maybe if someone knows about Lcc-win 32?
Regards
T.
|
|
|
|
|
Thierry,
I approached this in a methodical way. Follow me and you should be OK:
In Visual C++ 6.0 create a new project. Choose Win 32 Console Application, select a simple application.
Delete the lines:
int main(int argc, char* argv[])
{
return 0;
}
Copy the code in. I used one of the examples you supplied.
Compile: get 5 errors, 1 warning. Looking at what the errors were, I deleted the following two lines which are clearly wrong:
#include
#include
The other three errors are about printf, scanf, strcmp not being recognised. I guess that I need to include some files. I moved the cursor on to the word printf and hit the F1 key. Visual C++ 6.0 gave some information on how to use this function. It also said that it needed the include file <stdio.h>. Same for scanf. For strcmp, Visual C++ 6.0 says that I need to include <syting.h>. So I added the next two lines.
#include <stdio.h>
#include <string.h>
Now there is a warning:
warning C4508: 'main' : function should return a value; 'void' return type assumed
Being just a warning, I could have ignored this. But to do the job properly, as I have been told that main() should return a value, I changed the line
main()
to be:
int main()
and to return a value, I added the following line just before the end of the main() function:
return 0;
Et voila! It compiles. And runs. No problemo, as they say. (And by the way, the source file that Visual C++ created is indeed .CPP, not .C)
Shraddhan
|
|
|
|
|
Oops!
The bit biter swallowed some of my text.
Yhe files to be included are stdio.h and string.h
I guess that because these names were included inside angle brackets they got chopped off. That is preumably the reason why they were missing from the code sample you supplied.
Bon chance,
Shraddhan
|
|
|
|
|
I am writing an GUI using MFC. However, I have one problem. After I type in an Edit Control and then press enter, the GUI will be closed. I want the GUI to remain there after I press enter, so how do I disable this function?
Thanks
|
|
|
|
|
first of u need to give a detail ... r u making a edit ctrl on the modal dialog box ... if yes then the model dlg box takes enter as ONOK event .... u need to catch enter in edit box only..... check for some "want return" kind of setting in resource editor
===============================================================
Want return
Specifies that a carriage return be inserted when the user presses the ENTER key while typing text into a multiline edit-box control. If this style is not specified, pressing the ENTER key has the same effect as pressing the dialog box’s default command button. This style has no effect on a single-line edit-box control. Type: Bool. Default: False
===============================================================
if not the dlg box then pls give more detail
|
|
|
|
|
Hi,
There are many ways this is one such way :-
void CTreyDlg::OnOK() <br />
{<br />
int a = ::GetKeyState (VK_RETURN);<br />
if (a & 0x8000)<br />
return ;<br />
CDialog::OnOK();<br />
}
Regards,
FarPointer
|
|
|
|
|
Thanks a lot. I have solved my problem
I really appreciate you guys' help
|
|
|
|
|
Hi,
But i must warn you that if you have tried that code ,then even a focus created through tab( on the OK button ) wont be able to close the application , The best way is to use Pretranslatemessage
please check this link
http://www.flounder.com/messaging.htm[^]
Regards,
FarPointer
|
|
|
|
|
See here.
"The words of God are not like the oak leaf which dies and falls to the earth, but like the pine tree which stays green forever." - Native American Proverb
|
|
|
|
|
Hi ,
In that he says we should remove the CDialog::OnOk(), if thats the case then if the user wants the dialog to be closed on the ok button click how will that happen ,or we should create a new button with a different ID other that IDOK , if thats the case then i feel its too much of work and pretranslate message should be good enough.
Regards,
FarPointer
|
|
|
|
|
FarPointer wrote: In that he says we should remove the CDialog::OnOk(),
I think it's given to handle OnOk. So precisely it must do that. What we can do is that we can give a MessageBox prompting the user if he wants to close the dialog or not.
Jesus Loves <marquee direction="up" height="40" scrolldelay="1" step="1" scrollamount="1" style="background:#aabbcc;border-bottom:thin solid 1px #6699cc">
--Owner Drawn
--Nothing special
--Defeat is temporary but surrender is permanent
--Never say quits
--Jesus is Lord
|
|
|
|
|
Hi
Does anybody know a viewer tool to see and extract the files from a setup.exe file generated by ISE 2.2 ?
Thank's for your help
Jérôme
|
|
|
|
|
I downloaded a program that simulates a UNIVAC computer and I wrote some code for it in C++ and I tried loading it as a servo. Can someone post the Assembly source code I should put in the univactest2.cpp and the univactest2.obj files. THE .CPP FILE SHOULD BE TRANSLATED INTO A .ASM FILE.
--------------------------
Eric
I still need to learn C++!
--------------------------
|
|
|
|
|
NO.
but less seriously, I don't understand what you are trying to do ? I assume the simulator reads some sort of UNIVAC language, and me think it's not x86 assembly; and more important, if it's a real UNIVAC simulator, I think it would be very hard to do C++ on it, even if could translate the C++ language to UNIVAC language it would be SOOO big that it would be useless.
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
I honestly have no idea what you are talking about. Please give some hints so that we can help you.
Tuotrut wrote: I downloaded a program that simulates a UNIVAC computer
Where did you download it from ?
Tuotrut wrote: I tried loading it as a servo
What is a servo ?
Tuotrut wrote: the Assembly source code I should put in the univactest2.cpp and the univactest2.obj files
Which assembly code ? For what purposes ? for which plateform ? What yre the files you are talking about ? Are you aware that a .obj is already compiled and that you usually do not edit it per hand ?
Tuotrut wrote: THE .CPP FILE SHOULD BE TRANSLATED INTO A .ASM FILE.
Which cpp file ? I think that you can rename a file extension by yourself, don't you ?
~RaGE();
|
|
|
|
|
Rage wrote: Where did you download it from ?
I downloaded it from Simtel.net.
Rage wrote: What is a servo ?
I don't realy know. It's probaly some UNIVAC command that fell off the face of the earth.
Rage wrote: Which assembly code ? For what purposes ? for which plateform ? What yre the files you are talking about ? Are you aware that a .obj is already compiled and that you usually do not edit it per hand ?
Standard assembly code, standard purposes, Intel, I just want it translated from C++ to Standard Assembly, I don't want you to edit the .obj file by hand but I want you to translate it into assembly and compile it in an Assembly compiler that will create a .obj file, and I can tell you where to get an assembly compiler to.
Rage wrote: Which cpp file ? I think that you can rename a file extension by yourself, don't you ?
Of course I can but I want some one who knows Assembly and C++ to translate it from C++ into Assembly and then post it on the the fourms under this topic and about the C++ file, I will post it when someone wants to trasnslate it for me.
--------------------------
Eric
I still need to learn C++!
--------------------------
|
|
|
|
|
If you don't know exactly what you are writing about, imagine us trying to figure out want you want to do, please explain what you really want to do.
I don't think that you can "mecanically" generate a textual assembly listing for a C++ file, and I would think that it would take at least thousands of line of assembly to do simple stuff; and will be intelligible.
why do you want to have an assembly listing ? for educational purpose ? to use it in your UNIVAC simulator ? if so, it will not work; it's a different instruction set.
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
Can someone give me a listing or guide of Assembly Commands?
--------------------------
Eric
I still need to learn C++!
--------------------------
|
|
|
|
|
|
There is a switch in VC that will output intel assmbly code. I have no Idea how this will help you with a UNIVAC which I know will not use Intel assembly but the switch is in the project settings. I would tell you the switch location but this depends on your version of VC.
John
|
|
|
|
|
I want it for educational purpose and to use it in my UNIVAC simulator. Sorry about the other message I accidently posted the other message, but I still want you to read it.
--------------------------
Eric
I still need to learn C++!
--------------------------
|
|
|
|
|
|