|
Be aware that the smaller code in VS 2008 is probably due to the NOWIN98 linker setting being automatic. In VS 2005 you can set this in the linker optimization properties. Your app will run slightly slower on Windows 98 as a result, but it will run.
Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke
|
|
|
|
|
|
Hi, In the past I've used a tool that analyzes a visual studio project's resource.h/rc files to ensure that they are not corrupted. (IE: No two resources share the same the ID.)
Does anyone else know of this tool? I forgot its name.
Thanks!
|
|
|
|
|
|
Hello,
Can anyone please tell me how to add my MDI child windows to the task bar so that when a user has multiple documents open they all appear in the task bar like in Word or Excel. I've tried setting the WS_EX_APPWINDOW style of my CMDIChildWnd derived classes but this doesn't seem to work.
Thanks!
Sylv
|
|
|
|
|
|
Hello,
In eVC++ with WinCE5 on ARMV4I, the application is developed.
In my Property Sheet, in a page, on a button click the program executes the following code.
void CPPage1::GetData() {
bool result = true;
CString csValue;
GetDlgItem(IDC_OpNo_EDIT)->GetWindowText( csValue );
m_opNo = atoi((char*)(LPCTSTR)csValue);
csValue.Format(_T("%d"), m_opNo);
AfxMessageBox(csValue);
OperatorDetails od;
od = g_db->GetOperDetails(m_opNo);
CString s(_T("Map Count = "));
s.Format(_T("%s %d \n %s %s"), s, g_db->GetOperMapCount(), _T("Page1::Got OD"), od.GetOperName());
AfxMessageBox(s);
if (od.GetOperatorNo() == 0 && od.GetOperName() == "") {
AfxMessageBox(_T("Operator No Not found. Check Out!"),MB_ICONWARNING);
result = false;
} else if (od.GetOperName() == "") {
AfxMessageBox(_T("Error Reading Data!"),MB_ICONWARNING);
result = false;
}else {
CString nm = od.GetOperName();
m_name = nm;
GetDlgItem(IDC_NAME_LABEL)->SetWindowText(nm);
AfxMessageBox(nm);
EnableConfirm(true);
}
if (result == false) {
m_opNo = 0;
GetDlgItem(IDC_OpNo_EDIT)->SetWindowText(_T(""));
GetDlgItem(IDC_OpNo_EDIT)->SetFocus();
}
return;
}
g_db is an extern variable pointer to an object. I don't get any compiler/liner etc error or warnings. OnApply is called, everything is executed & then I get "Fatal Application Error" window saying application has performed an illegal operation & will be shut down. If problem continues contact vendor. Exception: 0xC000001D Address: 0050328.
If I avoid the above code, then I don't get this exception. Since it is a WincE with eVC application, I can't debug more to know where & what excatly the error line is. Can anyone help me know, what is illegal in the above code which happens to raise this exception.
Thanks
Terry
|
|
|
|
|
Trupti Mehta wrote: Since it is a WincE with eVC application, I can't debug more to know where & what excatly the error line is.
No, I don't quite get it. Can't you use ActiveSync and debug the application straight from your IDE? You could as well use simple message boxes or a log file to analyze at what point the application terminates.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
Rajesh, I use eVC++ & run the application via ActieSync. But I believe that I cannot debug in this scenario. Like On Abort/Retry/Ignore, press Retry & the debugger will come on the error line. No that's not possible.
What all AfxMessageBox, you see all are for debugging purpose only mainly.
Thanks
Terry
|
|
|
|
|
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
|
|
|
|