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

Forget about the two I mentioned above. You need to handle the Click event. You need to have your own bool variable to indicate whether the button has been clicked or not, then implement an onClick event handler to set or reset that variable. Something like below. IN the below, IsClicked is a class bool variable. Now wherever you want just look at the IsClicked varialbe.

private: System::Void BuyRadio_Click(System::Object^  sender, System::EventArgs^  e) {
                 if( IsClicked )
                     IsClicked = false;
                 else
                     IsClicked = true;
             }
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster
void collection::writeOut(char * fileName,vendor &avendor)
{
 hash table;	
 table.writeOut(fileName,avendor);
 BST tree;
 tree.writeOut(fileName,avendor);
}

Here again you are hiding the class objects table and tree. Delete lines 3 and 5 above.

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

First, don't rely on the compiler's IDE to give you all the methods -- look them up in MSDN so that you can read their description. RadioButton class is here. Look at the members and you will find IsChecked method.

if( BuyRadio->IsChecked() == true)
{
   SetNumber = 1;

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

I thought it was "legal" to mix parameter lists.

Yes, you can mix and match as you wish.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster
collection::~collection()
{
	
	BST tree;
	tree.~BST();
}

Remove that code (lines 4 and 5) because the BST destructor will be called when the collection class object is destroyed. Line 4 above is hiding the class object declared in the header file.

collection::collection (char * fileName,vendor & avendor)
{
	
    hash("oo.txt");  //call hash's filename constructor in hash class
	BST("oo.txt");   //call bst's filename construcor in bst class
	
}

That code is wrong too. Use the object names, not the class names, like below: But the code below is also probably wrong because it doesn't use the two parameters for anything. Maybe you are supposed to pass them on to tree and table??

collection::collection (char * fileName,vendor & avendor)
{
	
    table("oo.txt");  //call hash's filename constructor in hash class
    tree("oo.txt");   //call bst's filename construcor in bst class
	
}

From what I saw above I suspect there are millions of other errors in your code that you need to resolve. Didn't you compile any of that code yet ?:-O

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

what about the attachment???

Missed it :-O

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

Of course its legal -- you just forgot the & symbol after int

int afunction(ifstream& in, int& anumber)
{
/* Function Body */
}
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Are you using ancient Tubto C or Tubro C++ compiler? Those two compilers are sooooo old that they aren't of any value to learn c++. Toss them out and download one of the free modern compilers. Dev-C++ and Microsoft VC++ 2008 are both good ones. There are others too, such as Eclipse, mentioned by codeaa above.

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

BuyRadio is a c++ class object, not a POD (Plain Old Data) type so you can't treat it like that. You must give the class a method that will return the button's state.

if( BuyRadio.GetState() == true)
{
   SetNumber = 1;

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

>> need help, with the collection :: collection -construcor
Nothing wrong with an empty constructor

>> also need help with the copy construcor for collection:
With no class data the copy constructor wouldn't do anything either


>>i think that the vendor data gets lost somewhere before it can be saved to file
Maybe its because the class doesn't have any way to save that data so it can be used later.

Sorry but noone can be much help to you without seeing the code.

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

See the Starting C Read Me thread.

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

line 8: void main()
main NEVER EVER returns void. It always returns an integer.

line 15: unrecognized escape character "\(" as well as "\)" and "\:". You can't escape those characters, just delete the "\" character.

Those same errors appear several more times in your code. Correct them and the rest of your program will compile ok.

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

piece of cheeze

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

MFC is Microsoft Foundation Class and the oldest of the three. It is mostly wrapper functions for win32 api functions, and makes windows programming pretty easy. Requires a very good foundation and knowledge of c++.

ATL (Active Template Library) is somewhat similar to MFC but revolves around C++ templates and doesn't contain all the bulk that comes along with MFC.

CLR is the newest of the three (I don't recall what that acronym stands for) and has nothing at all to do with writing MS-Windows programs but instead is a way of writing what Microsoft terms Managed Programs. I don't really know much more than that about it because I have not used it.

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

>>I think I might be mildly allergic to dairy products
A good replacement is soybean products. I don't know what you can get where you live but we have several milk-replacements such as Silk. You will want to test several brands because some are just plain yukky.

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

>>Do have any knowledge otherwise?
Nope. I have seen my suggestion used in other programs.

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

I suppose one way is the first time you ask allow them to type 'Y', 'N', "YES", or "NO". If they type "YES" then assume the answer to all future questions will be 'Y', and if they type "NO" the answer would be 'N' to all further questions.

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

But apparently the only thing I need to change is the hooking and injection method, can't any of you guys help me on that? Rewriting the DLL in C/C++ is the very last option that I will take because the main reason it was made in MASM is because of the size of the file and also the speed in which it works, and C/C++ wont really give us the same performance as MASM does

I realize that rewriting a dll can be a difficult and time consuming task, especially if you paid someone to write the original and now find yourself redoing what he did. That often happens regardless of who writes the program -- been there and done that too.

>>and C/C++ wont really give us the same performance as MASM does
Untrue in most programs today. Use a compiler with very good optimizing (such as Microsoft Visual C++) and it can often outperform any code you write manually. C++ code tends to be larger than C, but if it is running on modern desktop computers it doesn't really make much of a difference. 20 years ago I could have agreed with you, but not any more.

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

line 51: That is an ILLEGAL way to declare an array. You must specify its size.


lines 57 and 58: What happens if OnRelease() returns -1, as it will in line 46? Answer: crash your program.

Where (line number please) do you want to use atol() ? If you are getting the letters from the keyboard one character at a time than atol() may not be necessary.

int key = 0;
char k;
// convert letters to format an integer.
while( (k = getKeybord()) > 0)
{
    key = (key * 10) + k - '0';
}
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

I see that www.codeporject.com has several programs. And google gave me 654,000 hits!

I'm sure whatever the solution it would be specific to the browser and operating system you are using.

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

Also, please don't capatilize every word in the sentences -- it looks silly and makes it a little more difficult to read.

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

put it in a library or dll and distribute the .h file with the lib or dll.

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

If you are using MS-Windows GUI then one of the commond standard M$ controls is a text editor (edit control). It may not do everything you would want it to do but does all the basic work.

If you don't want to (or can't) use that then you will have to tell us what operating system and compiler you are using. pcurses or dcurses library will make wring a text editor a great deal easier.

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

OMG almost 30 years old with a wife and kid, and still living with mom & dad :'( You need to grow up, get a job, and start taking care of your own family because mom & dad aren't going to be here forever for you. If you were my kid I'd toss you out on your ass and tell you to sink or swim. And if I were your wife I'd divorce you for being such a lazy bum.

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

>>Please answer only if you are sure
Normall I don't answer polls, but in your case I'll make an exception. I don't have the slightest idea what the answer is.

peter_budo commented: Neither OP has slightest idea what is he talking about :) +7
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

This Drive Picker MFC control contains the win32 api function(s) you need to get a list of valid drive letters. All you need is to call GetNumSelectedDrives(). See the explaination in the MSDN and the source code link I provided for how to interpret it.

I don't know how this can be called remotly on another computer.

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

I guess what you need to do is make parent->GetDimension() a pure firtual function, which means all children must implement it.

class base
{
// pure virtual function
    int getDimention() = 0;
...
};
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

.dev is just a project file that Dev-C++ IDE uses to maintain the *.cpp and *.h files you have in your project. It has nothing to do with the console window. When in Dev-C++ IDE you have to put something just before the return in main() to keep the window open. If you don't then Dev-C++ will close it when the program finishes. On the otherhand, when you create a command window from the Start button that window stays open until you close it and you can run most porograms from it without closing that window.

int main()
{
   ,,,
   // keep the window from closing
   cin.get();

   return 0;
}

Note that what I posted above is only one of several ways to keep the window from closing.

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

Welcome to DaniWeb. Sorry but I had to remove the URL you posted because its against DaniWeb Rules to post them except in a very select vew places here.

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

Welcome to DaniWeb. Hope to see you around.

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

Welcome to DaniWeb -- glad to see that you found us :)

