Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

I didn't knew the question was confusing. However some geniuses have decoded it correctly. Here I go again. Suppose I want to use bass.dll which have functions written in C, is there special thing i need to include or just give it a go?

Thanks for suggestions and link. I really learn here at DW

I think everyone has already answered that question. First, create function prototypes for the functions your c++ program needs to call, surround them with extern "C", then put the DLL somewhere the OS can find it, such as one of the directories in your PATH environment variable, or in the current working directory.

Another way to do it is with dynamic loading -- First call LoadLibrary(), then GetProcAddress(), which will return a function pointer.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

>I assume she has a lot of other higher priority things to do
>than devote a lot of time/effort to something like this.

Those "conferences" that she uses to decide our fate without our input seem to be one such example. :icon_rolleyes:

I might agree -- but a business (DaniWeb) is not a democracy where all the employees (members of the forum) get to vote on how the business (DaniWeb) is run. Nor do we own shares of voting stock in DaniWeb. We can always vote with out feet if we don't like the way DaniWeb is run.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

you could redirect the output to a file. Then your other program just read the file like it does any other file. Below I put the output in separate files, but you can put them all in the same file too by use >> instead of >

ping google.au > file.au
ping google.dk > file.dk
ping google.de > file.de
ping google.se > file.se
ping google.no > file.no
ping google.fi > file.fi
ping google.be > file.be
ping google.nl > file.nl
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Going from XP to Win7 can be somewhat rough because things have moved, such as your home directory is not where it was in XP. Also if you get a computer with 64-bit motherboard then you will have 64-bit Win7, which in itself if quite nice. 64-bit Win7 is a great deal better than 64-bit XP. You may have some problems getting older games to work on Win7, especially if they try to install an old version of the service program that check to see if you have the DVD inserted in the DVD drive (I forget the name of the service program). I had to download a new version from Nvidia (they apparently bought it) that runs on Vista/Win7 and now the games works ok.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Yes. But the 'when' is still a bit of a mystery.

I assume she has a lot of other higher priority things to do than devote a lot of time/effort to something like this.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Why can't you do that yourself?

The loop starting on line 38 is poorly written. Note the use of < symbol instead of <=. Arrays are indexed from 0 up to but not including the number of elements in the array (variable len in this case)

for(i2 = 0; i2 < len; i2++)
{
   if( isdigit(s[i2]) )
   {
         // This is just summing the ascii values of the digits
         // which may be pretty meaningless.  For example: 
         // the digit '1' will be added as the decimal value 49,
         // not 1.
           S1 = S1 + S[i2];
   }
}
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

I dont know how to start, but I enjoy to join this forum. Thanks for accepted me.

Welcome to DaniWeb, but most newcomers post this in the Community Introductions forum

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

>>I'm speaking most particularly of GUI class frameworks.
There are no GUI frameworks in standard c++. You must be thinking of some 3d party libraries, such as wxWidgets, MFC, OpenGL, DirectX, etc. etc. None of them are part of standard c++. Maybe you should read a book about c++ to find out what all is included in the standard.

As for the op's question, he wants to know how to call C functions from C++. The answer is that c++ programmers do that all the time, such as by using any of the functions in stdio.h, string.h, stdlib.h, win32 api functions, etc (there are hundreds of them). All those functions are written in C language, and all be called by C++. Its just a matter of telling the c++ compiler that the functions are in fact C functions, not C++, so that the compiler will not mangle the function names.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

I have actually dlownloaded some alienskins and wares from site,

I have no idea what you are talking about.

therefore later the control panel never worked. everything was enlarged to the absurd extend.

You mean the fonts on your display screen are too large?

Needed help but no one to turn to.

Need help doing what? You have not asked any questions yet.

*Window 7 is lame.....haha

Naw. You just don't know how to use it.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

you have to declare them extern "C".

#ifdef  __cplusplus
extern "C" {
#endif
// C function prototypes here
#ifdef  __cplusplus
}
#endif

You will find this example in stdio.h as well as other c header files that may also be used in c++ functions.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

When I come to DW I have the C++ forum bookmarked. So the first thing I do is look at the threads in that forum to see if I need to reply to any of them (via the New button). Then I'd use the Favorite Forums links to do the same with the other favorite forums. In the 4+ years that I have been a member here I think I may have visited the DW Home page 5 or fewer times.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

After downloading wxWidgets you will need to compile it. The build/msw folder contains the necessary projects to build it.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

If you need the space, get rid of "Most Recently Viewed Threads" and put back My Favorite Forums.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

