I think you need to have a virtual destructor (currently you are observing undefined behaviour).

If you are unhappy with the SHBrowseForFolder(), perhaps have a look at the Show Shell common file dialog sample from MSDN.

In your hook procedure, you need to use the parent of the hdlg in order to make CommDlg_OpenSave_GetFolderPath() work, i.e. CommDlg_OpenSave_GetFolderPath(GetParent(hdlg), ...);

PS. I think attempting to cancel the selection inside CDN_FOLDERCHANGE switch, is frankly a horrendous idea.

commented: Thank you :P +0

Great, computer shop project sounds like something interesting. Here is a fully working starting point for you ..

//
// Computer shop program (skeleton).
//
// Should compile cleanly on modern compilers.
//

#include <iostream>

int main()
{
    //
    // The program begins, let's display a friendly title ..
    //
    std::cout << "Welcome to the computer shop!" << '\n';

    // Todo: ... 
}

You want to make sure that you are NOT trying to execute the DEBUG version of your executable on machines not having Visual Studio (2008) installed, i.e. build and use the RELEASE version on such machines.

commented: good suggestion :) +14

I know this is solved, but a detail which should not go unnoticed, namely

// Allocate ...
b = new int[1000000];

// ... and delete
delete [] b;

//// instead of
// delete b;

is there any way to know what actall files from the redist it needs, and is it ok and legal to just add them

I would oppose trying to distribute individual DLLs (you cannot know the exact conditions under which a particular file should/should not be installed etc...). IMO, letting Microsoft's redistributables to manage the setup would be the best way to go. Note that in the past, even MS has royally screwed up DLL updates (rendering machines unbootable).

Have you read Redistributing Visual C++ Files?

EDIT: Regarding dependencies in general, you'll probably find Dependency Walker useful.

unresolved external symbol "public: __thiscall grid::grid(void)"

This is saying that you have no implementation of the grid class' constructor.

commented: Thanks +0

I believe this happens due to a typo; [ICODE]Theading[/ICODE] vs. [ICODE]Threading[/ICODE].

commented: THANKS! +5

I believe you are missing an [COLOR="Red"]ampersand[/COLOR] there ...

[CODE]
...
void serialize(Archive [COLOR="Red"]&[/COLOR] ar, const unsigned int version)
...
[/CODE]

commented: oh my goodness! That's it! Thank you! +3
commented: well spotted! +13