>>but it can be challanging at times...
It always is challenging. Getting that degree only gave you the tools you need to start, now the real learning will begin, and its a life-long effort. :)

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

You should ask your question to whereever you got that compiler. Check if they have a forum where you can ask questions.

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

There is no "bold part". Please refer to the line numbers of the code you posted.

The way I create and use DLLs is to use a macro to determine whether to use __dllimport or __dllexport

#ifdef MYDLL
#define MYAPI __declspec(__dllexport)
#else
#define MYAPI __declspec(__dllexport)
#endif

MYAPI void HelloWorld();

If you put the above in the .h file you can include it in both the DLL and application project. In the DLL project just declare MYDLL

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

depends on the compiler you are using. Some IDEs will keep the console window open and others won't.

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

line 12 of the class constructor: you might as well just set numbers = 0 because new does nothing when called with a value of 0.

line 22: setNumbers(). What happens when numbers already has a value? Answer: huge memory leek!

line 30: what is that supposed to do? Its a do-nothing line (except access the array out-of-bounds)


line 36: That if condition is backwards. you want if( spots < 1 || spots > 10) line 42: ok, where did you declare newnumbers ?

There are probably other errors but thats enough for now from me.

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

Ohhh you are an evil one :) :) Several (ok many) years ago during MS-DOS 6.X days I played a similar prank on my boss. I wrote a tiny C program that did nothing but display "Formatting drive c: Please Wait ...". I ran it on his computer after he left the room, and when he came back I thought he was going to have a nervous breakdown :)

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

