mitrmkar 1,056 Posting Virtuoso

There's some evil inconsistency ...

In function.h, you declare:

void input(int* &pi, int& n, ifstream &fin);

whereas, in function.cpp you have:

void input(int* &pi,int& n, fstream &fin)

i.e., ifstream vs. fstream.

mitrmkar 1,056 Posting Virtuoso

I would start by verifying that your function calls succeed. I.e., does ImageList_Create(...) succeed? How about the ImageList_AddIcon(...) calls and so on and so forth.

mitrmkar 1,056 Posting Virtuoso

Mostly guessing .. your filename DirectX8.cpp somewhat suggests that the code might actually be originally for DirectX 8 - if that's so, you should check whether CreateVertexBuffer()'s signature has changed in-between the 8 vs. 9 versions (i.e., has DirectX 9 CreateVertexBuffer() dropped a parameter?).

mitrmkar 1,056 Posting Virtuoso

How about using the LPARAM lp? (MSDN: An application-defined value to be passed to the callback function.)

mitrmkar 1,056 Posting Virtuoso

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

mitrmkar 1,056 Posting Virtuoso

I believe your problem(s) have already been pointed out, but ..

anyone know what is this error

Microsoft has documented their compiler/linker error/warning codes, so, you can always look those up on MSDN, for example Compiler Error C2780.

mitrmkar 1,056 Posting Virtuoso

Then again, are you still trying to select a folder using GetOpenFileName() (which is intended for selecting files)?
...
Yes, because the UI is better than any other specific folder dialog, so it would be very nifty to be able to use it.

I was implying that it is highly unlikely that you'd find any kind of solution using GetOpenFileName(), strictly because it is not intended for selecting folders.

I ran the sample from the link you sent me, and it's exactly what it's doing: using the GetOpenFileName() GUI to selecte folders!

The GUI that you're seeing may be alike that of GetOpenFileName(), but the code does not invoke GetOpenFileName(), which (again) is a key point.

I'm still curious to know what I'm doing wrong with the hook function, but I will certainly use your sample instead.

You might post your exact code, maybe someone here might figure out what's wrong with it.

mitrmkar 1,056 Posting Virtuoso

Any idea what I'm doing wrong that prevents pnmh->code from having the real code event?

Not really, except maybe you are still doing some wild stuff ( like say, PostMessage (hdlg, IDCANCEL, 0, lTime); ) and suffering because of it? Or is your switch/case missing a break and you are falling through to CDN_FOLDERCHANGE?

Then again, are you still trying to select a folder using GetOpenFileName() (which is intended for selecting files)?

mitrmkar 1,056 Posting Virtuoso

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.

mitrmkar 1,056 Posting Virtuoso

Uh-oh, the story goes on, i.e., after a Ctrl+F5 (and nothing else) the upload feature disappeared (as described above). Then again, after exiting this thread/article and coming back to it, without doing anything cache-related, the upload feature magically reappeared (in its plentifulness).

Moreover, after clearing the cache, I can confirm that the upload feature is still present (again, in its plentifulness).

PS. I could have sworn that once upon a time, Ctrl+F5 made FF clear the cache, but maybe I'm wrong.

mitrmkar 1,056 Posting Virtuoso

We've seen that one before, and clearing the cache was one of the fixes that corrected it. If you haven't already tried clearing the cache, please do so and see if it helps.

We use a lot of scripting on Daniweb, and occasionally it conflicts with the straight HTML stuff in funky ways when the scripts are out of date. That's why if there's a problem related to scripts, the first suggestion we'll make is to clear your cache.

On FF 18.0.1 (release version) / Windows 7, clearing the cache (Ctrl+F5) resulted in not seeing any upload fields/buttons i.e., clicking on Files gives me the "Files will automatically be attached to the post upon upload. Optionally, you can embed uploaded images within your post." text without a possibility to upload anything -- dang(!)

mitrmkar 1,056 Posting Virtuoso

Testing upload on Firefox 18.0.1 on Windows 7 ...

