|
Greetings,
I have a database creation script. I've run the script after changed the path within the 'FILENAME' option to create the database on an external hard disk and I was able to see and select data from tables as the script run with no errors. However, when I tried to connect to the database from an application and read data from database tables, an exception thrown for SQL Server error 823 "The operating system returned error 21(The device is not ready.) to SQL Server during a read at offset 0x00000000132000 in file 'Database name'. Additional messages in the SQL Server error log and system event log may provide more detail. This is a severe system-level error condition that threatens database integrity and must be corrected immediately. Complete a full database consistency check (DBCC CHECKDB). This error can be caused by many factors; for more information, see SQL Server Books Online.". I've tried to run database consistency commands against it but they did not carried out and I got an error message. Also when I tried to drop or recover the database, dropping and recovering process failed. Finally, I had to make the database offline then I dropped it. I need to create such database on my external hard disk not on my primary one. Can anyone help?!!!
|
|
|
|
|
This has nothing to do with C/C++. Please use the Database forum.
|
|
|
|
|
Yeah sure I know. It is my fault I forgot to check in which forum I am posting my question. Sorry, I need now to remove the post from the C/C++ forum.
|
|
|
|
|
Amr.Mohammad87 wrote: Sorry, I need now to remove the post from the C/C++ forum. Can't be done now that your OP has been responded to. At best, it's content will be replaced with "message removed" and all replies will remain intact.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|
My English is very pool,pardon me.This is my first time here.Today I come here to introduce a C++ program library which written by myself.This library called Covariant Graphics Library.This library can run on Linux,based on C++14 standard.If you have some questions about me and my library,just tell me.
|
|
|
|
|
I don't know how to introduce my program because of my pool English.I'm just a normal senior high school student.
|
|
|
|
|
|
|
The only way your library to become popular is to write an article that
describes the basic ideas as well as demonstrates the library usage. 
|
|
|
|
|
CSDNbuxingma?By the way,poor instead pool
|
|
|
|
|
This program doesn't compile and gives me error "Conficting types of L search" . I ran out of all trials and I am so confused why the heck it gives me this error . I would appreciate your contributions to solve my problem .
the function does front back search of an array, if any number matches it sends back its address.
#include <stdio.h>
int main(void) {
int arr []= {1,2,3,4,5,6,7,8,9,10} ;
int req = 5;
Lsearch(arr,&req,10,4);
return 0;
}
void *Lsearch(void *base,void *key,int n,int elemsize)
{
for(int i = 0 ; i<n;i++)
{
void *elemAddr = (char*)base + i*elemsize ;
if(memcmp(key,base,elemsize)==0) return elemAddr ;
}
return NULL ;
}</pre>
|
|
|
|
|
You failed to include a function prototype at the top of the program thus:
void* Lsearch(void*, void*, int, int);
int main(void) {
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
Thank you so much, it worked very well ^_^ , excuse my ignorance still new in this .
|
|
|
|
|
Either
a) supply a prototype for Lsearch() before it is called
or
b) put the definition of Lsearch() before the definition of main()
|
|
|
|
|
Thank you so much, it worked very well ^_^ , excuse my ignorance still new in this .
|
|
|
|
|
Hi
I try to create my own GroupBox (CButton class with BS_GROUPBOX style) control but that class doesn't get any messages from the mouse: WM_MOUSEMOVE, WM_LBUTTONDOWN, WM_LBUTTONUP and etc.
I can't understand why.
Can anyone help me?
|
|
|
|
|
|
I added to .h
afx_msg void OnMouseMove(UINT nFlags, CPoint point);
and to .cpp
ON_WM_MOUSEMOVE()
...
void CMyGroupBox::OnMouseMove(UINT nFlags, CPoint point)
{
}
That works for simple CButton-derived class but with BS_GROUPBOX style it's not work
|
|
|
|
|
|
Thanks a lot
The way with WM_NCHITTEST handler works!
|
|
|
|
|
i had already developed the program but it's not working properly. i am having some confusion on array memory manegment and array arrangement so please do help me to develop this program...
Thank you
|
|
|
|
|
You first need to show us the code that is not working, and explain where the problem is.
|
|
|
|
|
First ask yourself: what constitutes a duplicate value?
Instead of going straight to the keyboard to solve this problem, sit at the table with a deck of cards. Ignoring the suits, lay all (or a portion) of the cards out in front of you. Now working from right to left, work through each card and see if it qualifies as a duplicate per your answer from above. This might look something like:
Compare card 52 to card 51. If they match, remove card 52 from array.
Compare card 51 to card 50. If they match, remove card 51 from array.
Compare card 50 to card 49. If they match, remove card 50 from array.
...
Compare card 1 to card 0. If they match, remove card 1 from array.
An alternative would be if the card is unique, move it to a separate array. Now you can destroy the original array and be left with an array of just unique items.
There are other ways to skin this cat, but it's really going to boil down to what makes the most sense to you. You might not initially have the most elegant or efficient solution as others on this board could come up with, but those skills come in time.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|
I made a image comparison program, but an exception error appeared at iteration number 1350, the code is here:
void compara_face(__int16 cara1[YMAX][XMAX],__int16 centro1[2*3],__int16 cara2[YMAX][XMAX],__int16 centro2[2*3],__int16 zoom_level,__int16 num_filtros,double error[2])
{
error[0]=error[1]=1e199;
if (zoom_level >DMAX) { printf("\nERROR en compara_face() zoom_level =%i > %i",zoom_level ,DMAX);return; }
if (num_filtros>FMAX) { printf("\nERROR en compara_face() num_filtros=%i > %i",num_filtros,FMAX);return; }
double coef[6];
trasformada3p_hallacoef(centro1,centro2,coef);
__int16 (*filtro2)[6]=new __int16[num_filtros][6];
__int16 (*filtro3)[6]=new __int16[num_filtros][6]; ERROR IS HERE!!!!
__int16 d=DELTA[zoom_level],z=zoom_level;
long i;__int16 x1,y1;
transformada3P_dx(coef,FILTROX[z],filtro2,d,num_filtros);
transformada3P_dy(coef,FILTROY[z],filtro3,d,num_filtros);
error[0]=error[1]=0.0;
for (i=0;i<num_filtros;i++)
{
x1=FILTROX[z][i][0];y1=FILTROX[z][i][1];
error[0]+=fabs( (double)(
(cara1[y1][x1 ]-cara1[y1][x1+ d])* (cara2[filtro2[i][3]][filtro2[i][2]] - cara2[filtro2[i][5]][filtro2[i][4]])-
(cara1[y1][x1+d]-cara1[y1][x1+2*d])* (cara2[filtro2[i][1]][filtro2[i][0]] - cara2[filtro2[i][3]][filtro2[i][2]]) ));
x1=FILTROY[z][i][0];y1=FILTROY[z][i][1];
error[1]+=fabs( (double)(
(cara1[y1 ][x1]-cara1[y1+ d][x1])* (cara2[filtro3[i][3]][filtro3[i][2]] - cara2[filtro3[i][5]][filtro3[i][4]])-
(cara1[y1+d][x1]-cara1[y1+2*d][x1])* (cara2[filtro3[i][1]][filtro3[i][0]] - cara2[filtro3[i][3]][filtro3[i][2]]) ));
}
delete[] filtro2,filtro3;
}
The error appear in the second "new" command. The program uses a lot of RAM, perhaps I need to compiler or linker to use more ram or allocate memory as static instead dynamic.
The program uses about 2 gigabytes
modified 17-Dec-15 5:44am.
|
|
|
|
|
Your system has no more free RAM. Then the only option is to provide more (add RAM or use a different system which has more). There are no compiler or linker options to prevent the exception and using static memory would not help (it is even worse).
[EDIT]
See this StackOverflow thread about the 2 GB limit: http://stackoverflow.com/questions/5686459/what-is-the-maximum-memory-available-to-a-c-application-on-32-bit-windows[^]
But the allocation where the exception occurs does not ask for a large amount of memory. The max. allocated size is 786 kB (16-bit int * 6 * sizeof(int16)). So you should check if the other places where the really large amounts of memory are allocated can be optimized (e.g. by deleting memory immediately when it is no longer neeeded).
|
|
|
|