|
Hai all,
I am not able to understand how to use ADO.net in VC++.net. If possible, please guide me.
Ravindra
|
|
|
|
|
See Here[^] and Here[^] maybe it is some helpful to you
whitesky
|
|
|
|
|
That's a pretty broad question. Have you read the MSDN help ? What are you tring to do ? How far have you got ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
hi all. im new here and to windows programming. actually i started out to learn Visual C++. the book i follow first goes thru windows programming basics in C++. i tried out the first prog in the book and got stuck. im using VC 6.0. the prog is here:
#include<windows.h>
int_stdcall WinMain(HINSTANCE hinstance,
HINSTANCE hPrevinstance,
LPSTR lpszCmdline,
int nCmdShow)
{
MessageBox(0, "Hello!", "Title", 0);
return (0);
}
though it is simple, i get error messages that i cannot eliminate. please help.
the errors are:
E:\Program Files\Microsoft Visual Studio\sample1\sample1.cpp(3) : error C2146: syntax error : missing ';' before identifier 'WinMain'
E:\Program Files\Microsoft Visual Studio\sample1\sample1.cpp(3) : error C2501: 'int_stdcall' : missing storage-class or type specifiers
E:\Program Files\Microsoft Visual Studio\sample1\sample1.cpp(3) : fatal error C1004: unexpected end of file found
Error executing cl.exe.
well i dunnot know if this is the right place to post my problem, but i did not find another better place for it. if this is not the right place then tell me.
thx 2 all 4 any hlp.
-- modified at 6:41 Saturday 17th June, 2006
|
|
|
|
|
int APIENTRY WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
// TODO: Place code here.
::MessageBox (NULL,"Hello","1",MB_OK);
return 0;
}
In your code // there should be two underscore signs before stdcall and a space between int and __stdcall
int __stdcall WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
// TODO: Place code here.
::MessageBox (NULL,"Hello","1",MB_OK);
return 0;
}
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
-- modified at 6:51 Saturday 17th June, 2006
|
|
|
|
|
thanks _AnShUmAn_. i tried ur suggestion. it worked.
|
|
|
|
|
See Here[^] maybe it is some helpful to you
whitesky
|
|
|
|
|
iwrote the file by folowing code
CFile time;
time.Open("c:\\abc.txt",CFile::modeCreate|CFile::modeReadWrite );
CString str;
str.Format ("%d",i);
time.Write(str,strlen(str));
time.Close();
UpdateData(FALSE);
So please tell how to read this and how to convert to int.
|
|
|
|
|
For reading from a file directly in CString use
CStdioFile time;
time.Open("c:\\abc.txt",CFile::modeRead);
CString str;
time.ReadString (str);
int i=atoi(str);
time.Close ();
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
thank u very much,
it's working and my project is completed thank u ,
sree.
|
|
|
|
|
|
Again a query 'query'!!
Am i using the Delete query prop here?rather can i use it lik dis?(Hvalue is of number type in Access db)
CString hv;
_Commandptr m_pCommand;
m_pCommand=NULL;
m_pCommand.CreateInstance(__uuidof(Command));
CString strSql = _T("DELETE FROM wcs WHERE Hvalue='") +hv+ _T("')");
m_pCommand->CommandText = _bstr_t(strSql);
m_pCommand->CommandType=adCmdText;
m_pCommand->ActiveConnection = m_pConnection;
_variant_t vRecords1;
m_pCommand->Execute(&vRecords1,NULL,adCmdText);
Using the foll code..How do i retrieve the min value?how do i get to know to which record(in Access db) contains the result??(Hvalue is a number)
_Commandptr m_pCommand;
m_pCommand=NULL;
m_pCommand.CreateInstance(__uuidof(Command));
CString strSql1 = _T("SELECT MIN(Hvalue) FROM wcs");
m_pCommand->CommandText = _bstr_t(strSql1);
m_pCommand->CommandType=adCmdText;
m_pCommand->ActiveConnection = m_pConnection;
_variant_t vRecords;
m_pCommand->Execute(&vRecords,NULL,adCmdText);
|
|
|
|
|
shuchigo_jane wrote: select and delete query
Humm ... Combination of previous posts.
select[^]
delete[^]
Knock out 't' from can't,
You can if you think you can
|
|
|
|
|
v v desperate 4 an ans!!
|
|
|
|
|
shuchigo_jane wrote:
CString strSql = _T("DELETE FROM wcs WHERE Hvalue='") +hv+ _T("')");
Try strSql.Format(...) instead of direct assigning..
shuchigo_jane wrote: Using the foll code..How do i retrieve the min value?how do i get to know to which record(in Access db) contains the result??(Hvalue is a number)
_variant_t vRecords;
m_pCommand->Execute(&vRecords,NULL,adCmdText);
I think vRecords returns the results ,right??
Access the count of min as vRecords.iVal if result returning as integer.
Knock out 't' from can't,
You can if you think you can
|
|
|
|
|
hey the delete worked but the select query didnt...any more suggestions!
|
|
|
|
|
shuchigo_jane wrote: hey the delete worked but the select query didnt...any more suggestions!
Try Format(...) for this also.
Knock out 't' from can't,
You can if you think you can
|
|
|
|
|
Hello All,
Iam makeing a application of Server in which it is going to display the arrival of data.
Which then updates the database.
Can some one help me in doing so.
"Iwant to show data in EDIT BOX".
Q How to display data in EDIT BOX ?
To be more precise iam reading Inbox of a GSM sim in a GSM Modem.
Now if i use debug i get to see a new window which shows all received SMS.
e.g. AT+CMGL="ALL"
Now I want to show the same in Edit Box in a contineous loop.
just to have a visual knowledge that i have received SMS.
Rahul
Rahul
-- modified at 3:48 Tuesday 20th June, 2006
|
|
|
|
|
If you have a variable associated to your edit box and when you get the data you will have to proceed with the following steps:
CEdit::GetWindowText() from the edit window
// Code to append the text from the received to the text from edit window
CEdit::SetWindowText()
I hope I understood your question
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
You can associate two types of variables one is CONTROL(CEdit Control) and TEXT(CString value).
What Anshuman has given is with CONTROl.
You can go other way also....
when you have CString variable associated with Edit box you can directly
modify the string and call UpdateData(..) api.
Cheers
"Peace of mind through Technology"
|
|
|
|
|
Rahul321 wrote: Iam makeing a application of Server in which it is going to display the arrival of data.
Which then updates the database.
Can some one help me in doing so.
"Iwant to show data in EDIT BOX".
Q How to display data in EDIT BOX ?
Your data is arrived in the BYTE format, right??
so, you have to store it into appropriate format while receving and after set into the edit box as suggested in previous posts.
Knock out 't' from can't,
You can if you think you can
|
|
|
|
|
Rahul321 wrote: Can some one help me in doing so.
"Iwant to show data in EDIT BOX".
SetDlgItemText or SetDlgItemInt
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
hi, i was trying to use your program, added a push button to capture the image bitmap using imagecapture() , but i don't unsuccessful. Can you help me?
http://www.codeproject.com/audio/DXCapture.asp[^]
-- modified at 23:11 Sunday 18th June, 2006
|
|
|
|
|
You have to provide more details. What exactly didn't work?
|
|
|
|
|
I want to capture bitmap on "capture video" from "Live video" when I click button "Capture Image" on Dialog. Don't need save this bitmap. How should I do?
(note: I insert a button "Capture Image")
aloha
|
|
|
|