|
be more specific on your question.
|
|
|
|
|
For example, if today is 2012 Jan 1st, the computer boots and then enter the windows system by itself. But I doknow how to call the bios to set it.
|
|
|
|
|
|
|
I am currently taking data from a database that is in the form of char data and attempting to convert to a string and then saving in a char array. It appears that these strings have to be saved in a two dimension array. The first array or inner array containing each element of the date in the form of chars. The outer array then contains each record or occurance of the date. Can someone help me in copying the string data into the array? Listed below is what I have so far.
char Date1[10] = {};
vFieldDate = rec->Fields->GetItem("Date")->Value;
for(int r = 0; r < 1; r++)
{
for(int c = 0; c < 10; c++)
{
strcpy (Date1,vFieldDate);
strcpy (Date[r][c],Date1[10]);
printf ("%s",Date[r][c]);
}
}
|
|
|
|
|
Mike Certini wrote: strcpy (Date[r][c],Date1[10]);
strcpy (Date[r][c],Date1); is correct.
Hope you have declared char Date[MAX][10] (where MAX will be greater than or equal to l) , or dynamically allocated memory for it.
|
|
|
|
|
Through research the following was derived from an MSDN website:
#define ARR 65500 //Total Records
#define TARGSIZE 11 //Field Length
char Date[ARR][TARGSIZE] = {};
orig = rec->Fields->GetItem("Time")->Value;
const size_t newsize = 100;
char nstring[newsize];
strcpy_s(nstring, (char *)orig);
strncpy(Date[cyc],nstring,TARGSIZE - 1);
printf("%s",nstring);
printf("\n");
Original MSDN website:
http://msdn.microsoft.com/en-us/library/ms235631(v=vs.80).aspx[^]
|
|
|
|
|
Why not:
strncpy(Date[cyc], (char *)orig, TARGSIZE - 1);
strncpy(Date[cyc], (char *)rec->Fields->GetItem("Time")->Value, TARGSIZE - 1);
I must get a clever new signature for 2011.
|
|
|
|
|
Gentlemen,
I hope everyone is having a good day.
I have an problem with my .dll that is linked to Excel.
I have 2 functions in the file, they are named in the def file and they work fine.
I added a third this morning, added name to def file.
I declared it in VBE.
For some reason, when I try to type it into a cell and give it a variable, i.e. cell formula is =Hs_P(B8),
immediately Excel has an error and shuts down. I am very perplexed.
Any ideas? Have I given enough information?
This is the error Excel is throwing out "Excel asertion error"
And the line from the code _ASSERTE(_BLOCK_TYPE_IS_VALID(pHead->nBlockUse));
I haven't found the problem, but I believe it is the way I am calling one function from inside of another function.
|
|
|
|
|
Assuming you are talking about some C++ code then you may need to use your debugger to find exactly where it is failing. From the information provided above you have an invalid pointer somewhere.
I must get a clever new signature for 2011.
|
|
|
|
|
This function seems to be causing the assertion failure, but I cannot se why, it compiles without error.
I think I found the error, it appears I cannot delete the arrays before I return x, does anyone know this to be true?
delete [] J0;
delete [] n0;
delete [] Ir;
delete [] Jr;
delete [] nr;
return(x);
}
modified on Thursday, January 27, 2011 5:35 PM
|
|
|
|
|
You can't create any memory errors or access violations without destabilizing Excel.
|
|
|
|
|
Having looked at the code in your original message I see the problem. You are instantiating your arrays on the stack by statements such as:
double J0[10] = {0, 1, -5, -4, -3, -2, -1, 2, 3};
and then trying to dispose of them by delete . This is the cause of your problem, you cannot delete a variable that was not created with new . Stack variables will be disposed of automatically when the function returns.
I must get a clever new signature for 2011.
|
|
|
|
|
Hi all,
I have a CFormView, and a child CListCtrl control. I can handle
accelerator events, like Ctrl+C, Ctrl+V ... in CFormView without
problem, by defining below message handler:
ON_COMMAND(ID_EDIT_COPY, &CMyFormView::OnEditCopy)
Now I want my CListCtrl handle these commands differently. I want to
implement OnEditCopy in CListCtrl class, rather than implement logic
in the view class. How can I pass the accelerator events from CView to
child control, when CListCtrl is on focus? I tried like:
ON_CONTROL_REFLECT(ID_EDIT_COPY, &ThisClass::OnEditCopy)
But it does not work.
|
|
|
|
|
Have a look here[^], I'm not sure if it's posted by you as well (exact same wording of the question), but it appears to have been answered to the poster's satisfaction.
modified 13-Sep-18 21:01pm.
|
|
|
|
|
how we write the c-program of sorting the set of point. w.r.t. convex polygon
|
|
|
|
|
how we write the c-program of sorting the set of point. w.r.t. convex polygon
|
|
|
|
|
Uh, what ?
Could you please explain your problem in more details so that we can understand what you are looking for ?
What is your problem exactly ? What did you try yet ? Where are you stuck precisely ? ...
|
|
|
|
|
Why don't you try to explain better your requirements instead of reposting (and cross-posting) your question?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Do you have the skills necessary to write a C program? If the answer is yes then you can use the simple or STL sort[^].
I must get a clever new signature for 2011.
|
|
|
|
|
Like others already pointed out, your request is rather unspecific. You mention sorting, a 'set of point(s?)' and a convex polygon. What are the predefined parameters of the problem, how do they relate to each other, and what, exactly, is the desired end result?
Just out of interest (about google more than your question) I've put the above terms into google and one of the first useful results is Arrange points so polygon is not self intersecting.
Is this what you try to achieve?
|
|
|
|
|
I test MFC classes to download files from internet server , but how can I upload it ? Can I use the same classes / tehnique ?
|
|
|
|
|
mesajflaviu wrote: Can I use the same classes / tehnique ?
Most likely, but since you did not show any specifics on how you were downloading, we can't say with any certainty.
"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
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
Ok , here is my download code , which goes perfectly :
( I don't know if is corectly , but does function )
BOOL CMyDoc::GetXmlFile(CString sAddress, CString& sResult)
{
CString sTemp;
CInternetSession ISession;
CInternetFile* pIFile = NULL;
CMainFrame* pFrame = (CMainFrame*)AfxGetMainWnd();
try
{
pIFile = (CInternetFile*)ISession.OpenURL(sAddress);
while(pIFile->ReadString(sTemp))sResult += sTemp;
pIFile->Close();
delete pIFile;
}
catch(CException* pException)
{
delete pIFile;
pException->GetErrorMessage(sTemp.GetBuffer(255),255);
sTemp.ReleaseBuffer();
pFrame->SetMessageText(sTemp);
return FALSE;
}
return TRUE;
}
I will be very glad if you can help me . Thank you very much !
|
|
|
|
|
So then can't you just use WriteString() to upload the file?
"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
"Man who follows car will be exhausted." - Confucius
|
|
|
|