Hmm, after having pressed Files on the toolbar, I get to see two upload fields+buttons (pic #1).

Now, after having selected a file to be uploaded, I get to see no less than five upload fields+buttons (pic #2).

upload

upload2

EDIT: Just realized that Ancient Dragon already described this 'multitude of upload opportunities' .. duh.

mitrmkar 1,056 Posting Virtuoso

what i missed from requiremnets

Something you certainly missed, the requirements seem to state that:
... For a given positive integer K of not more than 1000000 digits ...

Also, in general, you are not supposed to output anything which is not mentioned in the requirements (I'm referring to the line #45 (cout << "number must less ... )).

mitrmkar 1,056 Posting Virtuoso

You might find people eligible for the chocolate eclair at the Visual C++ forum(s)

mitrmkar 1,056 Posting Virtuoso

Regarding VS2010, i'm getting the following error "Intellisense 'Unavailable for C++/CLI" when using "->" or "::" anyone knows how to correct this error?

Microsoft did not provide the Intellisense feature for C++/CLI in VS 2010, in VS 2012 it is available though -- i.e., you may want to switch to VS 2012 altogether.

mitrmkar 1,056 Posting Virtuoso

World famous lies? Hardly. Try
Trickle down economics works (Reagan)

Here's a picture to accompany your claim .. some Friday humour from Zerohedge ..

mitrmkar 1,056 Posting Virtuoso

All registered members are well familiar with the Member Rules.

mitrmkar 1,056 Posting Virtuoso

The Euro crisis is over.

mitrmkar 1,056 Posting Virtuoso

According to the Wikipedia, the C++ is a programming language

mitrmkar 1,056 Posting Virtuoso

At present there's no feature for marking a single post as being the solution, aside from voting and adding reputation to that post, of course. It's in the cards, just not implemented yet. ;)

In that case, would it be possible to have a feature so that only the reply/replies providing the solution would be displayed (i.e. a kind of new viewing mode)?

mitrmkar 1,056 Posting Virtuoso
tux4life commented: Thank you :P +0
mitrmkar 1,056 Posting Virtuoso

Phew, I got it made! I posted the code here, please study it carefully.

By the way, this is a C++ forum - the C forum is right next door.

mitrmkar 1,056 Posting Virtuoso

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: ... 
}
mitrmkar 1,056 Posting Virtuoso

I'd like to recommend reading about File and Registry Virtualization in Vista/Windows 7 in general - here's one link you could start from: User Account Control Data Redirection

Also, you might have a look at perror().

mitrmkar 1,056 Posting Virtuoso

Thinking about my 92yo grandmother .. I'd add this one:

ITITAN = I think I'll take a nap.

.. and certainly ..

W! = WHAT!?

(She doesn't have a hearing aid yet, but definitely needs one)

mitrmkar 1,056 Posting Virtuoso

Just in case anyone finds the topic interesting enough, somewhat detailed discussion pertaining to Microsoft's implementation can be found at: Mismatching scalar and vector new and delete

.. and Answers to exercises - mismatching new/delete

mitrmkar 1,056 Posting Virtuoso

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.

Ancient Dragon commented: good suggestion :) +14
mitrmkar 1,056 Posting Virtuoso

Are you possibly ignoring (m)any compiler warnings?

mitrmkar 1,056 Posting Virtuoso

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;
mitrmkar 1,056 Posting Virtuoso

A cast like (LPWSTR)Buffer only silences your compiler but does not correct the problem. I'd suggest reading some tutorials ..

The Complete Guide to C++ Strings, Part I - Win32 Character Encodings

The Complete Guide to C++ Strings, Part II - String Wrapper Classes

mitrmkar 1,056 Posting Virtuoso

This one might be a good candidate Windows console tutorial / by Ben Ryves.

mitrmkar 1,056 Posting Virtuoso

If you accidentally hover over, you have to wait for the fade effect to go way.

This is bad, it means that one must watch out for the ads. Why not 'turn this thing around' and perhaps try to emphasize the ad area/frame itself instead?

mitrmkar 1,056 Posting Virtuoso

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.

mitrmkar 1,056 Posting Virtuoso
mitrmkar 1,056 Posting Virtuoso

However, a CURL error keeps coming out when I try to read from "https" protocol....
The error msg is "Error from cURL: Unsupported protocol"

You've probably downloaded a version without SSL support (you need SSL for the https protocol).

mitrmkar 1,056 Posting Virtuoso

I found the base address of the variable, but it changes every time I run Minesweeper.

FYI, it's quite likely that your Minesweeper has been compiled with Address space layout randomization enabled, meaning that the address of the variable will continue to keep changing.

To check whether this feature is enabled, you can use e.g. the following

dumpbin.exe /headers minesweeper.exe

and look for Dynamic Base under OPTIONAL HEADER VALUES as in the following example

**OPTIONAL HEADER VALUES**
        8140 DLL characteristics
               *Dynamic base*
               NX compatible
               Terminal Server Aware
mitrmkar 1,056 Posting Virtuoso

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

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

Rage A Lot commented: Thanks +0
mitrmkar 1,056 Posting Virtuoso

<nevermind>

mitrmkar 1,056 Posting Virtuoso

I'm guessing that ..

//// Instead of ..
// case '1': cout<<student.bla(c); break;

// .. you probably want to have ..
case 1: cout<<student.bla(c); break;
mitrmkar 1,056 Posting Virtuoso

Hmm ... is anyone else experiencing this?

At least Opera 11.61 / Windows 7 works perfectly well (regardless of zoom levels).

mitrmkar 1,056 Posting Virtuoso

In case you plan to submit a bug report, check out the GCC Bugs page.

mitrmkar 1,056 Posting Virtuoso

i want to create array of pointer. "aa" "ab" "ac"

You've forgotten brackets .. {}, i.e.

const char *table[3] = {"aa", "ab", "ac"};
mitrmkar 1,056 Posting Virtuoso

Have you tried the Help forum at Code::Blocks forums?

mitrmkar 1,056 Posting Virtuoso

I receive a segfault when trying to close the second file (fclose(ofp))

This suggests that ofp might be NULL. If it turns out that you are unable to open the output file, perror() is likely to be helpful.

mitrmkar 1,056 Posting Virtuoso

do you have some examples?

You might try the following minimal snippet to see how it works - maybe it will suit you, maybe not.

#include <iostream>
#include <windows.h>

using namespace std;

int main()
{
    // Queue the file c:\temp\foobar.txt for deletion upon next system start up ...
    MoveFileEx("C:\\temp\\foobar.txt", NULL, MOVEFILE_DELAY_UNTIL_REBOOT);

    // If the following displays zero - the operation succeeded, anything else
    // is an error code.
    cout << " GetLastError(): " << GetLastError() << endl;
}

As stated in the MSDN documentation, you need to have write access to a specific part of the system registry.

Oh, and please use the Reply to this Article -button when replying to a post i.e. do not use the Vote & Comment -button for that purpose. ;)

