Murtan 317 Practically a Master Poster

Quoting from the link:

After the installation, the following files should be present on the target system in the indicated folders:
<windows system>\Msdbrptr.dll
<program files>\Common Files\Designers\Msderun.dll
<windows system>\Msstdfmt.dll
The inclusion of Msdbrptr.dll (and its dependent files) typically corrects this problem. If you are still experiencing problems, make sure that the following files are included in your package:
Msdatrep.ocx
Msbind.dll
Data Reports do not directly depend on these files. However, if the files are missing, this can affect the Data Environment that is used by your report.

NOTE: If your application must have the Msdatsrc.tlb file, do not explicitly include this file because Msdatsrc.tlb is installed as part of the Microsoft Data Access Components (MDAC) upgrade.

---
So there is more than one DLL that needs to be on the target system. The last note even mentions a file that you might need, but that you are not supposed to copy as it comes with an MDAC upgrade.

I wonder if you could just get the MDAC upgrade and your problems would just go away.

Murtan 317 Practically a Master Poster

I think the problem that you are running into is the fact that it is VERY unlikely to just randomly select digits to fill into the grid and have a grid that meets all of the criteria.

There are improvements you can make to your algorithm to make better choices, but the problem you are trying to solve is hard in and of itself.

As an example of the type of inefficiency of your current algorithm, I present the filling of your random positions table:

for(int x=0; x<81; x++){//20 random positions 0-80 (no repetition) in a vector(fix numbers)
	fix_nros_random_positions[x]=(rand()%81);
	for(int y=0; y<81; y++){
		while(fix_nros_random_positions[x]==fix_nros_random_positions[y]&& x!=y){//if is the same position, will be the same result
			fix_nros_random_positions[x]=(rand()%81);
			y=0;//position changed, so verific all again
		}//F while
	}//F for y
}//F for x

The algorithm generates a random location, and then searches the entire list to make sure that there are no duplicates, even locations that haven't been filled yet.

The desired functionality -- as I understand it -- is to generate a random ordered list of grid cell indexes where each cell is listed once. This is similar to software representation of a deck of cards, where you 'shuffle' the cards to get a random ordering. Most of the shuffle algorithms I've seen, fill the 'deck' with an ordered list of the cards and then proceed to randomly swap 2 cards. Using a similar algorithm here:

