|
I modify the code,but it dosen't work yet.
(the format of data in the database is date)
_variant_t strQuery;
CString m_time="2005-5-1 12:00:00";
strQuery="select * from job_info where job_recordtime > '"+m_time+"' ";
theApp.ADOExecute(theApp.m_pADOSet,strQuery);
qqworm
|
|
|
|
|
Surround the date/time constant by # instead of single quote:
strQuery="select * from job_info where job_recordtime > #"+m_time+"# ";
The query language of MS Access alway surprises me with its original ideas!
|
|
|
|
|
Oh,Great!it really works. thanks!thanks!thanks!
qqworm
|
|
|
|
|
I seem to recall date literals needing to be surrounded by # like:
strQuery="select * from job_info where job_recordtime > #2005-5-1 12:00:00#";
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
|
Is it possible to calculate the angle of a line given 2 points (x, y) and how?
|
|
|
|
|
yes TWO POINTS (x1,y1) & (x2,y2)(it is a line,so it should have two cordinate points!).....
consider.....
then slope can be said to be : m =(y2-y1)/(x2-x1)
then find the arctan of the slope 'm' ,u get the angle
try googling....to find more info....try this link :http://www.purplemath.com/modules/slope.htm[^]
cheerz.....
"faith, hope, love remain, these three.....; but the greatest of these is love" -1 Corinthians 13:13
|
|
|
|
|
Gee, thanks!
Does this only work on the Cartesian coordinate plane or this can also work with screen coordinates? I want to find the angle of a line plotted by MoveToEx and LineTo API functions.
|
|
|
|
|
itz a mathematical concept....it will work anywhere.....
if u r using the screen cordinates,then u must first make it like the cartesian type(mind u it is already of cartesian type but a little different)
that is.....
in the cartesian type,the origin is designated as (0,0).
for the screen cordinates it is not so,SO u will have to make it like that by shifting the points accordingly(better known as mapping)
say.....
u have a window
where x,y define the length and width of the window respectively!and (x/2,y/2) happens to be the center of the window
u will have to map it to cartesian type.....
and voila....
u have the cartesian type..
now use the formula to get the angle.....by the way....are u doing vector related graphics?.....
cheerz.....
"faith, hope, love remain, these three.....; but the greatest of these is love" -1 Corinthians 13:13
|
|
|
|
|
Angle of line with respect to what? The point (x,y)
I didnt get ur query..
what are the paramenters of line avaialable?
cheers,
Super
------------------------------------------
Too much of good is bad,mix some evil in it
|
|
|
|
|
I'm trying to get the angle of the line plotted with the MoveToEx and LineTo API functions with the points x1, y1, x2, y2.
|
|
|
|
|
Does anybody know if CGdiObject::CreateStockObject requires a call to CGdiObject::DeleteObject once the object is no longer needed ? (I can't find any answer in MSDN!
|
|
|
|
|
Its always better to delete any object which you create. ITs a gud programming ethics.
cheers,
Super
------------------------------------------
Too much of good is bad,mix some evil in it
|
|
|
|
|
Hello,
Mircosofts Reference says:
"It's not necessary (but it is not harmful) to delete stock objects by calling DeleteObject."
|
|
|
|
|
Hi,
I was just refering to usual programming ethics of creation and deletion of objects. My post was not specific to stock objects
cheers,
Super
------------------------------------------
Too much of good is bad,mix some evil in it
|
|
|
|
|
|
I'm making mpegPlayer.
but I cannot add random mode.
when i check random and play music.
'stack overflow' happen and go debug mode.
and No check on Repeat, Random next button clicked random mode has start
What is missing my program?
this is OnNext() -> when i next button clicked has happen
OnNext()
{
srand((unsigned)time(NULL));
int m_nPlayIndexTemp;
int nCount = theApp.GetMainDlg()->m_pDlg_PlayList->m_PlayList.GetCount();
if( theApp.GetMainDlg()->m_pDlg_PlayList==NULL)
return;
if( m_nPlayIndex > theApp.GetMainDlg()->m_pDlg_PlayList->m_PlayList.GetCount()-1 )
m_nPlayIndex = 0;
if( m_bRandom = true )
{
m_nPlayIndexTemp = rand()%theApp.GetMainDlg()->m_pDlg_PlayList->m_PlayList.GetCount();
if( m_nPlayIndexTemp != m_nPlayIndex )
{
m_nPlayIndex = m_nPlayIndexTemp;
}
else
{
OnNext();
}
}
else if ( (m_bRepeat = true && m_nPlayIndex) == nCount )
{
m_nPlayIndex = 0;
}
else if( ((m_bRepeat = false)&&(m_bRandom = false)) == true )
{
m_nPlayIndex++;
}
OnPlay();
}
----------------Please help me!!---------------------------
When you need all source.
Please reply and write your e-mail
|
|
|
|
|
Stack overflow happens in general when you have an infinite recursion (a function that calls itself that calls itself that....). Here in your code, you are calling OnNext until you get a different number of the song that is currently played (or at least, this is want you are trying to do).
First thing, don't call OnNext but rather but the selection of a new song number in a loop. This is really horrible (I mean by code):
if( m_nPlayIndexTemp != m_nPlayIndex )
{
m_nPlayIndex = m_nPlayIndexTemp;
}
else
{
OnNext();
}
rather replace it by something like that:
while (true)
{
m_nPlayIndexTemp = CalculateRandomNumberHere();
if (m_nPlayIndexTemp != m_nPlayIndex)
break;
}
Second, the way you use for calculate random numbers is false:
rand()%theApp.GetMainDlg()->m_pDlg_PlayList->m_PlayList.GetCount();
The modulo operator (%) will give you the remainder of the division. So for example if you have 1 song in the playlist, and rand() gives you 123456, the result will be 123456. Mhh, a little bit outside the bounds of your playlist no ?
Better use something like that:
rand()*nCount/RAND_MAX;
|
|
|
|
|
The info about the modulo operator is wrong. Modulo will give you the remainder, correct, but the remainder of 123456/1 is, have we guessed it yet, 0!!!
Any integer divided by 1, will leave no remainder. Similarily any integer divided by 2 will leave a remainder of 0 or 1, any integer divided by 3 will leave a remainder or 0, 1, or 2. And so on...
So the ouput of that expression will be inside your bounds if you have 1 element in your array. Also it will be in your array's bounds aslong as the size of the array is equal to (or greater than) the number of items in your playlist.
Be careful to check that if theApp...PlayList.GetCount() returns 0, (i.e. your playlist has no entries), that you don't calculate rand()%theApp..GetCount(), as rand()%0 will cause a 'Divide By Zero exception'.
|
|
|
|
|
one can burn cd disc or dvd disc with dvd-r drive, right?
the problem is that...
then an application can possibly know which media,
cd or dvd disc is inserted?
so that an application let users know how much data, 700M or 4.7G they can burn,..
is it possible or not to know in advance
(before burning started) ?
|
|
|
|
|
A CDR/RW has a "pre-burnt" area called ATIP (Absolute Time In Pregroove).
Most burners are able to read that area. (The ATIP isn't readable by a CD/DVD-ROM).
You read it by means of a SCSI-command to the burner.
That area givs you the recording time (for this disc) in minutes, seconds and frames.
As far as I can remember, a DVD has a similar area, but I can't remeber it's name right now.
But as usual, Google is your best friend...
|
|
|
|
|
While building a COM exe which is created using ATL COM App wizard, I got an link error "uuid.lib(comcat.obj) : fatal error LNK1103: debugging information corrupt; recompile module" .
What is the problem here and what will be the solution?
Thanx in advance..
|
|
|
|
|
I'd be starting with a clean and rebuild all. That appears to be what the system is telling you to do.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I had tried that also....
Another point is I had do nothing in the code that ATL COM App wizard created for me.
|
|
|
|
|