|
You could use CopyFile(), look it up in MSDN...
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
SHFileOperation could find some use as well
|
|
|
|
|
I created a new database using ADOX. When I go to add ecords to it, they are added haphazardly, not in order. THe latest one might be in the middle somewhere...
How do I ensure that they get added in order?
Heres my code:
try
{
ADO::_RecordsetPtr rsBlob (__uuidof(ADO::Recordset) );
m_pCommand->CommandText="SELECT * FROM tblTest" ;
rsBlob->CursorLocation = ADO::adUseClient;
rsBlob->Open ((IDispatch *) m_pCommand, vtMissing, ADO::adOpenKeyset,
ADO::adLockOptimistic, -1);
rsBlob->AddNew();
rsBlob->Fields->Item["A_Image"]->Value = bstrFile;
char* charID = new char[strID.GetLength()+1];
strcpy(charID, strID);
rsBlob->Fields->Item["MINE_TYPE"]->Value = charID;
delete[] charID;
}
Thanks for helping,
ns
|
|
|
|
|
The SQL database does not guarantees, that it stores records in particular order (even if it often does). It's by design. The order of returned records is defined by the ORDER BY clause of SELECT query.
Pavel
Sonork 100.15206
|
|
|
|
|
Can someone give me a practical example/reason of why classes can contain static member functions, aside from data encapsulation I'm not sure I see their purpose. We were talking about them today in a class that I have and my professor couldn't give me any specific reason as to why we have this. Any ideas would be great as I am just a little curious (aside from those that say "So you can call method X without object instantiation" ). Thanks.
Nick Parker
|
|
|
|
|
I am writing a wrapper for XML in C# at the moment, and one thing that takes a few lines of code normally is to take a node and return the text value, if any, associated with it. node.text simply won't do the job well. By making the function GetNodeValue static, I am able to call it if I have a node kicking around but I don't have an instance of my class. The class essentially becomes a namespace that contains functions which I may have a use for even if I don't have an instance of the class at that point in time, so it saves me building the object needlessly.
Christian
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
Cats, and most other animals apart from mad cows can write fully functional vb code. - Simon Walton - 6-Aug-2002
|
|
|
|
|
Gotcha, I think that pretty much explains it.
Nick Parker
|
|
|
|
|
One of the good uses I've found for static members is factory like functions. If I have a class that I dont' want anybody but me to be able to instanciate I make all of hte constructors private. Then I allow creation through static member functions. This comes in handy sometimes especially in other languages such as C# and Java
Jared
jparsons@jparsons.org
www.prism.gatech.edu/~gte477n
|
|
|
|
|
Sometimes you need a class attribute, which is shared between all instances of the class.
Pavel
Sonork 100.15206
|
|
|
|
|
Pavel Klocek wrote:
Sometimes you need a class attribute, which is shared between all instances of the class.
Could you elaborate?
Nick Parker
|
|
|
|
|
If I have the data in 1.prv and I want embed that data in program while compile.
Can I include like this #include "C:/1.prv"?
Thank you.
|
|
|
|
|
Dunno - have you tried ?
Christian
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
Cats, and most other animals apart from mad cows can write fully functional vb code. - Simon Walton - 6-Aug-2002
|
|
|
|
|
hey all. I am working on a single document MFC program and currently have a problem. Under a CFormView document, there is the GetDocument function. Is there any way to use this function or get the same effect in a CDialog document? Any help is appreciated. Thanks.
Brad Jennings
|
|
|
|
|
CYourDoc *pDoc = (CYourDoc *)(((CFrameWnd *)AfxGetMainWnd())->GetActiveView()->GetDocument()); I guess this is what you're after.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Hi,
I have a vector with pointers to an object. Now for each object I need to call a function Update(float fTime). Now when I write something like this:
for_each(...begin(), ...end(), mem_fun1(CActor::Update(fTime));
fTime is a valid floating point value in the method which calls this algorithm. This does not compile! I tried a variety of alternatives but none compile. Any suggestion on how to compile this?
Jurgen
|
|
|
|
|
Try with
for_each(...begin(), ...end(), bind2nd(mem_fun(CActor::Update),fTime));
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Is there anyone that knows why the following piece of code does not work as it's supposed to?
void CStomGraphDlg::OnSelectMonthcalendar(NMHDR* pNMHDR, LRESULT* pResult)
{
COleDateTime dtSel;
if(m_ctlMonthCalendar.GetCurSel(dtSel)!=0)
{
MessageBox(dtSel.Format("%x"));
// set current selection
GetDlgItem(IDC_STATIC_SEL)->SetWindowText(dtSel.Format(_T("%x")));
}
else
{
MessageBox(_T("Error getting current selection"), _T("Error"), MB_OK|MB_ICONERROR);
}
*pResult = 0;
}
It is supposed to return the date selection in COleDateTime format but the only time it works is after the program has just started, and you select the current date. After changing the selection it crashes and returns invalid date format or something. GetCurSel should return the selection date, right?
Any help appreciated,
Deian
|
|
|
|
|
Deian,
Have a look at this Same problem I perhaps? Only way I could get round it was with GetCurSel( LPSYSTEMTIME pDateTime ) which seemed to return the right result.
Adam.
"I spent a lot of my money on booze, birds and fast cars. The rest I just squandered"
George Best.
|
|
|
|
|
Thanks, I will try that solution ))
Greetings,
Deian
|
|
|
|
|
Hello there,
I run my program from CD, when my program wants to open the database from CD ... my program crashes
I think it's for strange file( .LDB ) because the database can not make .LDB file beside the access database !
How can i change the .LDB path ?????
Please help me !!!
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
The .LDB file is for record locking. Open the database for exclusive use and no ldb file will be generated. See MSDN KB Q208778 (Access2000) or Q136128 (Access95/97) for more info.
Cheers
Steen.
"To claim that computer games influence children is ridiculous. If Pacman had influenced children born in the 80'ies we would see a lot of youngsters running around in dark rooms eating pills while listening to monotonous music"
|
|
|
|
|
This seems like a simple question but I just wanted to know peoples thougths on it.
Is it better to load an entire Megabyte file all at once and parse it through memory, or is it better to parse through it a line at a time consuming minimal memory?
I implemented the second method for large file downloads to an embedded system but I would love to hear what others thoughts are on this issue.
Thanks,
Brian
|
|
|
|
|
You can use memory mapped file.
Pavel
Sonork 100.15206
|
|
|
|
|
You should use file mapping for big files. Otherwise, reading a file one line at a time will have the same result as reading the entire file such as in binary mode using C++.
Kuphryn
|
|
|
|
|
Hi.
Is it possible to sort a map *by value* instead of by key? Moreover, is it possible to declare a map that with a custome sorting algorithm that sorts accord to value? If yes, please give a sample of the sorting function. I can create the function object, but I need to know the parameter.
Thanks,
Kuphryn
|
|
|
|