// fill the random positions
for (int x = 0; x < …
Murtan 317 Practically a Master Poster

You have a basic misunderstanding related to pointers. Pointers must be made to point to a valid storage location before they can be used to reference anything.

class Foo
{
   private:
      int mX;
      int my;
  public:
      Foo();
      int getX();
      int getY();
      void setX(int x);
      void setY(int y);
};

Foo * pMyFoo;

At this point, the pMyFoo is declared, but it was never initialized to point anywhere. Referencing the Foo that is pointed to by this pointer would be permitted by the compiler, but it may well cause a memory fault.

To be useful, the pointer needs to point 'somewhere'. Commonly in variable-length collections, the object to be pointed to is allocated. pMyFoo = new Foo(); gives us something to point to.

There are several places where you use pointers without making sure they are properly initialized. The code

if(root==NULL){
		root->data1=x;
		return true;
	}

is an especially grevious example of this in that you have explicitly verified that the pointer does NOT point anywhere, yet you proceed to use it anyway.

You will need to fix this first before you have a chance of getting this working.

Murtan 317 Practically a Master Poster

LOWORD is a macro, used to extract the 'low word' from a long.

HIWORD extracts the 'high word'

There is another macro that can be used to put them back together:

LPARAM MAKELPARAM(
    WORD wLow,
    WORD wHigh
);

So a call like: MAKELPARAM(somenum, HIWORD(lParam)) would be pretty close to what you want.

Murtan 317 Practically a Master Poster

Is this game supposed to be like the card game memory?

Where you turn over two cards and if they match you count the pair (usually removing the cards) and if not flip them back over?

So for each user turn:
the user should pick a first card
you 'turn face up' the first card
(display the grid)
the user should pick a second card
you 'turn face up' the second card
(display the grid)
if the cards match, remove the cards from play
if the cards do not match, turn then back 'face down'
(display the grid)

until the user has either matched all of the cards or quit

This means that each location in the grid has one of 3 states: face down, face up, empty

If you would like further assistance, please implement more of the code. It would also be nice if your posted code would at least compile, and if you want to use an external file, a sample of what that file was intended to contain would also be useful.

PS- As an alternative design to the 'scrolling text' method you are using, if you are at least passing familiar with the python graphic support, this application would lend itself well to a grid of buttons. Although it would be a very different approach from what you have, I think the result would be more user friendly.

Murtan 317 Practically a Master Poster

I see a few things that could be done to clean the code up.
The largest of which is that you have one HUGE method that seems to want to do all of the work. This is almost always a sign of a poor design.

The pseudo code for the 'on go click' should be something similar to the following:
first, evaluate the users answer to the displayed question (if any)
second setup the form for the next question or show final results.

You appear to be doing both, but you are displaying the question and immediatly evaluating the answer without giving the user a chance to interact with the form.

Regarding your question about how to reset the radio buttons, as you are setting the Text for each button

this->radioButton2->Text = "The inventor of roomba";

also set Checked = false

this->radioButton2->Text = "The inventor of roomba";
this->radioButton2->Checked = false;
Murtan 317 Practically a Master Poster

A little more data might be useful. Do you have a more concrete example of the relationship?

Does your form have all of the data necessary to add one row to each table?

Is there enough data to add more rows to either table?

Murtan 317 Practically a Master Poster

Are you asking to programmatically detect when another program opens a particular file?

Is the other program known?

Would it be sufficient to know if the specific program opens the file, or do you need to detect if the file is opened by ANY program?

Are there any real-time constraints related to detecting file access?

Could we tell you tomorrow that the program accessed the file today?

Murtan 317 Practically a Master Poster

Not stopping your service is a bit unfriendly, do you properly handle getting stopped if windows is shutting down?

I suspect the reason you don't get called a second time is because something you're doing in the first event causes you to be removed from the handler chain.

Confirm that any value you return is an expected and 'normal' value.
If you are passed any data structures that you modify, make sure you are setting the proper values.

If everything appears correct, it may be that you have to re-add your handler every time it is called. (It doesn't make a lot of sense, but it wouldn't be the first time I've seen something like it.)

Murtan 317 Practically a Master Poster

I'm thinking that your problem is actually the format character in the last printf. '%d' is for decimals/integers. Try using a '%f' instead.

Salem commented: Good catch +23
Murtan 317 Practically a Master Poster

where's the code to support the rest of the algorithm?

It looks like it might be useful to write a function to calculate the distance between two cities (or two coordinates).

Murtan 317 Practically a Master Poster

If you want the program to ask for multiple inputs, you need to re-prompt and re-accept input inside the while loop.

Try putting it right after you display an answer.

Murtan 317 Practically a Master Poster

Is the problem that your application has the input focus and is getting all of the keystrokes instead of the game?

Can your application run while minimized?
This would remove the input focus from your application and return it to the game.

Alternatively, could your application just send the keys typed as well as the ones generated by movements on the webcam?

Murtan 317 Practically a Master Poster

But that is exactly why he said 'This is the stupidest use of the ++ operator I've ever seen' because it doesn't serve any useful purpose.

Murtan 317 Practically a Master Poster

It doesn't make much sense for a location (specified as latitude and longitude) to support an increment (or decrement) operator at all.

The current implementation causes the location to move in a diagonal direction, what is the benefit? How would it be used?

Murtan 317 Practically a Master Poster

This sounds like an assignment, but you will probably have to re-create what strtod() does.

You will end up validating the string (or characters) and building the number by recognizing the digit characters.

Murtan 317 Practically a Master Poster

As a side note to the discussion, although it is convenient in this context to have the default Car constructor generate a random car, the constructor seems to be doing an awful lot, including adding delays?

I try to promote the simple constructor theory where the constructor is as simple as possible and very rarely has problems.

It would be a better design to pull the random generation out and move it to a stand-alone function that would create a Car with 'random' attributes.

Is there any real benefit (either to the class or the program) to have several random delays in the single constructor method?

ddanbe commented: I could not have said it better +2
Murtan 317 Practically a Master Poster

If the include line looks like:

#include "Test/Testnamespaces.h"

it should look for the Test directory in the same directory the source file was located in, or in the include path.

If you used:

#include <Test/Testnamespaces.h>

the compiler will not look in the source file's directory first.

Which style of include did you use?

If this doesn't help, the relevant section from your code would be useful as well as the project directory listing to demonstrate where the files are located in relation to each other.

Murtan 317 Practically a Master Poster

attrib is a program, not an internal command.
Either, the program has been removed or renamed or it is not in your path.

Though it sounds like you have a more serious problem with the system. The BOOT.INI file is what Windows uses to determine where to find the windows installation to boot from (or what options to use). The message indicates that yours is invalid so it is booting by default from C:\WINDOWS.

How or why your BOOT.INI became invalid is not apparent from your description.

Murtan 317 Practically a Master Poster

It's been a while since I played in VB,
but doesn't the x = 1 run every time the timer is called?

The sub as displayed reads from Me.ProgressBar1 , but does not appear to set it, so the value doesn't change here.

So if neither Me.ProgressBar >= 10 or x >= 10 will ever be true, I wouldn't expect the 'loading' window to ever close.