|
I use ADO to connect to database. I connect successfully. But when I run my application with window there's an error :
Debug error :
This application has requested the Runtime to terminate it in an unusual way
Some one plz explain for me & give me a solution
|
|
|
|
|
capint wrote: This application has requested the Runtime to terminate it in an unusual way
Some one plz explain for me & give me a solution [Rose]
Please read the guidelines[^] and rephrase your question in accordance to it. With the information you've provided, I can only tell that there's "something wrong" with your code. That may not be a very helpful reply though.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
I mean that I connected successfully & I used it properly when I directly click on the application file. It just doesn't do well when start with window. Here is a part of my code. Plz help me
iSize = 0;
DateTimeNote Temp;
bool bFlag = true;
Open("Provider=Microsoft.Jet.OLEDB.4.0; \
Data Source=DateNote.mdb");
CString sql;
variant_t vNull;
variant_t TheValue;
vNull.vt = VT_ERROR;
vNull.scode = DISP_E_PARAMNOTFOUND;
CString StrResult;
CString StrSql;
CString StrDateTime;
CString StrDateTimeTemp;
StrDateTime.Format(_T("%i/%i/%i"),DateTime.GetMonth(),DateTime.GetDay(),DateTime.GetYear());
StrSql.Format(_T("SELECT * FROM DATETIMENOTE WHERE NGAY = '%s'"), StrDateTime);
m_pRecordset.CreateInstance(__uuidof(Recordset));
m_pRecordset->PutRefActiveConnection(m_pConnection);
m_pRecordset->Open(_variant_t(StrSql), vNull, adOpenForwardOnly, adLockOptimistic, adCmdText);
while (!m_pRecordset->GetEndOfFile())
{
TheValue = m_pRecordset->GetCollect("GIO");
if(TheValue.vt != VT_NULL)
{
StrResult = (char *)_bstr_t(TheValue);
StrDateTimeTemp = StrDateTime + _T(" ") + StrResult;
Temp.DateTime.ParseDateTime(StrDateTimeTemp, LOCALE_NOUSEROVERRIDE, LANG_USER_DEFAULT);
}
TheValue = m_pRecordset->GetCollect("NOTE");
if(TheValue.vt != VT_NULL)
{
StrResult = (char *)_bstr_t(TheValue);
Temp.Note = StrResult;
}
pTemp[iSize] = Temp;
iSize ++;
m_pRecordset->MoveNext();
}
|
|
|
|
|
Did you try debugging the application? Where is the crash happening?
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
How can I debug the application ? It worked properly when I debug in VC. When window starts, it just announces a message
|
|
|
|
|
capint wrote: How can I debug the application ?
By setting a breakpoint and starting the debugger.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
Can you explain more ? Where to put the breakpoint & how to start the debugger ? I mean with the application (file with the extension .exe)
|
|
|
|
|
You can also print status messages using OutputDebugString[^] and use an external debugger like DebugView[^]to view those messages. Find out where exactly your application is crashing and start investigating that portion of code.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
I think his application is started as a service when windows starts, so it's a bit too late to open VC and attach the debugger
|
|
|
|
|
May be. But I couldn't make out anything from what he said.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
The hint is in the title and in his previous message
|
|
|
|
|
window != Windows for me. I actually thought he is talking about some window. Or may be that I'm not smart enough.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
Naaah, it's just that you didn't use your CPMRU properly
|
|
|
|
|
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
So have you ever tried to connect to database through ADO and make it run with window ? Plz give me some code examples
|
|
|
|
|
I'm sorry if my question is so vague. I meant Windows I put my application path in registry (create a value in ...\Run) and I repeat my application works well when I debug in VC. It just doesn't work when Windows starts
|
|
|
|
|
Have you seen this?
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
I've searched for many hours but I found no result ... Some one has mentioned that problem but they didn't solve it ...
|
|
|
|
|
Have you tried the hotfix from Microsoft?
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
I don't know I will wander some IT forum to ask if anyone has the same problem. Thanks for all of your answers
|
|
|
|
|
capint wrote: I don't know
How can you not know if you've installed a hotfix or not?
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Don't get me started. He may not know. But, you should know it. Just get your CPMRU started.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
hi,
is there any function how to enum fonts and posible size...
I would like to make font dialog as a Paint.exe aplication has.
Or is it posible to change CFontDialog to make it looks like font dialog in Paint.
(without terrible subclassing tricks)
Thankx
viliam
|
|
|
|
|
This might help you out:CFontListBox[^]
BTW, please use the search feature.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|