|
Hello,
I am using of
CDaoDatabase CDaoRecordset Classes and I want to know that How can I use SQL Commands by them?
Like this(I want to have filter)
"select * from Name where name='something'"
and How can I Set a Field to an Edit Object?
Best Wishes,
Thanks.
|
|
|
|
|
the follwing piece of code might help you...
CDaodatabase database;
database.Create("C:\sample_log.mdb");
CString SqlCmd = "CREATE TABLE list (NAME VARCHAR(20), AGE INT, DATE VARCHAR(20), TIME VARCHAR(20));";
database.Execute(SqlCmd);
database.Close();
now to search....
build a query string and execute it...
CString query = "Select * from list where NAME='ABCD'"
CDaoDatabase db;
db.Open("C:\sample_log.mdb");
CDaoRecordSet record(&db);
record.Open(AFX_DAO_USE_DEFAULT_TYPE,query,0);
Then...
while(!recor.IsEOF())
{
.....
use GetFieldValue() for each record in the recordset
}
record.Close();
db.Close();
|
|
|
|
|
hi i want to be able to create folders programaticly
also i want to be able to delete files programiticly
i also need to be able to access a folder and loop through each file in the folder
can someone give me some tips or show me where to look
Thanks
|
|
|
|
|
|
how did you get the text and underline to be differnt colors !
Bikram Singh
|
|
|
|
|
|
It works !
Bikram Singh
|
|
|
|
|
thanks for your time in advance
i programming small video application
i use directdraw to render video frames directly
first i set Surface pixel format to RGB format,
GetDC(&_hdc) worked fine, so i could overlay some text on the screen
but when i changed Surface's RGB pixel format to YUV, problem came out..
video rendering works fine, but GetDC(&_hdc) function failed...
Returned error code is just 0x88760249 (Can't Create DC).
it answers me nothing except it's just failed.
<br />
..<br />
HRESULT res = _surface->GetDC (&_hdc);
..<br />
what might be the cause of this error??
here's some code snippet,,setting pixel format
<br />
...<br />
_srfDesc.dwFlags |= (DDSD_WIDTH | DDSD_HEIGHT | DDSD_PIXELFORMAT);<br />
_srfDesc.dwWidth = width;<br />
_srfDesc.dwHeight = height; <br />
_srfDesc.ddpfPixelFormat.dwSize = sizeof(DDPIXELFORMAT);<br />
_srfDesc.ddpfPixelFormat.dwFlags = DDPF_FOURCC;<br />
_srfDesc.ddpfPixelFormat.dwFourCC = MAKEFOURCC('Y', 'V', '1','2');<br />
..<br />
thanks again and
prompt reply would be appreciated!
|
|
|
|
|
baboguru wrote:
what might be the cause of this error??
Simple. GDI doesn't support YUV pixel formats; it supports RGB only
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
So simple~
thanks you very much Ryan,
Ryan,, i have one more question(i hope its anwser is simple too.. )
Is there any ways to overlay texts on the OffScreenSurface(video buffer)
of which pixel format is YUV, not RGB? or is it possible anyhow?
thanks again
|
|
|
|
|
baboguru wrote:
Is there any ways to overlay texts on the OffScreenSurface(video buffer)
of which pixel format is YUV, not RGB?
You can get a pointer to the raw image data in memory, which you can write to however you like. There are libraries out there which can abstract this into pixels for various pixel formats (AntiGrain Geometry[^] comes to mind), or you can work out the data yourself. But there are no Windows calls to do it for you.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Thank you Ryan~~ now i know what to do
thank you again
|
|
|
|
|
Anyone know of a class for the common dialog Select Folder i cant seem to find one for MFC,
|
|
|
|
|
|
|
i just want to know how to add the letters after a number automaticly like 1st 2nd 3rd 4th 5th the numbers will change day to day
|
|
|
|
|
what i would do is convert the number to a string, then extract the last character and make a switch() statment
if the last character is 1 it will append "st" to the number string
if its 2 it will append "nd" to the number string
you get my point?
need any help on how to go about any of this just ask
|
|
|
|
|
|
Here[^]'s a VB sample. And here[^]'s a Java implementation that you can easily convert to C++.
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
How do you write in mfc to files but manually like
f.write("something");
or similar to that and how do you start a newline in a file output
|
|
|
|
|
Google CStdioFile and use the WriteString() method to write a newline terminated line of text to the file.
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
Hi,
you have either to work with the MFC CFile class or to work with the standad file stream of the C++
using CFile class
CFile myFile;
/* This will cause a file to be created and if there is a file with the same name to be truncated */
myFile.Open("FileName.txt",CFile::modeCreate|CFile::modeReadWrite);
/* This will cause a file to be created and if there is a file with the same name to be appended */
myFile.Open("FileName.txt",CFile::modeCreate|CFile::modeNoTruncate|CFile::modeReadWrite);
char* buf;
CString strData;
strData = "My data";
buf = new char[strData.GetLength()];
strcpy(buf,strData);
myFile.Write(buf);
|
|
|
|
|
how do you record to a file a variable or string by mfc.?
|
|
|
|
|
|
hello
i have a very² simple question to ask
usually we declare member variables thru the class wizard right? what if we have more variables to declare? where should we declare them with the initialization values and how do we make all off them accesible thru every buttons we have? i mean like (in non-MFC) we declare variables in main() and they can be used by every operation in main().
at first i declared a new variable at one of the BN_CLICKED and tried to access it from another button (of course it didn't work) so i tried to add by right clicking in the class view and add member variable but i don't know where to give it a value. thanx for your help!
have a nice day!
~wilDcat~
|
|
|
|