|
Saurabh.Garg wrote: Something is necessary if removing it means that the system it is part of is no longer usable. Removing integrated debugger from Visual Studio does not mean we cannot program anymore, hence it is not necessary. It just means that it will take longer (potentially) to find bugs in the code. Just look at linux, there are no good integrated debugging enviornemnts (comparable to VS) but it hasnt stopped people from creating some really cool software.
Yeah? I think that I'd do myself a favour and continue to think of the debugger to be an essential part of my day to day development.
Saurabh.Garg wrote: It just means that it will take longer (potentially) to find bugs in the code.
With 3000+ source files in a projects, I think that it would take "a bit" longer to locate bugs, leave alone fixing.
Saurabh.Garg wrote: In my opinion, we are just too much used to integrated debuggger.
Fair enough! Everyone is entitled to have an opinion. In my opinion, I need the debugger and I think that it plays a very crucial role in my daily development activities.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
Rajesh R Subramanian wrote: In my opinion, I need the debugger and I think that it plays a very crucial role in my daily development activities.
Yes debugger is crucial in development and I am not saying that I dont use it. I completely agree with you.
What prompted me to this dicussion was your reply to OP about there is no release mode until program works in debug mode. That implies it is a bad practice to not use a debugger during development. I think it is perfectly fine to work in release mode and swtich to debugger only when a bug needs to be fixed.
-Saurabh
|
|
|
|
|
Saurabh.Garg wrote: I think it is perfectly fine to work in release mode and swtich to debugger only when a bug needs to be fixed.
Again, *you* think that.
I think that it is imperfect to start working right away in release mode. The debug mode means a lot (it does a lot of work for you) and several bugs will go unnoticed in the release mode, which the debug mode is capable of detecting.
It is assumed that you have fixed all the bugs and that you are heading to optimise the program now, when you start to build in release mode. Please read the Debug vs Release article I pointed out earlier; it explains everything in great detail.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
What is the linker complaining about? Multiple defined symbols or undefined symbols.
-Saurabh
|
|
|
|
|
Hi, dear all,
I am working on a project in VC++ and inside it I will invoke a excel file which already xml schema mapping on it, now I can put value to specified cell protect/unprotect workbook, but I don't know how to use Workbook.XmlImport() method to import xml file data to the spreadsheet. How can I do it.
I didn't use #import excel.exe...........
Any suggestion are very welcome!
Andraw
|
|
|
|
|
I forgot to mention that I use OLE and IDispatch interfaces to access excel.
Thanks!
|
|
|
|
|
Hi all vc++ programmers,
I am migrating my project from vs-2003 to vs-2008... i am getting the following linking errors...Actually i have 10 .lib files out of which three .lib files are not getting linked..My application is working sucsessfully in release mode...but not working in debug mode... the errors are:
fwpipd.lib(Fwstbk.obj) : error LNK2019: unresolved external symbol "public: int __thiscall DomDebtInfo::HasBeenBilledForFee(class ATL::CStringT<char,class StrTraitMFC_DLL<char,class ATL::ChTraitsCRT<char> > > const &,class ATL::CStringT<char,class StrTraitMFC_DLL<char,class ATL::ChTraitsCRT<char> > > const &HasBeenBilledForFee@DomDebtInfo@@QAEHABV?$CStringT@DV?$StrTraitMFC_DLL@DV?$ChTraitsCRT@D@ATL@@@@@ATL@@0@Z) referenced in function "protected: virtual int __thiscall CFeeStBaseBkNotes::IsEligible(class DomObject &,class DomObject &IsEligible@CFeeStBaseBkNotes@@MAEHAAVDomObject@@0@Z
fwpipd.lib(fwstlt.obj) : error LNK2001: unresolved external symbol "public: int __thiscall DomDebtInfo::HasBeenBilledForFee(class ATL::CStringT<char,class StrTraitMFC_DLL<char,class ATL::ChTraitsCRT<char> > > const &,class ATL::CStringT<char,class StrTraitMFC_DLL<char,class ATL::ChTraitsCRT<char> > > const &HasBeenBilledForFee@DomDebtInfo@@QAEHABV?$CStringT@DV?$StrTraitMFC_DLL@DV?$ChTraitsCRT@D@ATL@@@@@ATL@@0@Z)
Like this i am getting 362 errors........
I have seen in one of the forums that i should wrap the .lib in a DLL and consume that from my application..but i dont get the point..can anybody suggest me about this..............
and please give me any suggestion to go further.....
tanks in advanceeee
|
|
|
|
|
Did you rebuild all your libraries in VS2008? It looks like an entrypoint name is not defined in one of the libraries, and it may just be that the library needs to be recompiled under the new version of the compier/linker.
|
|
|
|
|
Hi thanks for the reply,,,
Yes i have rebuild all the libraries in vs-2008.Actually i am trying my 2003 code with Vista compatiable.In my company i am taking a remote login to Vista machine where vs-2008 is installed..I am getting the .exe in release mode and not getting in degug mode...I am getting the specified errors...I am getting these errors because the corresponding libraries are not getting linked.
|
|
|
|
|
Vetukuri Raju wrote: I am getting these errors because the corresponding libraries are not getting linked.
Well, you seem to have answered your own question. Get these libraries linked in to your exe file, and it should be OK.
|
|
|
|
|
Hi,I created a complete Explorer window, used a CMFCShellTreeCtrl object associated with a CMFCShellListCtrl object.
And now,i want to make the CMFCShellTreeCtrl to show the items about pdf only! i did this
writing:
void CExplorerListCtrl::OnLvnInsertitem(NMHDR *pNMHDR, LRESULT *pResult) //CExplorerListCtrl:public CMFCShellListCtrl
{
LPNMLISTVIEW pNMLV = reinterpret_cast<LPNMLISTVIEW>(pNMHDR);
// TODO:
CString currentFolder;
GetItemPath(currentFolder,pNMLV->iItem); //pNMLV->iItem is always 0
if (GetSuffix(currentFolder).MakeLower()!=_T("pdf")) //i'm sure GetSuffix(Cstring str) is right
{
DeleteItem(pNMLV->iTem);
}
*pResult = 0;
}
program is always broken off!
Best thanks!
|
|
|
|
|
I want to detect USB pen drive when it is inserted in the PC. My MFC project will list its contents(Files n directories) to allow user to move or copy them.
How to do THIS!
Manmohan Bishnoi
|
|
|
|
|
Have you looked at the WM_DEVICECHANGE message?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Follow my name, to my articles. One of them should do exactly what you want.
Iain.
[modified:] ps, OK, I'll help you be lazy:
Detecting when drives are added or removed[^]
I have now moved to Sweden for love (awwww).
If you're in Scandinavia and want an MVP on the payroll (or happy with a remote worker), or need cotract work done, give me a job! http://cv.imcsoft.co.uk/[ ^]
modified on Monday, September 21, 2009 12:31 PM
|
|
|
|
|
Iain Clarke, Warrior Programmer wrote: Follow my name, to my articles. One of them should do exactly what you want.
Iain Clarke, Lazy Programmer.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
Well, the article is pretty well titled, in an appropriately named section.
So my initial thought was that is they could not even be bothered to follow my instructions, they can do without help!
As you can see, I weakened!
Iain Clarke, Softie Programmer!
I have now moved to Sweden for love (awwww).
If you're in Scandinavia and want an MVP on the payroll (or happy with a remote worker), or need cotract work done, give me a job! http://cv.imcsoft.co.uk/[ ^]
|
|
|
|
|
Thanks, good to know!
/Lazy Moak
|
|
|
|
|
I am using the original thread pool API provided by Windows (Not the latest one present in Vista and above) and I use QueueUserWorkItem[^] to submit new work to the queue.
After the threads start to execute and several work items are queued, is there any way with which I could find out the number of threads alive in the threadpool (including idle ones, if any)? I know that I can be monitoring this with tools like ProcessMonitor from sysinternals. But, that's not what I want. I'm not able to find something like GetThreadCount() the thread pool API.
I do understand that there is no need for me to know this, because the thread pool API guarantees to take care of dynamically creating or destroying threads depending on the work load and other criteria. However, I'm just curious.
Many thanks.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
Rajesh R Subramanian wrote: I was I'm not able to find something like GetThreadCount() the thread pool API.
The CreateToolhelp32Snapshot() function with TH32CS_SNAPTHREAD might be helpful. isnt it?
DWORD GetThreadCount()
{
THREADENTRY32 stThreadEntry = {0};
stThreadEntry.dwSize = sizeof( stThreadEntry );
HANDLE hSnap = CreateToolhelp32Snapshot( TH32CS_SNAPTHREAD, 0 );
if( !Thread32First( hSnap, &stThreadEntry ))
{
return 0;
}
int nCount = 0;
DWORD dwCurrentProcessId = GetCurrentProcessId();
do
{
if( dwCurrentProcessId == stThreadEntry.th32OwnerProcessID )
{
nCount ++;
}
} while (Thread32Next(hSnap, &stThreadEntry ));
return nCount;
}
|
|
|
|
|
Hi Naveen,
Just wanted to quickly say thanks. I don't have VS installed, so I'll have to get back to the development machine to try it. On the other hand, it looks like this is going to return me the number of threads that my application is running. I'll be in a bit of yogurt in that case. I say it because there are threads started and being run from other modules as well (outside of the thread pool code, but within the app) and I want to be able to find the number of threads that specifically belong to the pool. I think I'll need to put in a bit more research.
But this is definitely a good start. Thanks again.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
Hi Rajesh,
Rajesh R Subramanian wrote: On the other hand, it looks like this is going to return me the number of threads that my application is running
ya. I thought if the module is small, you know the count of other threads. BTW where is the option to find out the thread pool's thread count in process explorer?
Rajesh R Subramanian wrote: I want to be able to find the number of threads that specifically belong to the pool. I think I'll need to put in a bit more research.
It's bit interesting. May be by checking the thread entry point we can decided whether the thread belongs to thread pool. How ever I don't know any direct method which returns the thread entry point. Stack walking may not work always if proper pdb files are not available. isnt it?
Any way if you come up with a method I would like to hear about it. Best wishes...
|
|
|
|
|
Naveen wrote: ya. I thought if the module is small, you know the count of other threads.
No, this is a fairly large project (even though the module that uses thread pools is relatively small). But of course yes, I can do my little test with a smaller dummy project.
Naveen wrote: BTW where is the option to find out the thread pool's thread count in process explorer?
There's no direct option as such, but the no. of threads that we create manually (as opposed to being managed by a pool managing algorithm driven by the OS), we have a count of it. Add 1 to it (the application's main thread). Now, we can subtract this number from the number of threads shown by process explorer for our process.
I was thinking of exploiting two things as well:
1. Entry point of the thread (like you said)
2. Do some experimenting with TLS (TLS won't work "properly" with pools, because any thread might execute the thread code, but TLS is guaranteed to be unique for a given thread).
I'll notify you if I post a reply here. But, I need to get some sleep now. I've had a long day.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
Hi,
I'm new to VC++. In C#, I used the event "DocEvents_ChangeEventHandler", to handle the cell changes in Excel file. Please guide me to handle the same in VC++.
Thanks in advance.
|
|
|
|
|
Here's a complete example that fires up Excel and handles some application events - the general principle (registering an object with Excel to handle its events) will be exactly the same for document events, except you'll register the handler with the relevant workbook, I guess and have to change the event handler object to suit the DocEvents as opposed to AppEvents. As you're new to C++, I'd advise you get a little more familiar with C++ (and the Microsoft specific bits of VC++) before diving into this too deeply.
#include <atlbase.h>
#include <atlcom.h>
#import "libid:00020813-0000-0000-C000-000000000046" auto_search no_dual_interfaces rename("DialogBox", "excelDialogBox") rename("RGB", "excelRGB") rename("DocumentProperties", "excelDocumentProperties") rename("SearchPath", "excelSearchPath") rename("CopyFile", "excelCopyFile") rename("ReplaceText", "excelReplaceText")
_ATL_FUNC_INFO SheetChangeInfo = { CC_CDECL, VT_EMPTY, 2, { VT_DISPATCH, VT_DISPATCH } };
_ATL_FUNC_INFO AfterCalculateInfo = { CC_CDECL, VT_EMPTY, 0, { } };
class ExcelAppEventHandler : public IDispEventSimpleImpl<1, ExcelAppEventHandler, &__uuidof(Excel::AppEvents)>
{
public:
ExcelAppEventHandler(bool& doneFlag) : done_(doneFlag) { done_ = false; }
BEGIN_SINK_MAP(ExcelAppEventHandler)
SINK_ENTRY_INFO(1, __uuidof(Excel::AppEvents), 0x0000061c, &ExcelAppEventHandler::SheetChange, &SheetChangeInfo)
SINK_ENTRY_INFO(1, __uuidof(Excel::AppEvents), 0x00000a34, &ExcelAppEventHandler::AfterCalculate, &AfterCalculateInfo)
END_SINK_MAP()
void _stdcall SheetChange(IDispatch *, struct Excel::Range *)
{
done_ = true;
}
void _stdcall AfterCalculate()
{
done_ = true;
}
private:
bool& done_;
};
int _tmain(int argc, _TCHAR* argv[])
{
CoInitializeEx(0, COINIT_MULTITHREADED);
{
Excel::_ApplicationPtr xl;
if (SUCCEEDED(xl.GetActiveObject(__uuidof(Excel::Application))))
{
xl->Workbooks->Add();
bool done = false;
ExcelAppEventHandler handler(done);
if (SUCCEEDED(handler.DispEventAdvise(xl)))
{
MSG msg;
while (!done && GetMessage(&msg, NULL, 0, 0) > 0) {
TranslateMessage(&msg);
DispatchMessage(&msg);
}
handler.DispEventUnadvise(xl);
}
}
}
CoUninitialize();
return 0;
}
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Thank you so much. Your reply is very helpful.
|
|
|
|
|