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

>>Should I uninstall wxWidgets after buidling?

Not unless you never want to use it again. If your computer is running out of space then there are other files that should be removed before wxWidgets, such as all the compiler-generated files. If you are using Microsoft compiler then it will generate some pretty large precompiled header files (*.ncb).

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

Really, I think that got to be a troll. :D. C++ has no way of representing type definitions at runtime AFAIK (At least to represent classes like this.). Either you have to include the header file for the class, or u don't have it.

Of course you have to include the header file that contains the class declaration. You apparently didn't read my original post (#3) in this thread. class DLL_EXPORT CBox is exactly what does the job of exporting the entire class.

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

I already told you what to change it to: if (KeyStroke == 0 || KeyStroke == 224)

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

Yes, I know what you want to do, but what you posted isn't much help because we don't know what that structure looks like. You will have to design a file format for your users to follow when creating the text file then write the program to follow that format when reading the file. Its really not all that difficult a coding task once you have designed the file format like you want it.

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

If you plan to compile that code with VC++ 2008 then you will have to do a lot of typecasting from SQLCHAR to char*. Otherwise, works great.

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

We have no clue what that code is you posted, so can't help you very much.

>>Just wondering how i could go about this as I cant get the standard variable export import working with it

Is this going into a DLL? What is it that you want to export? Your question is just too vague.

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

>>But you can't export classes themselves.

Funny -- I've been doing that for years, and even posted the example in this thread :)

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

What exactly does that mean though?

Didn't you write the code you posted? All you have to do is change that if statement and change the data type of KeyStroke from char to int.

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

dear can u make a complete program because still i cant understand please

Read the tutorial in the last link he posted. If you can't understand that then you have no business attempting to write complicated programs; get yourself an Introduction to C++ programming book and start studying from page 1, not the back of the book.

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

normally size in C is 25x80

There is no such thing as a "normal size in C". C language doesn't know a thing about screen sizes.

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

>>Last time I checked GameMaker 6
Its up to version 7 now :)

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

Forget making games for now and just concentrate on learning the language. You have to learn how to crawl before you can start running.

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

fstream objects are normally passed by reference, not by pointer. void delete_record( istream& file, string keyword ){ . This allows you to use file just as if it had been declared inside the function and removed the indirection star. while ( *file >> fname && file->peek() != EOF ) It is not necessary to check for EOF because *file will become NULL on EOF. This is all that is necessary while ( *file >> fname ) Remove the star if you change the function as described above.

If that does not fix the problem then consider using getline() to read the entire line and then using stringstream to split it into individual words.

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

google for "ODBC c++ classes". Then in the OnClick event handler do the sql queries via odbc and fill the listbox or whatever.

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

This is one of the problems with learning to program with an ancient compiler such as Turbo C -- you don't know the difference between compiler-specific functions and standard C.

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

>>Do you have any solution for my problem?
Yes -- compile for debug and use the compiler's debugger. Sorry, but that's about the best I advice I can give you without seeing the code and debugging it for you.

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

getch() returns 224, not 0, when an arrow key is pressed. So the program has to check for both values (0 and 224)

Also, getch() returns an int, not char.

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

The parameter to EnumProcesses() is not a function pointer, but a pointer to an array of DWORDs. That link contains a simple example program to demonstrate how it works.

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

That doesn't work either. My guess is that I would have to be a registered user in order to access that page.

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

I don't quite understand. By inlining the functions they don't get exported or references put in the *.a file??? Even when __declspec(dllexport) is used? Humm.

That's right because there's nothing in the DLL to export, unless objects of that class are created in the DLL, then they can of course be exported.

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

sknake> I see that you have not served in the armed forces which is probably for the best.
Ignorant! You know nothing about me.

See, this is why I quit talking to you, because you are incapable of holding a conversation without insults and name calling.

Aia commented: I was not insulting anyone, what merely using the word for its meaning. -3
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

I get this error with the link you posted

403 Forbidden!

The address you have entered is not open to the public,
(This may be caused by not having a index.html file in your root directory).

We advise you to visit our home page, as you could still find the page you are looking for:

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

I was able to do it with Code::Blocks. This is nearly identical to the way I build them with Microsoft compilers. I started out by using the class exactly like you posted it (except for the extern "C" part). Then then it dawned on me that when all the methods are inlined like you have them you don't need that dll at all. So I split the implementation code into its own *.cpp file to force use of the DLL's *.a file

I put the CBox class in its own header file then used that same file in both the dll and application program.

// This is cbox.cpp, which is included in the DLL project.  That puts
// the code for the class into the *.a file which is linked with the
// application program.
#include "cbox.h"

CBox::CBox()
 {
     m_Length = m_Width = m_Height = 0;
 }

CBox::CBox(double dblLen, double dblWidth, double dblHeight)
 {
    std::cout << "Called CBox() Constructor\n";
    m_Length=dblLen;
    m_Width=dblWidth;
    m_Height=dblHeight;
 }

CBox::~CBox()
 {
    std::cout << "Called CBox() Destructor\n";
 }

 double CBox::Volume()
 {
    return m_Length*m_Width*m_Height;
 }
//
// This is the header file that is included in both the DLL and 
// application project.  Code::Blocks IDE defines DLL_EXPORT when
// a new DLL project is created, and I used that macro to determine
// whether the class is exported or imported.
//
#ifndef CBOX_H
#define CBOX_H

#ifndef DLL_EXPORT
#ifdef BUILD_DLL
    #define DLL_EXPORT __declspec(dllexport)
#else
    #define DLL_EXPORT __declspec(dllimport)
#endif // BUILD_DLL
#endif // DLL_EXPORT

#include <iostream>


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

why is that class declared extern "C" ? C programs can't call c++ classes, to that declaration is pointless.

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

Next time use code tags.

line 36: where is year declared?

line 46: why delete year immediately after entering its values?

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

My knowledge of current market conditions is a bit outdated now. With the current economic conditions there are lots of out-of-work programmers (and others). Hopefully that will change in the next year or so. Current job market conditions will depend on where you live and where you are willing to work.

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

Don't limit yourself to just c++. Also take courses in C#, VB, Java. HTML, and other languages to broaden your skills. And toss in a course or two in databases, such as SQL language. The more you know the better your resume will look to potential employers.

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

Congrats ~s.o.s~, I know you will do an excellent job :) :)

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

