|
Trupti Mehta wrote: ...then I get "Fatal Application Error" window saying application has performed an illegal operation & will be shut down.
Before or after the calls to AfxMessageBox() ?
"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
|
|
|
|
|
<pre>
BOOL CPPage1::OnApply()
{
// TODO: Add your specialized code here and/or call the base class
AfxMessageBox(_T("CPPage1:: OnApply\n"));
g_pView->SendMessage(WM_USERAPPLY);
return TRUE; //CPropertyPage::OnApply();
}
LRESULT CMC_AppView::OnUserApply(WPARAM wParam, LPARAM lParam)
{
TRACE(_T("VIEW::OnUserApply - wParam %x\n"), wParam);
CString t("Operator No = ");
AfxMessageBox(t); // m_sheet.m_page1.m_opNo);
// m_sheet.SetAttributes();
m_sheet.EndDialog(IDOK);
return 0;
}</pre>
OnApply calls the OnUserApply. I get the "Operator No = " AfxMessage & then the fatal error comes.
Thanks
Terry
|
|
|
|
|
Trupti Mehta wrote: AfxMessageBox(t);
m_sheet.EndDialog(IDOK);
What happens if you remove either of these two statements?
"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
|
|
|
|
|
Afx.. was from first. Error is coming from the code attached in first message & in the mean while had also added EndDialog. Will try removing EndDialog & check out next week.
On research I have known that this exception stands if soething is not closed properly. Do you see any other possibility in the attached code or eVC has any internal problem accessing an more than 1 external object which does all database related activitlies. But the methods used here just does retriving objects from map which has all records read from the file.
Thanks
Terry
|
|
|
|
|
I believe WinCE5 uses Unicode, and you have MOST of your code set for that (by using the _T macro).
However, this line
Trupti Mehta wrote: m_opNo = atoi((char*)(LPCTSTR)csValue);
is not Unicode. Use
m_opNo = _tstoi((LPCSTSTR)csValue); instead.
Hope that helps.
Karl - WK5M
PP-ASEL-IA (N43CS)
PGP Key: 0xDB02E193
PGP Key Fingerprint: 8F06 5A2E 2735 892B 821C 871A 0411 94EA DB02 E193
|
|
|
|
|
krmed wrote: is not Unicode. Use
m_opNo = _tstoi((LPCSTSTR)csValue);
Or even better use no explicit cast:
m_opNo = _tstoi(csValue);
Steve
|
|
|
|
|
Hi all,
I'm looking for some snippets of code that show me how to get the individual pixel colors out of a bitmap or other graphic file format. So if it is given a file, it would find out what color each pixel is, and maybe output it to a text file or something.
Any ideas? This is for a really cool project for little kids, and I'm excited to get started. Any guidance would be great.
Thanks for your time,
Michael Fritzius
|
|
|
|
|
matrix2681 wrote: his is for a really cool project for little kids, and I'm excited to get started. Any guidance would be great.
Using GetPixel[^] is an option. Also you can use ::LoadImage to load a bitmap from file.
Nibu babu thomas
Microsoft MVP for VC++
Code must be written to be read, not by the compiler, but by another human being.
Programming Blog: http://nibuthomas.wordpress.com
|
|
|
|
|
|
CImage class has good functions for work with images.
|
|
|
|
|
Hello everyone,
I want to develop an automatic tool or manually using existing tool (e.g. WinDbg) to watch when CoInitialize/CoUninitialize is called. I suspect CoUninitialize is not called the same times as CoInitialize, and I want to get the call stack.
Any ideas or reference documents about how to do this?
(I do not have the full source codes, but I have symbol files. My current ideas is either to add to system level COM Runtime hook to monitor when the two functions are called and get stack trace if possible, or using WinDbg to monitor the two specific function calls -- but I do not know the command in WinDbg. )
thanks in advance,
George
|
|
|
|
|
bp ole32!CoInitializeEx "~.;k"
bp ole32!CoUninitialize "~.;k"
Best Wishes,
-David Delaune
|
|
|
|
|
Thanks David!
Two more comments,
1.
Previously I always use bm other than bp to set a break point. What are the differences between bp and bm?
2.
"~.;k" means?
regards,
George
|
|
|
|
|
Hi,
I am getting problem in retrieving tables from Excel 8.0. For some Excel files it is working fine. But some files it is giving dupicate fine names with garbage values.
like :
'Const#Liens-Book#Page$'
'Const#Liens-Book#Page$'_
'Const#Liens-Book#Page$'Z_1590EFBF_96D2_4D24_A4C9_842D6034FE78_#
'Const#Liens-Book#Page$'Z_3AFA2892_C4CC_49E4_9288_7102C55DF3DE_#
'Const#Liens-Book#Page$'Z_7609B60E_2B6C_4DBB_8D3C_4D38EC883EBD_#'Const"
It should retrieve 'Const#Liens-Book#Page$' only but its giving this many table names and giving error message like "object or provider is not capable of performing requested operation"
I have written code in VC++. Is there any seetings i need to do for excel file.
I am placing the code below :
CoInitialize(NULL);
ADO::_ConnectionPtr g_Connection;
g_Connection.CreateInstance( __uuidof(ADO::Connection) );
strConnection.Format("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\\test.xls;Extended Properties=Excel 8.0;");
g_Connection->Open( (LPCSTR)strConnection, "", "", ADO::adConnectUnspecified );
ADO::_RecordsetPtr recordset = g_Connection->OpenSchema( ADO::adSchemaTables );
CString strTableList;
while ( ! recordset->EndOfFile )
{
CString strTable = (LPCSTR)_bstr_t( recordset->Fields->GetItem( "TABLE_NAME" )->Value );
strTableList += strTable + "\n";
recordset->MoveNext();
}
AfxMessageBox( strTableList );
CString strColumnList;
recordset = g_Connection->OpenSchema( ADO::adSchemaColumns );
while ( ! recordset->EndOfFile )
{
CString strColumn = (LPCSTR)_bstr_t( recordset->Fields->GetItem( "COLUMN_NAME" )->Value );
strColumnList += strColumn;
recordset->MoveNext();
}
AfxMessageBox( strColumnList );
CoUninitialize();
Please help me for this issue. I am waiting for your reply.
Regards
Trinadh
|
|
|
|
|
Hi all,
I want to put a OS check in my program by os check i meant that if i am working on xp then particular work is to be done and if i am working on vista then particular work is to be done.....
How can i differentiate between both the os???
Thanks in advance
|
|
|
|
|
VCProgrammer wrote: I want to put a OS check in my program by os check i meant that if i am working on xp then particular work is to be done and if i am working on vista then particular work is to be done.....
This should help -> GetVersionEx[^]
Nibu babu thomas
Microsoft MVP for VC++
Code must be written to be read, not by the compiler, but by another human being.
Programming Blog: http://nibuthomas.wordpress.com
|
|
|
|
|
Does this [^] help?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
I am trying to develop a RTP Player in vc++.I downloaded vlc open source but compiled in cygwin and able to get exe but I too convert that code to vc++6.0. Can any one suggest me regrading the rtp player
|
|
|
|
|
yaminisridaran wrote: I am trying to develop a RTP Player in vc++.I downloaded vlc open source
Are you trying to develop an RTP player or download and use a third=party one?
yaminisridaran wrote: Does any one have an idea about streaming RTP
No - the RTP protocol is secret[^]
|
|
|
|
|
Yes I am tryiing to develop a rtp player
|
|
|
|
|
Hi everybody,
i perform a PostMessage(WM_NEXTDLGCTL); and the focus is not set on the next
control but is set on the second next control.
Is there a special thing to know?
Big thanks
|
|
|
|
|
do you set the "tab stop" property to true for that control.
Note: If the next control is a list control and you are trying to do a TAB for setting the focus on that control that list SHOULD contain atleast one item before it shows that it gained focus
modified:The tab order for your window can be changed by pressing ctrl+d in resource view(ie design time)
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
modified on Tuesday, June 24, 2008 6:14 AM
|
|
|
|
|
Thansk for your answer
The next control is a DatePickerWnd.
All controls have "TabStop" to TRUE.
If i press the TAB-Key on the control, then the focus steps on the (correct) next control.
But via WM_NEXTDLGCTL it steps 2 controls farer.
If i remove the WM_NEXTDLGCTL, the focus stays on the initial control.
And 2 WM_NEXTDLGCTL sets the focus indeed 4 controls farer
|
|
|
|
|
Probably that's how you've set up the "Tab Order" in design time?
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
The Tab-Order is correct at designtime and during the execution of the application.
Pressing the Tab-Key navigates me correctly trough the view ...
thanks for help
|
|
|
|