query about dev c++-running programs - ide

Can anybody tell me how I can paste text input into the Dev-C++ console (command line shell) while running a program in Dev-C++?
Also is there any other simple IDE which allows users to work with a single source file w/o creating a project?

af far as i can remember dev-cpp start a windows commadline window when a consol application is started. so if you have somethig like
cout << "enter a char: ";
cin >> c;
in your code, the consol window will be wating for input.
an to your second question: Yes and No
Yes: you can use g++.exe (witch comes with dev-cpp) and notepade.exe (witch comses with windows)
and compile your source using commad g++.exe source.cpp and run you application by typing a.exe in a console window witch you have to open yourself and navigate to the directory where source.cpp is located.
No: (g++.exe + notepade.exe) == IDE
Note that you have to extend the PATH envirenment variable to be able to use g++.exe without fullpath to it

Related

Call Command from Mupen64Plus dll using RUNDLL32 through Command Prompt

I'm using the Nintendo 64 emulator, Mupen64Plus.
It has a file called mupen64plus-ui-console.exe used to launch games through command-line. It also accepts keyboard shortcuts to perform commands, but it is limited.
Mupen64Plus Commands/Functions
This wiki page shows a list of all commands that can be called, I think from the mupen64plus.dll.
RUNDLL32
I read how to pass commands to a dll like this:
RUNDLL32.EXE <dllname>,<entrypoint> <optional arguments>
Calling a Command with RUNDLL32
I'm trying to call M64CMD_STATE_LOAD with cmd.exe, to load a save file.
Info from Wiki:
Command Functions Prototype m64p_error CoreDoCommand(m64p_command
Command, int ParamInt, void *ParamPtr)
ParamInt Ignored ParamPtr Pointer to string containing state file path
and name, or NULL
This command will attempt to load a saved state file. If ParamPtr is
not NULL, this function will load a state file from a full pathname
specified by this pointer. Otherwise (ParamPtr is NULL), it will load
from the current slot.
I have the Mupen64Plus emulator running a game. I then open cmd.exe and paste in this line.
RUNDLL32.EXE "C:\Path\To\mupen64plus.dll", CoreDoCommand M64CMD_STATE_LOAD 1 "C:\Path\To\MySave.m64p"
Problem
It accepts the command, I get no errors, but the save file isn't loaded.
Questions
Are the arguments being passed wrong?
Does the mupen64plus.dll not have hooks into the currently running mupen64plus-ui-console.exe?
Is it loading the save file into nothing?
Is it not possible to do it this way?

system library call not working in Intel PIN Fini Function

I want to execute one shell command (gcore $pid) at the end of pin tool.
In order to complete this goal, I try to modify the itrace pin tool and do one simple shell command first. I add one statement system("ls > /tmp/test") at the starting of Fini function. Then compile the pin tool again.
Run the pin tool - itrace:
../../../pin -t obj-intel64/itrace.so -- /bin/ls
But there does not exist file - "/tmp/test".
the libc function system() is not yet implemented in PinCRT.
Please use popen() (which is implemented) instead.
source.

FORTRAN input from mouse

What is the FORTRAN input statement (e.g., READ statement, or OPEN statement) to accept input from a mouse? For example, in Windows explorer, it is possible to right-click on a file and then select a FORTRAN executable from the menu that appears. How do I make such a FORTRAN program capture whatever the mouse sends (e.g., capture the name of the file, or whatever the mouse transmits)? Information out there about FORTRAN input seems restricted to input from a file or the keyboard. I cannot find anything about input from a mouse.
I've made progress on my own and, for those interested, here it is:
Firstly, the "fortran standard" does not directly support input from a mouse. But Windows Explorer can be made to pipe a file name into a fortran executable nevetheless.
Under Windows, the right-click generates the full \path\filename as a command line argument. That information can be captured by a fortran using "get_command_argument", as follows:
PROGRAM get_filename
CHARACTER(len=100) :: arg
CHARACTER(len=2000) :: filename
filename = ''
! NB: spaces in a file name define separate arguments, so re-assemble the file name as it comes in
i = 1
DO
CALL get_command_argument(i, arg)
IF (LEN_TRIM(arg) == 0) EXIT
filename = TRIM(filename)//' '//TRIM(arg) ! putting the spaces back in
i = i+1
END DO
WRITE (*,*) 'file= ',TRIM(filename)
read(*,*)
END PROGRAM
A link to the executable can be placed in the Windows right-click menu, as explained here:
http://www.howtogeek.com/107965/how-to-add-any-application-shortcut-to-windows-explorers-context-menu/
You need to add "%1" to the name of the executable to make it accept command line arguments,
e.g., I called my executable "PW_copy.exe", and so the final registry entry was: \path\PW_copy.exe %1
It works!
Dragging the mouse across several files generates separate threads each with a different file name.

how do you make Scite interactive?

Once I compile with Scite, my command prompt won't show up.
How do I set it up so I can accept inputs and outputs from the command prompt from my program using Scite?
In scite properties file Edit as below:
Change
command.go.*.c=$(FileName)
to
command.go.*.c=start $(FileName)
Pressing go opens the tatget file in new cmd window and is now interactable
Now you can give inputs
If you are using different language replace *.c with corrosponding one and put start before the command.

literal string expected error

Please have a look at the following code
with text_io;
use text_io;
procedure hello is
begin
put_line("hello");
new_line(3);
end hello;
When I click "build all" in GPS IDE, I get this error
gnatmake -d -PC:\Users\yohan\firstprogram.gpr
firstprogram.gpr:1:06: literal string expected
firstprogram.gpr:2:01: "end" expected
gnatmake: "C:\Users\yohan\firstprogram.gpr" processing failed
[2013-04-03 13:29:58] process exited with status 4 (elapsed time: 00.47s)
I am very new to Ada, as you can see, this is my first program. Please help.
On the command line, gnatmake will happily compile a file which contains Ada code but has the extension .gpr. GPS knows "better" than that, and insists on treating myfirstprogram.gpr as a GNAT Project file, which of course it isn't.
You'll find life with GNAT much easier if you stick with its file naming conventions: .ads for a spec, .adb for a body, and the file name needs to be the unit name in lower case. In your case, the file should have been called hello.adb.
The simplest approach to creating a GNAT project file in GPS is to go to the Project menu and select New. The only places where you must enter data are on the "Naming the project" page (you might choose firstproject!) and the "Main files" page, where you'd click on the blue + to add hello.adb; you can Forward through the others.
After adding the main file, you can click Apply to install the new project file; now you can Build all and Run.
You may find the GPS tutorial helpful (Help menu, GPS ...)