Phlex said:
1. ok, so I've got the name and file extension, how can I effectively go
LPCSTR caPaths[Directories.size()];
for(int i = 0; i < Directories.size(); i++)
{
caPaths[i] = LPCSTR("Media/LightProbes/" + Directory[i]);
}
??
LPCSTR caPaths[Directories.size()];
for(int i = 0; i < Directories.size(); i++)
{
caPaths[i] = LPCSTR("Media/LightProbes/" + Directory[i]);
}
??
Firstly you should be using LPSTRs not LPCSTRs as the const will play havoc with you. Secondly you don't seem to have an idea as to how pointers work. You need to allocate the space for the string before you assign to it.
Failing that you could just use the STL string (std::string).
Using that you could re-write that code as
std::string caPaths[Directories.size()];
for(int i = 0; i < Directories.size(); i++)
{
caPaths[i] = std::string( "Media/LightProbes/" ) + std::string( Directory[i] );
}
This way you are letting C++ do all the work. Microsoft also provides a similar string class called CString. Its available under MFC and ATL. Failnig that I'm sure there are several string classes you could use. I wrote myself one recently for some cross platform fun.
Quote
2. What exactly is an "access violation"? I've seen them so many times but never actually known what they are.
An access violation is an exception raised by the operating system. It informs you that you have tried to access some memory you aren't allowed to access (hence access violation). You can easily recreate them by writing to a NULL pointer, writing to a pointer higher than 0x80000000 (in a standard win32 setup) or, simply, by writing to a block of memory that hasn't been assigned to your process (ie allocated).
Primarily I think you need to do more research into what pointers are and how to use them as this does appear to be quite a large hole in your current knowledge.












