Just wondering if its possible to make a program in C++ that would be able to open EXE's made in MultiMedia Fusion 2 and SWF's for Flash. Reason being is me and a few mates have been working on a project lately and I'm wondering if c++ would be possible to make a Menu that could open other .exe and .swf files inside it?
error C2664: 'ShellExecuteW' : cannot convert parameter 2 from 'const char [5]' to 'LPCWSTR'
I've dealt with these errors before and for the life of me can't remember what to do it get rid of them. I'm still searching now but if you beat me to it would be a help lol.
The code is changed back to originally how you had it. But now it's giving me this:
1>.\LoadFile.cpp(5) : error C2446: '<' : no conversion from 'HINSTANCE' to 'int'
1> There is no context in which this conversion is possible
1>.\LoadFile.cpp(5) : error C2040: '<' : 'int' differs in levels of indirection from 'HINSTANCE'
to work fine but I was wondering if the above can be fixed - What advantages it'll give me over using system (as I don't like using system) anyway. And just wondering if I can make the files open like they are in a sandbox etc. Opening inside one another.
According to the MSDN -- which I suggest you check whenever you get this type of errors before asking -- the HINSTANCE thing is there just for backwards compatibility with 16-bit Windows. All you need to do is cast the returned value to an int, and then make the comparison.
Well for your information I did check MSDN for error 2446 and 2040 but considering I'm not a great programmer I'm unsure so I prefer to come here for answers as I do normally get someone pointing me in the right direction with good information.
I do understand casting but In a situation like this I'm not to sure how to do the right cast? So if someone wouldn't mind showing me which cast to use - it would be a great help.
I'm looking over it now but not sure if I'll find it. (Not the best debugger) I look forward to the next couple of years when I'm a lot better at this :)
I only ask because the Microsoft docs, say that you get a LNK2028
When attempting to import a native function into a pure image, remember that the implicit calling conventions differ between native and pure compilations.
This is the second time recently[1] that this has cropped up.
I think my problem must be I'm not linked with the shell32.lib
EDIT:
Alright just included shell32.lib and it worked a charm - man didn't think I'd need to include anything like that. Thanks a heap for all the help on this guys!