change_r() is pointless. All it does is return the same value that was passed in as the parameter.

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

you opened the file in text mode, which means the operating system may translate some of those binary characters. Open the file in bianry mode (ios::binary) and your program will probably work.

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

cout does nothing in windows programs because they do not have a console window, nor do they have a main() function.

Here are some hints how to draw text on windows canvas.

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

Please read the Read Me threads at the beginning of this c++ board for hints and suggestions. If you want to learn c++ don't jump directly into the fire. The book you are reading doesn't appear to be for beginners, but more advanced.

As for your original specific question -- I have no idea.

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

Homework? Try reading your textbook.

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

If you are trying to learn c++ with Tubro C++ then forget it. That compiler is non-standard and too old to do anyone any good. Get a modern free compiler such as Code::Blocks or Microsoft VC++ 2008 Express if you want to learn c++ the modern way.

And what you posted isn't really c++.

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

Works for me MessageBox(0,"Hello\nWorld","MyProgram",MB_OK);

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

post some of the error messages.

Function Search() -- Is state supposed to be one of the 50 USA states? If yes, then it can not be an integer, but must be 2 character array followed by a null terminator (total of 3 characters). If not, then you need to define what "state" is so that whoever is using your program will know.

The argument to scanf() is wrong for an integer -- it should be "%d", not "%S".

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

The IDE will take you directly to where MSG is declared -- just put the mouse on the 'MSG' then right click. From the popup menu select the second item "Go To Definition". When I do that the IDE takes me to WinUser.h and tagMsg structure.

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

>>anything wrong in the program?

1. its int main(). 2. Add return 0; as the last line in main()

3. Add '\n' to the end of Hello, making it "Hello\n"

4. You might need to add fflush(stdout) after that print statement.

If the above doesn't fix the problem then I don't know what's wrong.

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

No. That feature does not exist in C or C++ languages. In C++ the nearest thing I can think of would be <map> that maps a name with a string (or other item). But that's not really the same because you can't use it like a variable.

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

Ohhhhhh! That's not very pretty now is it??

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

http://c-faq.com/ansi/exitvsreturn.html

>>Finally, the two forms are obviously not equivalent in a recursive call to main.

But that's not supposed to happen. :)

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

I compiled your program with vc++ 2008 Express and had no errors or warnings. I also have Microsoft Windows SDK installed, but since you have the Pro edition that shouldn't be your problem. Are you certain you created a "win32 project" instead of a console project? Attached is the project I created.

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

I don't see it in FF 3.5.1

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

And the while loop stops reading on end-of-file.

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

>>Include winuser.h

That should not be necessary since he's already including windows.h

>>Im using Visual Studio Professional edition.
Which version -- there are several of them.

>>but there are some errors rising while compiling it, the two most importants are :
Are there other errors listed before the two you posted? Correct those first, recompile then see if those two errors disappear.

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

Open the file in binary mode, not text, then read each byte into an unsigned char, which has a value 0-255. If you want to count the number of occurrences all you need is an array of 255 and use the char as the index into the array

int counters[255] = {0}

ifstream in("myfile.bin", ios::binary);
unsigned char c;
while( in.read((char *)&c, 1) )
{
   counters[c]++;
}
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

This is not a workable solution, but it shows how to typecast that last parameter. Compiled with vc++ 2008 Express.

#include <iostream>
#include <windows.h>
#include <vector>
#include <string>
using namespace std;

int main(int argc, char **argv)
{
    HWND hwnd = 0;
    vector<string> spnV;
    vector<string>::iterator it = spnV.begin();
    for(; it != spnV.end(); it++)
    {
        SendMessage(hwnd, LB_ADDSTRING, 0, (LPARAM) (*it).c_str());
    }
    return 0;
}
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

just typecast it.

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

Never heard of it, so I answered No.