C# and VB are much better languages than C and C++ for reading Excel spreadsheets. The easiest way to do it in C/C++ is to load Excell and export the data to a text file, manipulate that text file, then input it back into Excel.

Here is another (cost $$$ ?) way

Or any of these

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

dos.h is only supported bo borland's TurboC and TurboC++ compilers, Microsoft VC q1.52C (and earlier), and maybe some very old versions of Watcom C. No other compilers has it. All those compilers are dead in the commercial world and only used by hobbiests today.

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

IMO she asked for it because she refused the cop's orders to peacefully sit in that chair. Had she set there and shut up nothing probably would have happened to her. They didn't show the actual beating so we can't say what happened.

That cop was wrong in that he should have had a female cop in that room with them so that she couldn't claim rape.

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

First you have to allocate memory for the return pointer myIncomingMessage. line 6 only declares the variable, you can't write anything into it until you allocate memory with malloc(), new, or setting it to point to some statically allocated block of memory.

Before doing the read on line 20 you need to find out how many characters are available to be read -- there could be many more than just one. Call the function ClearCommErr and it will fill in a COMSTAT structure which contains the count. Then you can call ReadFile() to read all those bytes.

One problem you have is how to determine when you get all the characters you want ? Does the incoming data contain a terminating character ? How do you know when and if you get all the data ? Just because you get an event from line 16 doesn't mean you get all the data.

After reading the data you have to copy it somewhere. That means you have to allocate memory for myIncomingMessage if that is where you want to copy it.

Dave Sinkula commented: That too. +13
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

>>or you could replace windows' "shutdown.exe" file with your program
Horrible idea. And I don't think it will work with XP or Vista because the files in Windows are protected.

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

My advice: rewrite it in C or C++. If the data is sent across serial port then use MSCom1 dll for the communications -- I thik its probably compatible with Win98. Use sokets if the data is sent across the internet.

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

I don't think that's what he wants. I think he wants a windows hook into the system shutdown function such as ExitWindowsEx().

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

>>visual basic c++
There is no such thing :)

Friend Functions

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

If you get the boost libraries you can put that function in another thread and then have it wake up every XXX milliseconds or so. Don't expect very accurate timeing because that will not happen on multi-process operating systems like *nix and MS-Windows.

There are other ways too, some os dependent and some not. None of them are very nice.

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

Obviously appears to have a huge crash looking at that 2d picture, but given a 3d picture you would see that each of those planets are godzillion miles apart.

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

I'v had similar problems and the solution was to uninstall and unregister the ATL COM program then reinstall / reregister it.

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

Finally I have successfully compile itu, i remove #include "Fibonaci.h" in Fibonaci_Iterator.h to
Fibonaci_Iterator.cpp.

TQ all.

Wrong move. You should NEVER EVER include a *.cpp in another *.cpp or *.h file

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

line 1: delete it because stream.h is not a valid header file except in some very old compilers such as Turbo C++. Since you are writing a C program you can't use it here. Also remove most of the other header files because they aren't needed. Looks like all you need is stdio.h and stdlib.h.

line 12: int main() not void main(). main always returns an integer.

line 11. If the file contains 270 rows and 13 columns of data then the arrays you declared are backwards. Also not how to initialize them to 0 values.

float array[270][13] = {0.0F};
float max[270] = {0.0F};
float min[270] = {0.0F};

After using fgets() to retrieve a line you can use strtok() to split it up into individual parts

int column = 0;
char *token = strtok(line," ");
while( token != NULL)
{
    array[row][column] = atof(token);
    token = strtok(line);
}