Hi, I haven't programmed in years and I'm trying to create a simple program for the school I work in that will change a file extension when the files are dropped on to it. Having worked my way around all sorts of stupid little showstopping problems I've finally gotten to one I can't crack myself.
I've narrowed it down to this line: String ^sOldName = (String ^) e->Data->GetData(DataFormats::FileDrop, false);
It builds and doesn't even crash when I'm using it but when I call the DragDrop function it runs this line and exits out the function. I've found other people getting a NULL return but I'm not even getting any more code running within the function after it hits this line.
This is the error that the debugger (well, that little window at the bottom) returns after I exit the program: A first chance exception of type 'System.InvalidCastException' occurred in Canon Fixer.exe
I'm trying to be a good newbie and solve problems myself but I'm struggling to narrow down help to just Visual C+ 2010 (the line I'm struggling with was ripped off the internet) so if anyone can point towards some good help I'd appreciate that as well.
I didn't realise I was using any .Net libraries. Or am I automatically using .Net as soon as I use Visual Studio for some reason. For a tiny little program like this is supposed to be I really just wanted it to be a single exe.
If I were to fancy Sweeping the dust off my C++ knowledge would VC++ be a good way to do it or is there something else? I didn't really fancy creating console applications purely because if I were to create applications for myself I would normally need form based tools.
And btw, I still haven't solved the problem if anyone can help.
Technically the language is C++/CLI. The project templates under CLR use C++/CLI and I believe a version of VC was generally referred to as C++.net (but that used managed C++ mC++); but I think most would know what you are talking about.