|
how the datetime picker store date
as edit box can store SetDlgItemText()
Please mail me
|
|
|
|
|
yogendra kaushik wrote: how the datetime picker store date
Use CDateTimeCtrl::SetTime() , or if you are not using MFC, send the control a DTM_SETSYSTEMTIME message.
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
hi,
i develop one application in VC++-MFC 6.0 ,
this application is responsible for inserting image into the database (oracle)-ODBC.
but when i try to insert a image file , it through a error like
"Data type conversion error."
////////////////////////////////////////////////////////////////////////
CDaoDatabse db;
CDaoRecordset recset(&db);
void CDBODBC::InsertintoDB();
{
CByteArray BlobFile;
BlobFile.RemoveAll(); // I clear the Array
CFile aFile("image.jpg",CFile::modeRead);
BlobFile.SetSize(aFile.GetLength());
aFile.Read(BlobFile.GetData(),aFile.GetLength());
aFile.Close();
COleVariant aVar(BlobFile);
CString Sql = "SELECT * FROM sample3";
db.Open("abc",FALSE,FALSE,"ODBC;UID=abcWD=abc;DSN=abc;");
recset.Open(AFX_DAO_USE_DEFAULT_TYPE,Sql,dbAppendOnly);
// bool b=recset.CanUpdate();
recset.AddNew();
recset.SetFieldValue("[num]","6"); //varchar field
recset.SetFieldValue("[photo]",aVar); //BLOB field -image field
recset.Update();
recset.Close();
db.Close();
}
/////////////////////////////////////
it works for Access database ..
but i got error in oracle...
"Data type conversion error."
Try again and again,
At last you will say
I don't know the meaning for impossible.,.
|
|
|
|
|
See if this helps.
maharaja pandian wrote:
CDaoRecordset recset(&db);
In addition, if you would derive a class from CDaoRecordset , the RFX_Binary() code would handle the details for you.
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
tnx for ur reply,
but COleVariant is used to store the "OLE object" datatype in .MDB database.
when i use oracle DB , the corresponding BLOB datatype is not get matched with COleVariant class in VC++.
I got the error like " Data type conversion error"
can u please send the details to store the oracle BLOB value
throuh VC++.
Try again and again,
At last you will say
I don't know the meaning for impossible.,.
|
|
|
|
|
|
tnx for ur reply,
but COleVariant is used to store the "OLE object" datatype in .MDB database.
when i use oracle DB , the corresponding BLOB datatype is not get matched with COleVariant class in VC++.
I got the error like " Data type conversion error"
can u please send the details to store the oracle BLOB value
throuh VC++.
Try again and again,
At last you will say
I don't know the meaning for impossible.,.
|
|
|
|
|
--------------------------------------------------------------------------------
I have an HBITMAP. From that I construct a CBitMap obj and Using GetBitMapBits, get the Byte info into a byte array. I also fill up the BITMAPFILEHEADER and BITMAPINFOHEADER. Then i first write the BITMAPFILEHEADER, then the BITMAPINFOHEADER and then the BYte Array of the bitmap into a .bmp file. My bmp comes up but its upside down. I.e the generated .bmp is upside down of the original image. Where am i mistaken?
Reji Kumar,
Software Engineer,
India.
|
|
|
|
|
Perhaps, instead of obsolete GetBitmapBits , you should use ::GetDIBits ? Compare you writing procedure with this one[^].
|
|
|
|
|
|
Hi all,
Instead of opening a Static control(which is subclassed) in a Dialog box,i want to open it in the Mainframe window.
But when i create a variable of the class(subclassed) in the MainFrame(derived from CFrameWnd)and call the Create(with all right parameters) function the control is not visible in the Mainframe window
i'm not able to figure out the reason y itz not showing up.It'll be really great if someone can help me out in this.
Thanks in advance,
rajeev
|
|
|
|
|
When you create the control with Create , be sure the WS_VISIBLE window style is specified, for instance:
myStatic.Create("Test", WS_BORDER | WS_VISIBLE, CRect(30,30,100,100), this, 12345);
|
|
|
|
|
well all those properties have been set properly but still i'm not able to get it right..
-- modified at 9:55 Friday 9th June, 2006
|
|
|
|
|
Is your variable for static control defined as a class member, or as a local variable in CMainFrame::OnCreate ?
In order to work, you have to have a line like CMyStatic mMyStatic; within frame class declaration (in *.h file), and a line like mMyStatic.Create(...) somewhere at the end of CMainFrame::OnCreate function. Where are you creating the control?
|
|
|
|
|
What type of project are you using ? SDI or MDI ? If it's SDI, I think you have to create it on the view, and not on the mainframe.
Cédric Moonen
Software developer
Charting control
|
|
|
|
|
its an SDI application....
the code i've used is
CLed m_led; ///declared in mainframe.h
m_led.Create(...);// in the OnCretae of mainframe.cpp
here CLed is a class derived from CStatic which gives some special features to a static control...
|
|
|
|
|
Did you read and tried the solution that people gave you ? I'm almost sure that Viorel got the point. Did you tried it ?
Cédric Moonen
Software developer
Charting control
|
|
|
|
|
Hey All,
I am using the common open and close dialog boxes used in windows, i.e. OPENFILENAME, GETFILENAME. I can get them to open in the desired directory and have created a filter to display my applications propriatary file type. My problem is that I need to create a filter to display only certian files of that file type.
Example: I have 5 files using .txt
Using my current filter all files of type .txt will be displayed
bob.txt
foo.txt
bob_again.txt
bar.txt
bob_yet_again.txt
I want to be able to display only files that have bob in the title
bob.txt
bob_again.txt
bob_yet_again.txt
I cannot find any information on if this is even possible.
Does anyone know if this is possible?
If so how is it accomplished?
Thanks for your time
Nitefall------------Lost in the land of Win32
|
|
|
|
|
Nitefall2060 wrote: I want to be able to display only files that have bob in the title
Have you tried:
ofn.lpstrFilter = _T("Bob files (Bob*.*)\0Bob*.*\0");
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
We appear to think alike becasue it was the very first thing that I tried.
Unfortunatly this causes everyfile in the entire directory to be displayed,
it no longer even limits the file to the .txt files.
I know you can delimit a string in borne shell or perl the way I want but I have never tired it in windows.
|
|
|
|
|
I tried this and it worked fine:
void main( void )
{
OPENFILENAME ofn = {0};
ofn.lStructSize = sizeof(ofn);
ofn.lpstrFilter = _T("Bob files (Bob*.*)\0Bob*.*\0");
GetOpenFileName(&ofn);
} What else do you have?
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
After messing with this a bit I also got it to work. Thanks alot.
I am now having issues with a variation of this, I am trying to get the name my save and load dialog boxes display, to be dynamic based on the file the user is currently working on.
My application creates several files based on the original file.
For Example: if a user names the original file bob my application will create a bob_section1.txt and a bob_section2.txt.
The purpose of this filter is to only display the files that were created durring a single run of my application.
bob.txt
bob_section1.txt
bob_section2.txt
I can get the filter to work if I statically put in ofn.lpstrFilter = "Bob files (Bob*.*)\0Bob*.txt\0"; Or using a character array called Filtername[256] and building the same filter.
Filtername[256] = "Bob files (Bob*.*)\0Bob*.txt\0";
ofn.lpstrFilter = Filtername;
What I am trying to acomplish is the following
Filtername[256] = "Section files (.txt)\0Filename*.txt\0";
Where Filename is the name of the current file. This way it will display the created file and all of the secondary files created from it.
I have tried
strcpy(Filtername, "Section files (.txt)");
strcat(Filtername, "\0");
strcat(Filtername, Filename);
strcat(Filtername, "*.txt\0\0");
This however fails miserably and I get either No files to display or every file in the entire directory. I am pretty sure it is an issue with the null charcters not getting put into the character array correctly but I am not sure what exactly is going wrong.
Any Ideas.........
Nitefall
|
|
|
|
|
Nitefall2060 wrote: This however fails miserably...
Because of the embedded \0 character(s).
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
DavidCrow wrote: Because of the embedded \0 character(s).
Drat, I thought as much... Is there anytype of work around for this or is my dream of dynamic naming dead.
|
|
|
|
|
You could use memcpy() .
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|