WolfPack 491 Posting Virtuoso Team Colleague

If you want to add new options, you can use the edit box in the Linker-Command Line dialog box.
If you want to change the existing options, they can be changed through the other linker options.
For e.g the /PDB:"Debug/CPP_Console.pdb" part of the linker command line can be changed at the Linker->Program Database File Creation field.

WolfPack 491 Posting Virtuoso Team Colleague

Wolfpack
I can not use my own head.
U pointed out me the step of running api-example.c.
Why that step can not be used for constituent-example.c?

Add this line

#include "link-includes.h"

at the top of the file constituent-example.c and try again.

Edit: I got a heap error while using the cl /EHsc command. So if you also get it, just type cl without the /EHsc part

eg. cl *.c /I..\include

WolfPack 491 Posting Virtuoso Team Colleague

Nothing is wrong with your code. It compiles fine in my Visual Studio 2002 compiler.
Anyway the following change is needed.

CloseHandle(ProcessInfo.hThread);
	CloseHandle(ProcessInfo.hProcess);

Maybe the error is not in the code you posted.

This is the code I tested it in

#include <windows.h>
#include <iostream>

int main()
{
char IpApplicationName[1000];
					STARTUPINFO StartInfo;
					PROCESS_INFORMATION ProcessInfo;
					strcpy(IpApplicationName, "c:\\windows\\system32\\calc.exe");
					ZeroMemory(&StartInfo, sizeof(StartInfo));
					StartInfo.cb = sizeof(StartInfo);
						if (!CreateProcess(IpApplicationName, NULL, NULL, NULL, FALSE,
						HIGH_PRIORITY_CLASS | CREATE_NEW_CONSOLE, NULL, NULL, 
						&StartInfo, &ProcessInfo))
					
						std::cout<<("===Closing  the copy File Process, continue>===\n\n");	//WaitForSingleObject( ProcessInfo.hProcess, INFINITE );

    // Close process and thread handles. 

	CloseHandle(ProcessInfo.hThread);
	CloseHandle(ProcessInfo.hProcess);
}
WolfPack 491 Posting Virtuoso Team Colleague

Ha ha I sorrie, you're right wolfy wolfy.

You missed my hidden messages. I looooooooooove you really man!

God bless.

You and your hidden messages:cheesy:

WolfPack 491 Posting Virtuoso Team Colleague

>Hah. That doesnt change the font size in the text file. Because the text file does not have a font size. You are only changing the font size of the viewer program.

Oh wow, let's all be pedantic!

That is just running away without an explaination, and off topic, and maybe just serves to increase youarethwee's :rolleyes: post count.

WolfPack 491 Posting Virtuoso Team Colleague

>You can't change the font size written in to the text file

Of course you can, not from the c program of course, but you do so from notepad directly. It's just that the entire file will be that size. I think that's all he wants. Just for it to fit into an A4 sheet or something so he can print it off from the printer?

Hah. That doesnt change the font size in the text file. Because the text file does not have a font size. You are only changing the font size of the viewer program. What you are saying is like, looking at a paper through a magnifying glass and saying that the font size of the paper has got bigger.

>I guess no further explaination is needed required for the OP's initial requirement.

Maybe you can understand gibberish kiddo... :rolleyes:

Maybe you can't understand the answers given to your own questions.

WolfPack 491 Posting Virtuoso Team Colleague

I guess no further explaination is needed required for the OP's initial requirement.
He needs to
1. Print the results to a text file
2. Change the font size that is written in to the text file.

Astronox's answer is the most complete regarding these requirements.
You cant change the font size written in to the text file, because NO font formatting information, like Bold, italic, underline can be stored in the text file. A text file stores only the text information. Not the glyph information. The only formatting possible are the ones done with newlines, tabs ... So a big NO YOU CAN'T DO THAT will do.

WolfPack 491 Posting Virtuoso Team Colleague

That type of reply is excatly what im talking about :)

At least his reply made some sense. If you think that a newbie is ready to incorporate dlls that shows how inexperienced you are in guiding someone in programming. Ancient Dragon was not saying to RTFM, a newbie of the OPs level wouldn't understand to RTFM. Dragon was advising him to learn to walk before trying to run, which I believe is very good advice compared to yours.