. Oh and BTW, `dogs' is way too derogatory, I'm sure you had a better word in your dictionary, you just didn't use it.

"Top Dog" is a common expression here in USA that means the boss or the leader. It is never meant as a derogatory term, but more of a compliment.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

coding out large blocks of code. I like to use #if 0 because its easier to find the end of it.

#if 0
some code here
#endif

Otherwise the way I code is pretty consistent with the link you posted.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

There is nothing wrong with Turbo C if all they are going to teach is Programming 101 class, where students just learn about the basic structure of a C program (variables, loops etc). In that case Turbo C is just as good as any other compiler because what they teach has not changed much over the past 20 years. Since I'm not even remotely from India I have no clue what they use for higher-level programming classes. ~S.O.S~ should be in a good position to answer that.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Yes it can. It will also compile CLR/C++ Forms. Just google for VC++ 2008 Express and you will get the download link

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

I mean those activation code for my VS6, will they work with VS08/VS10? or I will have to Buy entirely new IDE? Duh, that is expensive :cry:

VS++ 2008 Express edition doesn't require activation codes because its free. If you want the Standard or better editions then you will get the codes when you upgrade the compiler. I'm not sure if you qualify for the Upgrade price or if you have to buy the New User version -- check Microsoft's web site and it should tell you.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

I really miss that list of frequently visited forums. I was about to start a new thread here about it, but glad I read this thread first :) Hopefully Dani will put it back.

And while we're at it -- I'm starting to like that NEW button Dani added to each post. I use that quite a bit now.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

You shouldn't feel so bad

Overall Post Quality Score: 34%
Up Votes
Total Up-Votes Received: 899
Unique Posts Receiving Up-Votes: 776
Individual Members Who've Up-Voted: 268
Posts Currently Positive: 62
Down Votes
Total Down-Votes Received: 6509
Unique Posts Receiving Down-Votes: 1481
Individual Members Who've Down-Voted: 40
Posts Currently Negative: 906

If you do the math, 72/968 = 6%, not 34%

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

your serial what??

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

cant get any more open than that as to why you posted ,sell online ,and you sig is what it is

There is nothing wrong with his sig links, and his post was relevent to this thread. So I don't understand your beef with his post.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Would you believe there are still a few commercial manufacturers who still use computers that run ancient MS-DOS 6.X operating system. I know of at least two who are still running some old MS-DOS programs that I wrote 12+ years ago. One reason they are still using them is because of their speed, the programs run on assembly lines with very little human interaction, consequently no GUI needed. And the company I worked for way back then is still maintaining those programs :icon_eek:

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Just as well -- VS6 doesn't work well with Vista or Win7. Better off upgrading to VS8 or VS2010

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Hey thx :)

btw I got my other code working too :P

... It was a problem with unicode -.-..

SystemParametersInfoA(SPI_SETDESKWALLPAPER, 0,"C:\\wallpaper.bmp", SPIF_SENDCHANGE);

SystemParametersInfo(SPI_SETDESKWALLPAPER, 0,_T("C:\\wallpaper.bmp"), SPIF_SENDCHANGE);

Tadaaa both working!

Tadaaa -- when compiled for UNICODE those two are identical.

tadaa this working too..

SystemParametersInfoW(SPI_SETDESKWALLPAPER,0,L"C:\\wallpaper.bmp", SPIF_SENDCHANGE);
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Thank you for all ofyour help lab is completed and handed in on time with a sure passing grade!

Good -- did we all get A's :)

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

>> else (Letter_Code == POWER) ;

That's wrong. should be else if (Letter_Code == POWER)

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

If all you want to do is play games or surf the net, then don't waste your hard-earned money on the ultimate edition -- the Home Premium edition works great for those. You can't buy Vista any more so the argument between Vista and Windows 7 is now mute.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Ok the issues is resolved thanks for all the help.

What turned out to be the problem was that i was not compiling and building my program in the IDE.I was always under the impression that to output to a file all i needed to do was compile and run the .exe

Lesson learned :D

It is NOT necessary to compile a program using an IDE. You can use command-line compiles with or without a makefile if you want to. What compiler was you using and how was you compiling the program (post code to compile).

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

The damed program works fine as it is, its not necessary to change the data type of age, nor would it even be desireable. You're trying to make a binary file act like a text file -- it doesn't. You can not look at a binary file with a text program such as Notepad or Wordpad.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Add this to the bottom of that program to verify that it worked (works ok for me on Windows 7 using VC++ 2008 Express compiler)

ifstream in("myFile.dat", ios::binary);
    int k = 0;
    if( in.is_open() )
    {
        in.read((char *)&k, sizeof(int));
        cout << "k = " << k << '\n';
    }
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

What (or who) is tinypaste.com ?

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

You have to include wininet.h and shlobj.h, then compile the program for UNICODE

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

>>.any ideas?
Any ideas about what? You sort of lot me with all that description.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

>>that right?
Yes, now put that in the public section of a class.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

>>I want to write what I found in the file input to an output file, but it will not work. Why is this so?

Because you blanked it out on line 38, before it was written to the file. Move lines 44-49 to line 38 (just before blanking out check).

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

so.. how am i goin to write my own? im still new to c++, and im not that familiar to the other programs, so,. i still have lots more to learn,. can you give me an example? well.. if you want,.that is.. ^^;

Read the links I posted -- they will tell you how to do it.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

read your other thread.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

gotoxy() is a function only supported by Turbo C and Turbo C++. No other compiler in the whole wide world supported it. So if you want to use a different compiler then you will have to find a different way to accomplish the same thing, such as write your own gotoxy() function.

You can find some alternate solutions here.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

1) you can not compare a single character such as aData with a string such as "Exit".

2) 'Exit' must be surrounded with double quotes, such as "Exit".

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

replace all 7 loops with something a function

void GetMartks(std::string prompt, float& mark)
{
    cout << prompt << '\n';
    cin >> mark;
    mark = decimal(mark);
}

And call it in main() like this:

GetMark("T1:", a[n].vert.t1);
          GetMark("T2:", a[n].vert.t2);
          GetMark("T3:", a[n].vert.t3);
          GetMark("T4:", a[n].vert.t4);
          GetMark("T5:", a[n].vert.t5);
          GetMark("T6:", a[n].vert.t6;
          GetMark("T7:", a[n].vert.t7);

2) Because your program does not validate input. The decimal() function is broken when I enter a value > 99 or < 10. There are standard floating point functions to extract the decimal value of a float. This is a list of all the standard C/C++ math functions.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Are you attempting to write a function names isValidEmailCharacter() ? If yes, than what the hell is that "= false" doing after it on line 1 ? and where are the { at the start of the function and } at the end?

Line 3 doesn't work because you don't set the return value of a function like that.

bool isValidEmailCharacter(char c)
{
    bool ok = false;
    // function code does here


   return ok;
}
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Delete line 2 -- it is more harm than good.

Replace all the rest of that code with this single loop. When the '@' is found I don't know what you want to do, so the code below will just display the entire text.

string line, check;
while( getline(fin, line) )
{
    check += line;
    size_t pos = check.find('@');
    if( pos != string::npos)
    {
        cout << check << '\n';
        check = "";
    }
}
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Your text book should be able to answer that question. Yes, programs can have an unlimited number of functions which can be called from other functions such as main(). What your program is missing is the function prototype that needs to appear before main(). Just copy/paste line 33 somewhere above main() and replace the { with a semicolon ;

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

First create an array of month strings char *months[] = { "January", "February", "March", // etc etc } Now all you have to do is index that array with the month-1 string Name = months[m-1]; where m is a numeric value from 1 to 12.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Why bother with get()? Just use getline(IN, Name, ',') then if Name is greater than 29 just chop it off at the 29th character

if( Name.length() > 29)
   Name = Name.substr(0,29);
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

You need to sort the array twice. First time, sort the rows. When a swap is needed you need to swap all the columns on the row so that the column data stays with the rows. Then resort the array by columns. When a swap is needed you need to swap all the rows for that column. So that you will get this affect on random numbers

Unsorted array
18313 15285 21803
20551 19498 1481
12873 15650 22070


Array sorted by rows
12873 15650 22070
18313 15285 21803
20551 19498 1481


Array sorted by columns
12873 15650 22070
18313 15285 21803
20551 19498 1481
Press any key to continue . . .

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

>>Can someone please help me with this?
Can we do what to help you ? Post the code you have written, compiler's error messages, and ask questions. We are not going to write the program for you.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

There are two ways to add a library to the program

1) #pragma comment(lib, "toolkit.lib"); Put this near the top of any *.cpp file that is in the project.

2) Select menu item Project --> Properties --> Configuration Properties --> Linker -->Input. Now add the name of the library in the "Additional Dependencies" edit control.

But I don't see why you need that library to solve your problem. Just use std::string substr() method to split the line.