|
Thank you, i incuded just now, there are no errors but in running, when i connect to the database, it returns " unreachable data and driver name no specified".
what's wrong?
salem ,c wiem.
|
|
|
|
|
My database is snapshot and i dont no way is not working when i change in dynaset ?
so far i dont have any ideea how can i make it to run faster ( to load fast in my CListControl !
you have any ideea how ? i have 300.000 records to load !
Bravoone
|
|
|
|
|
doesn't this approach staisfies you ?
|
|
|
|
|
i need all the data to be loaded in my list !
because i dont now mutch about databases i use CListCtrl to search for data ! if is no other way ... i will need help on databases ! ...to search for data and some operations with databases !
Thank you !
and i will wait your answers !
Bravoone
|
|
|
|
|
You must be dealing with CRecordSet class in your application. I assume your code to fill the list is like this,
CRecordSet rs;
rs.Open( CRecordset::dynaset, NULL,
CRecordset::useMultiRowFetch );
while( !rs.IsEOF( ) )
{
for( int rowCount = 0;
rowCount < (int)rs.GetRowsFetched( );
rowCount++ )
{
}
rs.MoveNext( );
}
rs.Close( );
instead make changes to your code like this,
rs.Open( CRecordset::dynaset, NULL,
CRecordset::useMultiRowFetch );
rs.Open( CRecordset::dynaset,
_T( "Select count(*) from Tablename" ) );
for( int rowCount = 0;
rowCount < (int)rs.GetRowsFetched( );
rowCount++ )
{
}
now get first visible row in list control and last visible row .
and query database for those records only. and update rows of list control.
On each scroll you can query for corresponding rows. You can set flat to each rows , to know whether it is updated?
You need to handle this in WM_VSCROLL with wParam value as SB_ENDSCROLL .
|
|
|
|
|
No , you don t understand my class CRecordset is snapshot not dynaset !
and i want to search for data (if is no data in my list , how can i give the answer ?) i don t want to scroll my list ! i have some CEdits with onchange when i search for data in lists !
Bravoone
|
|
|
|
|
May be I'm not getting your problem, from described scenario. But my answer was based on "lazy evaluation" technique. Dont compute,allocate things unless needed.
|
|
|
|
|
if are other that are more fast then afxdb.h please tell me !?
Bravoone
|
|
|
|
|
Flaviu_2006 wrote: if are other that are more fast then afxdb.h please tell me !?
can you reorganize your sentence? I'm not getting you.
|
|
|
|
|
in my CRecord set class i use this file for odbc procedure if are other files like this please tell me ?
Bravoone
|
|
|
|
|
Sorry friend, no idea. Keep you posted if come across any.
|
|
|
|
|
at last is your problem solve
|
|
|
|
|
I have developed a VC++ program based on communication(online program). In
the application,i have used two threads for computation. The working time
of two threads is very less. my query is ...
1)If the thread is opened and closed each time for computation, will
the program memory grow??? or what is the drawback??
OR
Is it advisable to run the thread with sleep mode without closing the
thread??
Help me......
Empty mind is Devils-Workshop
|
|
|
|
|
madhu_v wrote: 1)If the thread is opened and closed each time for computation, will
the program memory grow??? or what is the drawback??
OR
every time when thread is created it will take some memory.. i.e. overhead.., if computation take less time , then why creating thread , why not include in main program!
madhu_v wrote: s it advisable to run the thread with sleep mode without closing the
thread??
yes and no! wholly depend upon the software design.. you can use event or waitforsingleobject to make thread wait
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
Thread creation is a relatively expensive operation, both in space and time. If you spawn a thread and let it run to completion nothing is permanently lost however - assuming of course that your code doesn't contain any memory (or other resource) leaks.
If you’ve got lots of small tasks you want to run in another thread and you spawn a thread for each task you could easily find that the thread creation and destruction time dominates and causes performance problems. One solution to this is to use a thread pool. See the QueueUserWorkItem API.
Steve
|
|
|
|
|
Hi Folks,
I am getting this linker error :
error LNK2001: unresolved external symbol "public: void __thiscall std::_String_base::_Xran(void)const " (?_Xran@_String_base@std@@$$FQBEXXZ)
Does any of you encountered this before ?? am using VS2003 IDE...
Please let me know if you have the solution..
Thanks,
Hariharan.T
|
|
|
|
|
I'm using without problem
<br />
#include <list><br />
using namespace std;<br />
...<br />
std::_String_base a;<br />
a._Xran();<br />
|
|
|
|
|
Hi WhiteSky,
Actualy i dont use this _Xran function...
The problem is i have used Vectors in an unmanaged Dll which am trying to consume in a managed C++ Dll. this is where i get the linker error. any ideas why ??
Hariharan.T
|
|
|
|
|
It is possible to detect from the OS when file is being opened / run?
E.g. double clicking on a desktop / folder icon, or executing through the run command.
Thanks for any help.
|
|
|
|
|
|
i want make a dll by vc6 , and call it by vb6(because the wmi in vc timeout faster than vb, or i can use multithread in vc to cut the wmi connection when time is over)
the program is no err complied and linked
but when i call the fun in vb6, i got an error 0X80010106 when Initialized COM
"Cannot change thread mode after it is set."
i searched it on internet ,i can't understand clearly with "COM CDO STA",
how can i do ? please help me !
---------------------------code------------------------------
__declspec(dllexport) long __stdcall CheckWMI(char * HostIP, char * userName, char * passWord)
{
mainCRTStartup();
HRESULT hres;
// Step 1: --------------------------------------------------
// Initialize COM. ------------------------------------------
hres = CoInitializeEx(0, COINIT_MULTITHREADED);
if (FAILED(hres))
{
........
-------------------------------code---------------------------------------
|
|
|
|
|
this[^] article may be useful for your need.
|
|
|
|
|
difference between the copy constructor and assignment operator
|
|
|
|
|
is this supposed to be a question ? i mean, grammaticaly speaking, you missed the punctuation and the fundamentals of "how to well form a sentence"...
i think you wanted to say : "What is the difference between copy constructors and assignment operators for a know type ?".
well, if yes, the answer is simple. the copy constructor can be called once in an object life (at the beginning), when the operator can be called anytime.
technically, they do what you tell them to do, so the object can result in being in the same state after both operations, but all depends on what you coded there...
|
|
|
|
|
MY QUESTION IS
What the copy constructor is doing we can do the same thing through assignment operator.So what is the advantage of copy constructor
class A
A a;
A b;
a=b;
|
|
|
|