WolfPack 491 Posting Virtuoso Team Colleague

Try something like this.

INITCOMMONCONTROLSEX InitCtrlEx;
InitCtrlEx.dwSize = sizeof(INITCOMMONCONTROLSEX);
InitCtrlEx.dwICC  = ICC_PROGRESS_CLASS; // This depends on the control you are tryinn to initialize
InitCommonControlsEx(&InitCtrlEx);
WolfPack 491 Posting Virtuoso Team Colleague

Use your own head and attempt to figure it out yourself. Use your head for something other than a hat rack.

Good call man. I had given up answering these questions.

WolfPack 491 Posting Virtuoso Team Colleague

When you have more than one program in one directory, you usually don't want to always use the executable name a.out. You can pass the -o option to g++ to specify the output file:

$ cat > randword.cpp
#include <iostream>
#include <cstdlib>
#include <ctime>

using std::cout;

int main(void) {
    srand(time(0));

    cout << (rand() % 2 ? "yes" : "no") << std::endl;

    return 0;
}

$ g++ randword.cpp -o randword

$ ./randword
yes
$ ./randword
no
$

To enable many warnings, use the following g++ command line:

$ g++ -W -Wall -ansi -pedantic -O2 hello.cpp -o hello

The above is correct, but better not to overwhelm a newbie with complex compiler switches like that IMHO.

WolfPack 491 Posting Virtuoso Team Colleague

where is it located , the compiler in the Fedora System .... i cant find it

I dont know where it is located. Maybe in the usr/bin directory. No way of checking since I dont have Linux installed.

Anyway the location is not that important. Usually if you install Fedora as "workstation" then g++ is installed by default.

set up a convenient data directory in which to place your programs. Create a file named temp.cpp with this content:

#include <iostream>
int main()
{
	std::cout << "Hello World!" << std::endl;
	return 0;
}

Move to the directory in which temp.cpp is located, and type this:

g++ temp.cpp

If you have not made any errors, the program will compile uneventfully, and a program file named a.out will be created in the same directory.

To execute your program, type ./a.out and press Enter. The program should run, and print Hello world! on the display.

This series of actions confirms that you have the g++ compiler and it is working properly.


[EDIT]
Typing g++ -v will give you the version of g++ if it is installed.

WolfPack 491 Posting Virtuoso Team Colleague

Hello :-)

I have installed Fedora Core 4 and we learn in college C++ .
where can i find a C++ author and compiler for Fedora Core 4?

Thank you

C++ Author : I dont know what you mean by this.
compiler : Fedora Core 4 comes with the g++ compiler which can Compile C++ programs

WolfPack 491 Posting Virtuoso Team Colleague

Change the

void shutdownDirectSound(void)
{
...
}

function in the dsmanager.cpp file to

void dsmanager::shutdownDirectSound(void)
{
...
}

Similar for the other functions.

WolfPack 491 Posting Virtuoso Team Colleague

There are two other files: dsutil.h and dsutil.cpp that are not included in the project. Dont you need them?

WolfPack 491 Posting Virtuoso Team Colleague

Don't be tricked into doing his homework 4 him. Tee he he, unless u feel the need to. :-)

:cheesy: Not a chance. I just did it so that I could learn something.expecting that if I gave the wrong answer someone will correct me and give reasons.

WolfPack 491 Posting Virtuoso Team Colleague

Intuitively my answer will be O(N^2). Will look for a way to prove it( if that is correct).
Edit.
Hey. I just had a look at your first piece of code. What is the difference?

The loops are the same. The only difference is that the first one does nothing and the other adds and outputs the two counters. I dont think that will affect the O notation. Both pieces should have the same O notation.

WolfPack 491 Posting Virtuoso Team Colleague

Zip your code without the debug and release folders and attach here. That will help in figuring things out.

WolfPack 491 Posting Virtuoso Team Colleague

It is a project management file used in the Visual Studio Development Environment. You can group mulitple source files to a single project file to make compiling and maintaining the project easier. I dont think you can use it with the Visual Studio 2003 Command line toolkit. You should have the Visual Studio Development Environment ( Like Visual Studio 6 or Visual Studio .NET ) for that.

Edit.
Where is your hostel?