mitrmkar 1,056 Posting Virtuoso

I am confused by the confusion. Click an arrow to just leave a vote. Hover over an arrow and fill out the comment box to leave a comment with your vote. I don't see what's confusing about it?

At least Rasool Ahmed used the voting system as a means to reply to my post (apparently strictly due to the lack of a dedicated Reply -button). So, I was left with a downvote attached with the comment "do you have some examples?". IMO, a more intuitive solution is likely to be in order.

By the way, I'd like to upload an avatar but don't remember the limitations i.e. max. kilobytes/pixels?

mitrmkar 1,056 Posting Virtuoso

Innovative (mis)use of the Vote & Comment -mechanism appears to be on the rise ;) See e.g. the comment on my second post in this thread. I'd imagine that a dedicated Reply -button on a per-post basis will be necessary? As a band-aid, maybe it would help to display only Vote instead of Vote & Comment?

All in all, IMHO, there's been a huge improvement when it comes to Daniweb's visual appearance - much Kudos for that. (Although, blaming Daniweb for being exhaustively purple'ish can still be justified, so to speak.)

mitrmkar 1,056 Posting Virtuoso

what you mean?
is this a script or something?!!!!!:-O

It is a Windows API function. It can be used to delete files upon next system startup - which is what you basically seem to be wanting. So, possibly it may be of help to you - though this depends on what exactly your anti-virus thingy is.

Rasool Ahmed commented: do you have some examples? +0
mitrmkar 1,056 Posting Virtuoso

1>Linking...
1>XorCryt.obj : error LNK2019: unresolved external symbol __imp__CLSIDFromString@8

...it was hard to find the right include file and I am not sure that that is enough.

You still need to look up the necessary library (.lib), documentation CLSIDFromString function usually comes with a section titled Requirements explaining the required header/library files. In this case it is stated that you need to link to Ole32.lib .

mitrmkar 1,056 Posting Virtuoso

I finally found the solution is by removing it in system boot.

Are you aware of the regular MoveFileEx() function? It may provide a working solution in this case (i.e. you'll need to use the MOVEFILE_DELAY_UNTIL_REBOOT flag).