|
Its a suggestion if we suppose that you have 1000 records in your database and now you want to read their you can break their to 1000/5=200 and then create 5 thread in each thread you insert a loop for read of database in last thread on the loop you use from while (!pPlan->IsEOF() ) i think its good than to use a loop for read 1000 records on runtime
|
|
|
|
|
hi i want to unregister the COM dll through code i had registered it through code and it works fine.
Tasleem Arif
|
|
|
|
|
Load your DLL that you want to unregister, and call the "DllUnregisterServer" function of that DLL. Alternatively, you should be calling "DllRegisterServer" to register your COM dlls.
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
HINSTANCE hDLL = LoadLibrary("C:\\BhoNew.dll");<br />
if(hDLL == NULL)<br />
{<br />
AfxMessageBox("DLL can not be loaded..\r\nReason could ");<br />
}<br />
<br />
typedef HRESULT (CALLBACK *HCRET)(void);<br />
HCRET lpfnDllUnRegisterServer;<br />
lpfnDllUnRegisterServer = <br />
(HCRET)GetProcAddress(hDLL, "DllUnRegisterServer");<br />
if(lpfnDllUnRegisterServer == NULL)<br />
{
AfxMessageBox("DLL Entrypoint for function DLLUnRegisterServer could) ;<br />
}
but it gives the messabox above.
i had used this code to register it.
HINSTANCE hDLL = LoadLibrary("C:\\BhoNew.dll");<br />
if(hDLL == NULL)<br />
{<br />
AfxMessageBox("DLL can not be loaded..\r\nReason could ");<br />
}<br />
typedef HRESULT (CALLBACK *HCRET)(void);<br />
HCRET lpfnDllRegisterServer;<br />
lpfnDllRegisterServer = <br />
(HCRET)GetProcAddress(hDLL, "DllRegisterServer");<br />
if(lpfnDllRegisterServer == NULL)<br />
{<br />
AfxMessageBox("DLL Entrypoint for function DLLRegisterServer could not be found..");<br />
}
and it registeed that and worked but problem with unregistering,
Tasleem Arif
|
|
|
|
|
tasleem143 wrote: (HCRET)GetProcAddress(hDLL, "DllUnRegisterServer");
if(lpfnDllUnRegisterServer == NULL)
{//shows this message.
this means that function is not present in your dll. Is it?
|
|
|
|
|
(HCRET)GetProcAddress(hDLL, "DllUnregisterServer");
if(lpfnDllUnRegisterServer == NULL)
{//shows this message.
i had tried this and worked fine,replaced the capital 'R' with 'r' and worked thanks for ur time.
Tasleem Arif
|
|
|
|
|
The unregister functions name is this: DllUnregisterServer, with a lowercase R in unregister.
You typed it like this:
DllUnRegisterServer with a capital R.
Good luck
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
thanks it did work 4 me.
Tasleem Arif
|
|
|
|
|
I am not receiving 'OnReceive' event on receiving data from the network. It seems the library didn't get the frame. I saw the frame on the protocol analyzer but did not get any 'OnReceive' event on the socket. I even checked with synchronous socket (CSocket) but could not receive a single byte. This problem however doesn't always appear. Sometimes it is working and sometimes it is not. What might be the reason for such random behaviour ?
|
|
|
|
|
|
when i use CSizingControlBar,i make the bar floating.
i find the size of bar is same when the bar from dock to floating state.
i want change the size,but i don't know how to do?
|
|
|
|
|
i find how to do that.
when init,modify the size.
|
|
|
|
|
I am over-riding operator new []. I am getting the following error....
c:\Visual Studio Projects\JLib\main.cpp(149): error C2661: 'Object<T>::operator new[]' : no overloaded function takes 3 arguments
The following code results in the above comilation error.
Object<double>* objects;
objects = new Object<double>[5]; // <- error occurrs here
delete [] objects;
If anyone knows what is going on I would very much appreciate an explanation.
Here is the relevant declarations and definitions...
#pragma once
#include <new>
using namespace std;
template <typename T> class Object{
public:
//CONSTRUCTORS ETC ETC ETC
void* operator new[](size_t size) throw(bad_alloc);
void* operator new[](size_t size,const nothrow_t&) throw();
void operator delete[](void* ptr) throw();
void operator delete[](void* ptr,const nothrow_t&) throw();
//OTHER STUF
};
template <typename T> void* Object<T>::operator new[](size_t size) throw(bad_alloc){
Object<T>* data = 0;
if ( (data = ::operator new[](size){
//ommitted for brevity
}
return data;
}
template <typename T> void* Object<T>::operator new[](size_t size,const nothrow_t&) throw(){
Object<T>* data = 0;
if ( (data = ::operator new[](size,const nothrow_t&)) ){
//ommitted for brevity
}
return data;
}
template <typename T> void Object<T>::operator delete[](void* ptr) throw(){
::operator delete [] (ptr);
ptr = 0;
}
template <typename T> void Object<T>::operator delete[](void* ptr,const nothrow_t&) throw(){
::operator delete [] (ptr,const nothrow_t&);
ptr = 0;
}
|
|
|
|
|
You may use
void* operator new(size_t size) throw(bad_alloc);
instead
void* operator new[](size_t size) throw(bad_alloc);
wer ever it is used so ....
RinuRaj
|
|
|
|
|
I need to define an implementatino of the [] version because the instances of Object<t> have data regarding adjacent instantiations when created via new [] . At least logically they do, so it makes sense to set those relationships in the new construction.
|
|
|
|
|
You may check this link ,
http://www.relisoft.com/book/tech/9new.html
This may help you
RinuRaj
|
|
|
|
|
Can you help reproducing this error ?
I tried this way.
template <typename T> class A
{
public:
void* operator new[](size_t t) throw();
};
template <typename T>void* A<T>::operator new[](size_t t) throw()
{
return NULL;
}
int main(int argc, char* argv[])
{
A<double>* objects;
objects = new A<double> [5]; delete [] objects;
return 0;
}
But no error occurs.
-- modified at 1:38 Tuesday 12th September, 2006
|
|
|
|
|
The only difference between your use of the new operator and mine (using your class) is...
Your version:
A* objects;
objects = new A [5];
delete [] objects;
return 0;
My version:
A<double>* objects;
objects = new A<double> [5];
delete [] objects;
return 0;
I dont understand how your code can work without the template type being defined.
|
|
|
|
|
JKallen wrote: Your version:
A* objects;
objects = new A [5];
delete [] objects;
return 0;
Actually, I added < and > there,but suppressed due to html formatting(In all other places I used "andlt and andgt" . I modified it now.
And its working fine. Am I missing something?
|
|
|
|
|
Platform: WinXP, Visual Studio 6
I have a wizard that I created with a propertysheet and 3 propertypages. All have about a half-dozen controls for gathering data. The problem is I don't know how to store the data variables from one page to the next so that at the last page I can use it other than writing it to a file when next button fires.
Thanks!
"Complexity breeds problems. Keep it simple." - Mark
|
|
|
|
|
How about storing the data to the global variables?
Benben
|
|
|
|
|
keep your data in a structure/class, and pass the reference to the each pages. in case of any validation, do it in corresponding page. gotcha?
['Loka Samastha Sukhino Bhavanthu' - May all beings be happy and free]
|
|
|
|
|
Mark F. wrote: The problem is I don't know how to store the data variables from one page to the next so that at the last page I can use it other than writing it to a file when next button fires.
Use variables for storing each control value, in respective propertypage class.Validate its values when user press next button.
In last page, you can use this code.
CPropertySheet *pSheet=GetParent();
CPropertPage* pPage1=pSheet->GetPage(1);
pPage1->Aceess variables;
CPropertPage* pPage2=pSheet->GetPage(2);
pPage2->Aceess variables;
|
|
|
|
|
The common link between all of the pages is the sheet. Store the data there.
"Talent without discipline is like an octopus on roller skates. There's plenty of movement, but you never know if it's going to be forward, backwards, or sideways." - H. Jackson Brown, Jr.
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Thanks to all. I worked it out!
"Complexity breeds problems. Keep it simple." - Mark
|
|
|
|