WolfPack 491 Posting Virtuoso Team Colleague
///////////////// Add these lines
#ifndef WIN32
#define WIN32
#endif
////////////////////////////////////////////
#ifndef _LINKINCLUDESH_
#define _LINKINCLUDESH_

What is the meaning of that line and why we need to use that?

Those are called preprocessor switches. It defines a constant called WIN32. Because the program was designed to compile in Sun, Linux, Windows environment, some way was needed to tell the preprocessor what to do in each environment.

If you look at resource.c file you can see this code.

#if !defined(WIN32)
   #include <sys/time.h>
   #include <sys/resource.h>
#endif

#if defined(__linux__)
/* based on reading the man page for getrusage on linux, I inferred that
   I needed to include this.  However it doesn't seem to be necessary */
   #include <unistd.h>
#endif

#if defined(__hpux__)
  #include <sys/syscall.h>
  int syscall(int, int, struct rusage *rusage);  /* can't find
						    the prototype for this */
  #define getrusage(a, b)  syscall(SYS_GETRUSAGE, (a), (b))
#endif /* __hpux__ */

#if defined(__sun__)
int getrusage(int who, struct rusage *rusage);
/* Declaration missing from sys/resource.h in sun operating systems (?) */
#endif /* __sun__ */

Because we defined the constant called WIN32, the

#include <sys/time.h>
   #include <sys/resource.h>

part and the other part will not be compiled. It needs to be compiled in a non-windows environment.

the #if defined(__sun__) part means do this in a Sun environment.

the #if defined(__linux__) part means do this in a Linux environment. so on and so forth.

If you were using the Visual Studio Project files to compile the program the lines

#ifndef WIN32
#define WIN32
#endif
…
WolfPack 491 Posting Virtuoso Team Colleague

I'm a new user to Visual Studio .Net, writing most of my projects in C++. I have this problem with the OO paradigm when I tried to apply it to my projects. Variables for classes which I described in eg. dXmanager.h fails to appear in my dXmanager.cpp; when I try to compiled them it just say that variable ABC is not found in dXmanager.cpp even though I have declared it in the classes in dXmanager.h. I ended up having to declare them again in dXmanager.cpp.

Have you included the header file in the source file? like

#include "dxmanager.h

Secondly after I have built all the files which I needed, compiling them individually is fine with no errors. But when I tried building the whole solution there seem to be problems linking functions in my classes (in dXmanager.cpp) to the main windows program (in winmain.cpp). I kept getting the error LNK 2019 unresolved external symbol "<classname>::<functionname>" referenced in <file_name|function_name>. Is there something which I am missing here? Something which I must do to enable linking between the classes files with their header files and these classes files with the main program file?

Looks like you haven't added the necessary files to your project file. Can you see your files in the Solution Explorer Window of .NET?

WolfPack 491 Posting Virtuoso Team Colleague

Out of curiosity, what made you name this thread after one of the members here :?:

WolfPack 491 Posting Virtuoso Team Colleague

If I were you I'd google for "Speech Recognition in C/C++" or something like that and see what comes up.

WolfPack 491 Posting Virtuoso Team Colleague

Ancient Dragon & WolfPack
I tried out the steps you pointed out and the api-example program runs beautifully. I used visual C++ 2003.

good

But I would like to test it in C ( not in vc).

C is a language. The program is written in C. VC, BCC, TC are compilers. You have used the VC compiler to test the program. It is the same for other compilers also, only the commands used to compile are different.

To tell you frankly, my first target is to test it in Java.
There is also Java LGinterface. But I don't know how to use it and move to C.

Neither do I.

Have you ever met an intelligent student like me?

No

By the way, how do you choose your nickname?

Same as you did.

WolfPack 491 Posting Virtuoso Team Colleague

Usually only the files would be enough.

WolfPack 491 Posting Virtuoso Team Colleague

I am not from Japan.

Japan is not a developing country. Now where are you from?

WolfPack 491 Posting Virtuoso Team Colleague

I tried using bcc. It gave me a headache. You have two options.
1. Download the Visual C++ 2003 Command Line tools here and try my method. It is about 32 MB and free.
2. Wait till someone who knows Borland to convert the Visual C++ compiling commands to bcc.

