|
|
Hi All,
I am doing a project which deals with the basic file operations, like creating a file, renaming a file, copying a file, deleting a file etc.
can anyone suggest me a best way to do this without impacting the performance.
i have to do these operations 10000 times.
thanks
peruv
|
|
|
|
|
File I/O is going to impact performance.
For create/writing the file use CFile. For rename/delete just use the standard Win32 API calls.
Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke
|
|
|
|
|
Try std::fstream .
Maxwell Chen
|
|
|
|
|
In addition to the previous two good ideas, also consider a background app that has no GUI interface of its own, perhaps a dll.
The Means Justifies the Ends
|
|
|
|
|
Hi,
I'm trying to follow the example described at http://www.codeproject.com/dll/XDllPt1.asp to create and use the contents of a DLL from a VC++ application. Problem is that i'm using Visual Studio .NET 2003 instead of Visual Studio 6 in the example.
It seems my project wizard does not have the "Win32 Dynamic Link Library" option. The only kind of project that look like a DLL is named "MFC DLL" and has 3 possible options. 2 of them create an instance of a class that derives from CWinApp and I guess I don't want that. The last option creates a project with a DllMain entry point (just like the example) but there are also some differences (see cpp file below).
So I'm wondering if I can get VS .NET 2003 to behave as VS 6 does (something I didn't see in the project wizard or in the installation setup) or if I must go on using the provided template (meaning there are some good reasons why the template file for a dll has changed in VS .NET 2003).
Thanks for your help.
cpp template file :
#include "stdafx.h"
#include <afxdllx.h>
#ifdef _DEBUG
#define new DEBUG_NEW
#endif
static AFX_EXTENSION_MODULE testdll02DLL = { NULL, NULL };
extern "C" int APIENTRY
DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)
{
// Remove this if you use lpReserved
UNREFERENCED_PARAMETER(lpReserved);
if (dwReason == DLL_PROCESS_ATTACH)
{
TRACE0("testdll02.DLL Initializing!\n");
// Extension DLL one-time initialization
if (!AfxInitExtensionModule(testdll02DLL, hInstance))
return 0;
// Insert this DLL into the resource chain
// NOTE: If this Extension DLL is being implicitly linked to by
// an MFC Regular DLL (such as an ActiveX Control)
// instead of an MFC application, then you will want to
// remove this line from DllMain and put it in a separate
// function exported from this Extension DLL. The Regular DLL
// that uses this Extension DLL should then explicitly call that
// function to initialize this Extension DLL. Otherwise,
// the CDynLinkLibrary object will not be attached to the
// Regular DLL's resource chain, and serious problems will
// result.
new CDynLinkLibrary(testdll02DLL);
}
else if (dwReason == DLL_PROCESS_DETACH)
{
TRACE0("testdll02.DLL Terminating!\n");
// Terminate the library before destructors are called
AfxTermExtensionModule(testdll02DLL);
}
return 1; // ok
}
|
|
|
|
|
Hi! I've got such a question.
Prog using ODBC MS Access (.mdb) (appWizard-SDI-DatabaseView).
In DB I Have a field with time format. So in MySet.h it's Ctime m_MyTime;
I must put this value into edit box. But DDX_FieldText doesn't support CTime (any time) vars.
DDX_FieldText(pDX, IDC_MYTIME, m_pSet->m_MyTime, m_pSet); - prohibited.
I've tried this:
1) changed type of m_MyTime to TIMESTAMP_STRUCT
2) converted time struct to string:
CString strConv;
strConv.Format("%u:%u:%u",m_pSet->m_PlanTime.hour,
m_pSet->m_PlanTime.minute, m_pSet->m_PlanTime.second);
3)call DDX:
DDX_FieldText(pDX, IDC_MYTIME, strConv, m_pSet);
It worked but, when calling MoveNext it asserts dbcore.cpp line 2029
It means (from file):
// If no field found, m_nFieldFound will still be zero
ASSERT(fx.m_nFieldFound != 0);
Any ideas?
Thank you.
|
|
|
|
|
SwordeR wrote: But DDX_FieldText doesn't support CTime (any time) vars.
You need to use RFX_Date() . ClassWizard should have done this for you when the record set was created.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"We will be known forever by the tracks we leave." - Native American Proverb
|
|
|
|
|
RFX_Date() is present. I meant how to make editbox-recorset exchange with DDX_FieldText. Now i'm using through SetWindowText/GetWindowText.
|
|
|
|
|
Is it easily possible to change the exponent bits of a double?
"There are 10 types of people, those who understand binary, and those who don't."
- Somebody, not me.
|
|
|
|
|
In the sense that I want to take the value and decrement it...
"There are 10 types of people, those who understand binary, and those who don't."
- Somebody, not me.
|
|
|
|
|
Maybe this[^] may be of help.
|
|
|
|
|
I'm not exactly sure what you mean. Can't you just multiple or divide by 10 (or 2, depending on what you mean)?
Steve
|
|
|
|
|
Jader89 wrote: Is it easily possible to change the exponent bits of a double?
Yes you can. But before that you have to deduce the meaning of the bits of a double .
THIS (IEEE)[^] should help you a lot.
Maxwell Chen
|
|
|
|
|
Jader89 wrote: Is it easily possible to change the exponent bits of a double?
11 bits comprise the exponent. However, I'm not sure which of the 64 those 11 come from.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"We will be known forever by the tracks we leave." - Native American Proverb
|
|
|
|
|
Hi. I need help displaying my objects properly in DX. I have an app based on the right-hand (RH)reference frame: Z-up, Y-right, X-out of screen (towards user). I would like to come up with a single pair of Rotation and Translation transformation matrices to convert all objects to LH just before display (render), but am having a pretty hard time of it.
I found a bit on this on Microsoft's website, but some parts of it are cryptic, ( "reverse the backface-culling order" and "lay out the cube maps accordingly" ) and other I don't know how to go about ( "Flip the order of triangle vertices so that the system traverses them clockwise from the front. In other words, if the vertices are v0, v1, v2, pass them to Direct3D as v0, v2, v1" ) because I use DX's CreateSphere, CreateCube type functions to create the models.
Can someone point me to a tutorial on how to display RH-based stuff in DirectX?
Thanks in advance.
-Yegor
~NastyImp
|
|
|
|
|
Is it possible to inherit in MFC, such as in...
class CMyView : public CRecordView, public ViewInterface
and then call...
CView* view = GetActiveView();
((ViewInterface*)view)->somefunction();
Regards.
|
|
|
|
|
|
Yes, multiple inheritance is possible.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"We will be known forever by the tracks we leave." - Native American Proverb
|
|
|
|
|
cmdill wrote: CView* view = GetActiveView();
I guess it should be
CMyView* view = (CMyView*)GetActiveView(); Since CMyView implements the ViewInterface .
Nibu thomas
Software Developer
|
|
|
|
|
I think it's only example CView* view = GetActiveView();
and he wants know that is it possible or no
of course that this is true:
CMyView* view = (CMyView*)GetActiveView();
|
|
|
|
|
Hello everyone,
HullBreach is a Source Engine total conversion, a Sci-Fi multiplayer FPS. 90% of our in game assets (models, weapons, sounds etc) have been completed and we are now pushing forward with maps and code. Our project has aided at least 15 people into industry jobs (generally because the concepts were so good the final work looked great on paper).
The project is very well established and known on the mod scene as ambitious but extremely slow going (we're perfectionists). If you are interested in working with the team (and I stress these are volounteer 'unpaid' positions) then please drop an email to jobs@hull-breach.com
Developer (2 posts)
* Should have an object oriented background.
* Solid knowledge of C++.
* A working knowledge of Microsoft Visual Studio 2003 would be preferable.
* Experience with the Source SDK or at least the HL1 SDK would be good.
The developers we are looking for should be able to work as independant people. More often than not we split the workload into small well defined tasks and assign a single developer to that specific task. When you are assigned a task you will be responsible of that task and will answer to the rest of the team in regards to that task. Of course you would have to be able to function as a member of the team at any given time as well, we’re not looking for antisocial behaviour.
You should have a good indepth knowledge of object oriented programming, and a solid knowledge of C++, we’d prefer not to spend too much time to get you up to speed. You should be able to read C++ “fluently” as the existing code has had many hands on it as it is, quite a few on the mod team and god knows how many at Valve.
If you wish to help out with the Linux port of the game logic you should also have a good working knowledge of the GNU Debugger as well and know your way around GCC. C++ knowledge is still an important asset when doing the Linux port.
Don’t forget to tell us about other skills you think might come in handy… anything really…
If you do have experience with the Source SDK or the Half-Life(1) SDK remember to tell us, and preferably give an example of your work where possible.
Applications to jobs@hull-breach.com
- Trax
www.hull-breach.com
|
|
|
|
|
Job ads are not appropriate or acceptable here
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
These are not paid positions, we're looking for help with some of the coding. Should I move the post to a different forum?
|
|
|
|
|
There was nothing in the post that indicated it was an unpaid position (that I could see). You can try here: http://www.codeproject.com/script/jobs/jobs.asp[^]
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|