I have a part of code in C++ that I have to port in Java:
GetModuleFileName(AfxGetInstanceHandle(),strPath.GetBuffer(MAX_PATH),MAX_PATH - 1);
strPath.ReleaseBuffer();
I'm not really sure how to go about this. I do not have much experience in C++, especially with windows functions. The business logic of what I'm trying to create is this:
We want to create or edit an HTML file and save it as:
strPath+"CaseRerorts.htm"
The C++ side of the code uses:
ofstream ofile(strPath, ios::trunc|ios::app, filebuf::sh_read);
and then writes stuff on ofile
.
If the htm file exists then override it with a new one.
I'm guessing I'm gonna have to use OutputStream and PrinstStream. The main problem however is that I do not know how to get the strPath to be the same as the one in the C++ version of the code. Any ideas? Thanks.