by the way, I really want to know where you are from. :-|

WolfPack 491 Posting Virtuoso Team Colleague

Ancient Dragon & wolfPack
Thank you for your reply. But I have not got that.

You have not got what? Just try out the steps I pointed out and see what happens? If you dont know how to compile in bcc, look at the borland c website. They should have some examples on compiling in bcc55.

WolfPack 491 Posting Virtuoso Team Colleague

That is right, it has to open any picture file like *.bmp.

If this means "yes. it has to open the file in mspaint", a quick, easy, but dirty way is to use

int main()
{
	system("mspaint filename.bmp");// filename.bmp is the image file name
	return 0;
}

in windows.

WolfPack 491 Posting Virtuoso Team Colleague

Try using

int option;
WolfPack 491 Posting Virtuoso Team Colleague

Remove the files you copied into the bcc5/bin and include directories and try following steps below. I used the Visual Studio Command line so the compiling commands in bcc may be different.

1. Extract all the files to any directory you want. I used a directory called lnk41b so the directory tree was like this.

lnk41b
├─data
│  └─words
├─Debug
├─include
├─Release
└─src

2. open the link-includes.h file and add the following lines and save.

///////////////// Add these lines
#ifndef WIN32
#define WIN32
#endif
////////////////////////////////////////////
#ifndef _LINKINCLUDESH_
#define _LINKINCLUDESH_

3. move the following files in the src directory to another directory. Dont delete them you will need them later.

api-example.c
constituent-example.c
www-parse.c

4. Go to the src directory in the command-prompt and compile the remaining files in the src folder as folllows.

src> cl /EHsc *.c /I ..\include

5. move the api-example.c file back into the src directory.
6. delete the parse.obj file in the src directory.
7. compile the api-example.c file as follows.

src> cl /EHsc api-example.c /I ..\include /link *.obj

8. Copy the contents of the data directory to the src directory.
9. run the api-example.exe file in the command-prompt.

src> api-example.exe

I am from a developing country

where are you from? :cheesy:

WolfPack 491 Posting Virtuoso Team Colleague

Can someone please help.

Recently after my brother has been using the computer and entering BIOS settings, my computer will not boot correctly. The power on light is green and everything seems on, but nothing will come up on the screen.

I think, possibly that my brother has changed the CPU frequency in BIOS settings. Does someone know how to reset the BIOS settings to default. I cannot turn on the computer to press any keys, although I have tried many times.

If you can help please reply!

Thanks for your help, if you can.

You can try removing the CMOS battery and reinserting it. Worked for me yesterday.

WolfPack 491 Posting Virtuoso Team Colleague

Okay got over the problem. Just removed the CMOS battery and reinserted it. Had to set the BIOS settings from the beginning, but anyway it is now working. :cheesy:

WolfPack 491 Posting Virtuoso Team Colleague

In a moment of folly I disabled the shared video memory of my computer at the BIOS settings. :o Now I can't see anything. How can I restore the original values?

WolfPack 491 Posting Virtuoso Team Colleague

Dono why I said it was recursive...I guess I had that concept stuck in my head because it reuses a previous answer to generate the next multiple.

Also I tested it, for example 5! is 120, and the program generates 120 as an answer.

Out of curriosity, how are factorals applied? I've never had to use them out side of math class, and we where never given any real world applications for them.

here

WolfPack 491 Posting Virtuoso Team Colleague

For your information there is nothing recursive about this piece of code. Anyway did you run this and check the results? For example what is the output for input 5?

WolfPack 491 Posting Virtuoso Team Colleague

Giving you the solution is easier than trying to understand what you are saying.

#include<iostream>
using namespace std;
int main()
{[INDENT]char a;
cout<<"Enter either number or character to check it's availability "<<endl;
cin>>a;
if( (  'a' <= a && a <= 'z' ) ||( 'A' <= a && a <= 'Z' )|| ( '0' <= a && a <= '9' ) )
{
[INDENT]cout<<"It's valid"<<endl;[/INDENT]
}
return 0;[/INDENT]}
WolfPack 491 Posting Virtuoso Team Colleague

Get the input as a char and then try validating it's ascii code.

WolfPack 491 Posting Virtuoso Team Colleague