[URL="

commented: That's an interesting read +17

why this doesn't work correctly?

The input stream has the [ICODE]skipws[/ICODE] format flag set, use [URL="

commented: thanks +36

[QUOTE=LevyDee]... the file fails to open.
[/QUOTE]

[URL="

[QUOTE=paulkinzelman]
I just tried making the routine have a return value and no args and it works.
Then I tried adding in one argument and it fails, so it looks like the problem is with the arguments, not the return value.
[/QUOTE]

This suggests mismatched calling conventions (C# is assuming Stdcall, whereas your export is Cdecl).

The following import probably works in your case:
[code]
[System.Runtime.InteropServices.DllImport("testsub.dll",
CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)]
private static extern int addit(int a, int b);
[/code]

That works, to a point. Things got pretty ugly, though, when I added the old ...
... I only want the #define type statements to pre-process, not the #include.

Perhaps you'd like to 'guard' your [ICODE]#include[/ICODE]s with [ICODE]#ifdef[/ICODE]s, like so ..
[code]
// foo.cpp

ifdef VERNON_COMPILES

include <iostream>

endif

int main()
...
[/code]
[URL="

Something spotted .. what's up with line #1057
[CODE]
for(int j=5; j<-1; j++)
[/CODE]
?

But I am still a bit confused why did it work on old Turboc compilers.

See [URL="

Hmm, I see you've marked this thread as solved, but anyhow ..

The prog works - but I want to be sure

This far I've gathered that your program goes like the following ..
[code]
WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int)
{
HANDLE ghMutex = CreateMutex(
NULL, // default security attributes
TRUE, // initially owned
"AnyName"); // named mutex

if (GetLastError() != ERROR_ALREADY_EXISTS )
{
// I think this is the first instance ...

try 
{
  Application->Initialize();

  // <snip>

  Application->Run();
}
catch (Exception &exception)
{
  Application->ShowException(&exception);
}
CloseHandle(ghMutex);

return 0;

}
else
{
// I think this is NOT the first instance ...
Application->Terminate();
}
return 0;
}
[/code]
To test your program's behaviour, use the below console program, i.e. launch this program first and then begin launching new instances of the main program -- will the instance detection still work?
[code]

include <iostream>

include <windows.h>

int main()
{
// Create an event (the name used here must match the name of your mutex)
HANDLE hEvent = CreateEvent(0, FALSE, FALSE, "AnyName");

if(hEvent)
{
std::cout << "Event handle: " << hEvent << std::endl
<< "Now, start multiple instances of your main program ..." << std::endl
<< "Press Enter to exit.";
std::cin.get();
CloseHandle(hEvent);
}
else
{
std::cout << "Unable to create event, error: " << GetLastError() << std::endl;
}
}
[/code]

commented: very neat idea +1
commented: Yupp, perfect example +3

Your [ICODE]main()[/ICODE] does not have the proper signature for taking arguments, you want to have ..
[CODE]

include <iostream>

include <string>

include <cstdlib>

using namespace std;

int main(int argc, char *argv[])
{
...
[/CODE]
You might also want to check that [ICODE]argc[/ICODE] is equal to (at least) 2.

commented: Danke schon :D +2

It (or any other tutorial) may come in handy later, if not immediately -- I tend to think this way, because you had obvious problems with basic C++ syntax.

How about forgetting the extra array in [ICODE]main()[/ICODE] (do you really need it at this point?), and instead go along the lines of ..
[code]
int main()
{
srand(time(NULL)); // Seeds the random number generator
Heap<int> heap; // The Heap object

while(!heap.isFull())
{
    heap.insert(rand() % 190 + 10);
}

heap.display(); 

while(!heap.isEmpty())
{
    cout << heap.removeMax() << " ";
}
cout << endl;

return 0;

}
[/code]

tips to this Segmentation fault

You might use [URL="

[QUOTE=Toxic_Rice]But I'm a little confused. I thought I did that with the 'SORTED ARRAY:' section ...[/QUOTE]

Yes, you did [I]that[/I] correctly, however, I was suggesting that you might be stepping out of boundaries wrt. the heap's [ICODE]myArray[][/ICODE]

[CODE]void PLAYER::AddExperience(int amount)
{
SetExperience(experience = amount);
}[/CODE]

I'd like to suggest a [URL="

When I tried to put 'return maxItem;' out of the 'if' statement, the compiler is complaining about how maxItem is not defined. Is that what I'm supposed to do?

Strictly speaking: change your code so that you don't get that warning anymore.

About the boundaries, if you have an array of N elements, then you are allowed to access indices 0..N-1, inclusive, i.e.
[code]
const int ARR_SIZE = 3;
// An array, all elements initialized to zero
int array[ARR_SIZE] = {0};

for(int ii = 0; ii < ARR_SIZE; ++ii)
{
// Do something with array[ii] here ..
}
[/code]

Pass the warning options on the commandline i.e.

[ICODE]
g++ -Wall -Wextra[/ICODE]

and first get a clean compile.

As to the surprise number, I believe you might be stepping outside array boundaries, which are 0..N-1, inclusive.

[COLOR="Red"]undefined reference[/COLOR] to `Wait()'

In Code::Blocks, be sure to add the Helper.cpp file ([ICODE]Wait()[/ICODE] is defined there) to your project and rebuild. Do the same with the file containing [ICODE]Crossroads()[/ICODE].

The compiler is not seeing the definitions of these two functions at the moment.

In [ICODE]ReHeap()[/ICODE], comparison is used instead of assignment ..
[code]
if (left < mySize && myArray[left] > myArray[root])
largest == left; // <--- Wrong
[/code]
You should catch this by enabling basic warnings, i.e. compiling with e.g.[ICODE]-Wall -Wextra[/ICODE].

Also in [ICODE]ReHeap()[/ICODE], check that [ICODE]left[/ICODE] and [ICODE]right[/ICODE] are not negative when indexing into the [ICODE]myArray[/ICODE].

and these are the erros i get when i try ot compile it:
main.cpp:4: error: '::main' must return 'int'

See [URL="

Quite likely your project is configured to [URL="

commented: Nice going. +5

and yes i am using OpenProcess(CREATE_THREAD_ACCESS, FALSE, ProcessID);

A mere [ICODE]CREATE_THREAD_ACCESS[/ICODE] is not enough, see [URL="