I am sorry but I do not see a edit button.
I have gotten it to work but the RC file still doesn't work. So a white screen loads but no snowflakes appear.
C:\Program Files\Microsoft Visual Studio\HomeWork\GameEngine\Blizzard.rc (5): error RC2135 : file not found: Res\Blizzard.ico
C:\Program Files\Microsoft Visual Studio\HomeWork\GameEngine\Blizzard.rc (6): error RC2135 : file not found: Res\Blizzard_sm.ico

What should I have them as to work?

It means that you haven't got the icon files, Blizzard.ico and Blizzard_sm.ico in the resource directory. Since you said that you got this code from a book, most probably the book gives you only the executable code, but not the icon files. Maybe you can find those files in the CD-ROM of the book if it comes with one, or in the website of the book if it has one.

If the above ways does not work, an easy hack will be to copy an arbitrary .ico file in your hard drive, copy two copies of it to your resource directory ,rename it as Blizzard.ico and Blizzard_sm.ico, and try running. It should work, but what you see will not be snowflakes. Maybe Blizzard_sm.ico is size 16x16 while Blizzard.ico is 32x32. But it is worth giving a try.

WolfPack 491 Posting Virtuoso Team Colleague

This type of program is called Win32 GUI Application programming. You dont have a main function for those programs. Instead there is a WinMain function for the starting point.

The way you start such a program is different than from a console program. This depends on the compiler you use. If you are using a Visual Studio compiler the option is to select,
New Project
Win32 Application
Win32 GUI Application (Select the empty project.)
Add the above files to your project and build

note:
Since this is compiler dependent, the exact steps may differ. I advice you to state the compiler if you find any difficulty.

WolfPack 491 Posting Virtuoso Team Colleague

Then the function std::clock() and the class std::clock_t can be used.

#include <ctime>
std::clock_t start_time = std::clock();
//Do something
std::clock_t time_passed = std::clock() - start_time;
std::cout << "time = " << time_passed;

edit:
convert this to seconds by using the CLOCKS_PER_SEC macro. you get the above in clock ticks. It is approximately a millisecond.

WolfPack 491 Posting Virtuoso Team Colleague

:lol: hello
i want to show the time in a certain program in part of seconds but i don't know,can you help me in solve this problem?
thanks

What is the language you are using? Is it a console program or a GUI program?

WolfPack 491 Posting Virtuoso Team Colleague

yehhh i changed return_success to return month i get the warning type cast integer one. But if i go return *month i get a wrong value

try using

return valMonth;

and

return valYear;

.

WolfPack 491 Posting Virtuoso Team Colleague

Check your getYear() and getMonth() functions. They are not returning the values you want. That is why you are always getting 0.

Also the parameters in the calDays = totalDays(month, year); call are reversed.

WolfPack 491 Posting Virtuoso Team Colleague

When the connection fails, get the error number by using GetLastError(). Then lookup for it's description in MSDN or the winerror.h file. That will give you an idea on what is causing it.

WolfPack 491 Posting Virtuoso Team Colleague

put the missing semicolons.
define undefined variables.
there is whitespace between

hourly rate

and

gross pay

. Remove them.
I dont know how you got this to compile in Visual C++ 6.0

correct the mistakes I pointed out and post the code again.

WolfPack 491 Posting Virtuoso Team Colleague

I just saw that these were some startup code that someone else provided. I guess you should figure the rest on your own.

WolfPack 491 Posting Virtuoso Team Colleague

i still get the passing arg 1 of validate month makes integer from pointer without a cast

assignment makes integer from pointer without a cast

all on line 51 whichis

month = validateMonth(month /*prompt*/)

That is because month is a character pointer and you are returning an integer from the validateMonth function.
Change that line to

valid = validateMonth(month /*prompt*/);

You should pay attention to all the places you call validateMonth.
Also think about what Bench said.

WolfPack 491 Posting Virtuoso Team Colleague

Problem is, I don't know if this is possible

It is possible.

how to do it

Depends on the language you use.
If using C search for examples on using fread, fopen
If using C++ search for examples in fstream, std::istream.

WolfPack 491 Posting Virtuoso Team Colleague

What about using CFile::Write() ??? Have you tried it?