|
WM_CREATE and WM_NCCREATE will not be sent to the sub-classed procedure because they have already been sent to the original procedure. But you will get other WM_COMMAND messages and notifications.
|
|
|
|
|
got it, but one small doubt, if i want to set font for a control i usually do it in WM_INITDIALOG or WM_CREATE section, but in this case which Message has to be used for setting font, As i had found this can be done in WM_PAINT section also, but WM_PAINT is triggered every now and then, resulting in extra overload. Please guide which message will be better to set a font for a control in its subclassed procedure.
Thanks..
Regards,
Vishal
|
|
|
|
|
So if you do this before you sub-class the control in the original procedure, does it change after sub-classing?
Don't do it in WM_PAINT . It will be an unnecessary overhead.
Instead, you could define a custom message and do a PostMessage with the custom message to the control after it is sub-classed in WM_INITDIALOG .
|
|
|
|
|
thanx, I will check and update the result. Thanx once again for your guidance.
Regards,
Vishal
|
|
|
|
|
Hi, is there any possible way how to find in a directory where are the different files such as binary, batch, text files and so on, with help by (ifstream, fopen ...) will be always guaranteed that will be opened only the text files??
I imagine the code like that, but this opened a binary files too. Which I don't want. Thank you for your help.
data - is a directory, secretFile - is a file, which I don't know what type it is
string line;
ifstream myfile("data/secretFile");
if (myfile.is_open())
while ( myfile.good() )
{
getline (myfile,line);
cout << line << endl;
}
myfile.close();
}
else cout << "Unable to open file, it's probably might not a text file" << endl;
Thank you for your help.
|
|
|
|
|
You can look at the filename extensions and make assumptions about the content. For example, .exe , .obj and .dll files are expected to contain binary data, and .txt , .ini and .bat are expected to contain text. However, nothing is guaranteed as anyone can create a file with any extension but put their own content inside it. You can examine the content for leading text identifiers (see my tip[^] for further information), CR/LF sequences etc, but again, there is no guarantee that the complete file content will be in the format you assume.
Programming is work, it isn't finger painting. Luc Pattyn
|
|
|
|
|
Thank you I'll look at it
|
|
|
|
|
If you only want to check the filename extension, you can use the _findfirst and _findnext functions or the FindFirstFile and FindNextFile APIs.
|
|
|
|
|
My machine is 64 bit. I have installed visual studio 2005, which by default installed in Program Files(x86). When i start visual studio I am not getting the option of win64 in the configuration manager. Please help me how can I get the option, do I need to reinstall it. I installed it 2 times but still the win64 option not coming. Please help. Thanks Sujan
|
|
|
|
|
|
Hi,
Did you actually install the 64 bit compiler? I am fairly certain that VS2005 does not install the 64 bit compiler in the 'default' installation. You will need to manually choose the 64 bit compiler during the installation.
Best Wishes,
-David Delaune
|
|
|
|
|
Randor is right. VS2005 does not install the 64-bit C++ compiler by default.
So reinstall VS and this time select custom install and check on the 64-bit compiler in components listed.
|
|
|
|
|
you can add x64 support with a 'repair' or 'modify' (forget what they call it these days). no need to install from scratch.
|
|
|
|
|
except for the Express versions AFAIK, they don't offer any choice and always build for "AnyCPU" (unless you start hacking the project files).
|
|
|
|
|
Hello!
I am woring on an MFC app that previews a html page... it works with CHtmlView which uses Internet Explorer.
Is there a way I could preview using FireFox or any installed browsers? Some sort of ActiveX control...
I would like to stay within the app... and trap events (like form submission and ajax)
Any pointers welcome!
Jerry
|
|
|
|
|
|
Oh you good man! Thank you!
|
|
|
|
|
|
|
Hi!
When I'm running a program, it crashes into the "dbgdel.cpp" file, at hte following line:
<pre lang="c++">_ASSERTE(_BLOCK_TYPE_IS_VALID(pHead->nBlockUse));</pre>
The Call stack contains the following:
winRTSimpleApp.exe!operator delete(void * pUserData=0x01ae5064) Line 52 + 0x51 bytes C++
winRTSimpleApp.exe!Entity::`scalar deleting destructor'() + 0x3c bytes C++
winRTSimpleApp.exe!Entity::OnDelete(VariantList * pVList=0x06ac0af0) Line 156 + 0x2b bytes C++
winRTSimpleApp.exe!boost::_mfi::mf1<void,Entity,VariantList *>::operator()(Entity * p=0x01ae5064, VariantList * a1=0x06ac0af0) Line 162 + 0x10 bytes C++
winRTSimpleApp.exe!boost::_bi::list2<boost::_bi::value<Entity *>,boost::arg<1> >::operator()<boost::_mfi::mf1<void,Entity,VariantList *>,boost::_bi::list1<VariantList * &> >(boost::_bi::type<void> __formal={...}, boost::_mfi::mf1<void,Entity,VariantList *> & f={...}, boost::_bi::list1<VariantList * &> & a={...}, boost::_bi::type<void> __formal={...}) Line 293 C++
winRTSimpleApp.exe!boost::_bi::bind_t<void,boost::_mfi::mf1<void,Entity,VariantList *>,boost::_bi::list2<boost::_bi::value<Entity *>,boost::arg<1> > >::operator()<VariantList *>(VariantList * & a1=0x06ac0af0) Line 33 C++
winRTSimpleApp.exe!boost::detail::function::void_function_obj_invoker1<boost::_bi::bind_t<void,boost::_mfi::mf1<void,Entity,VariantList *>,boost::_bi::list2<boost::_bi::value<Entity *>,boost::arg<1> > >,void,VariantList *>::invoke(boost::detail::function::function_buffer & function_obj_ptr={...}, VariantList * a0=0x06ac0af0) Line 153 C++
winRTSimpleApp.exe!boost::function1<void,VariantList *>::operator()(VariantList * a0=0x06ac0af0) Line 989 + 0x17 bytes C++
winRTSimpleApp.exe!boost::signals::detail::call_bound1<void>::caller<VariantList *,boost::function<void __cdecl(VariantList *)> >::operator()<boost::signals::detail::connection_slot_pair>(const boost::signals::detail::connection_slot_pair & slot={...}) Line 120 C++
winRTSimpleApp.exe!boost::signals::detail::slot_call_iterator<boost::signals::detail::call_bound1<void>::caller<VariantList *,boost::function<void __cdecl(VariantList *)> >,boost::signals::detail::named_slot_map_iterator>::dereference() Line 61 + 0x1b bytes C++
winRTSimpleApp.exe!boost::iterator_core_access::dereference<boost::signals::detail::slot_call_iterator<boost::signals::detail::call_bound1<void>::caller<VariantList *,boost::function<void __cdecl(VariantList *)> >,boost::signals::detail::named_slot_map_iterator> >(const boost::signals::detail::slot_call_iterator<boost::signals::detail::call_bound1<void>::caller<VariantList *,boost::function<void __cdecl(VariantList *)> >,boost::signals::detail::named_slot_map_iterator> & f={...}) Line 517 C++
winRTSimpleApp.exe!boost::iterator_facade<boost::signals::detail::slot_call_iterator<boost::signals::detail::call_bound1<void>::caller<VariantList *,boost::function<void __cdecl(VariantList *)> >,boost::signals::detail::named_slot_map_iterator>,boost::signals::detail::unusable,boost::single_pass_traversal_tag,boost::signals::detail::unusable const &,int>::operator*() Line 634 + 0xe bytes C++
winRTSimpleApp.exe!boost::detail::postfix_increment_proxy<boost::signals::detail::slot_call_iterator<boost::signals::detail::call_bound1<void>::caller<VariantList *,boost::function<void __cdecl(VariantList *)> >,boost::signals::detail::named_slot_map_iterator> >::postfix_increment_proxy<boost::signals::detail::slot_call_iterator<boost::signals::detail::call_bound1<void>::caller<VariantList *,boost::function<void __cdecl(VariantList *)> >,boost::signals::detail::named_slot_map_iterator> >(const boost::signals::detail::slot_call_iterator<boost::signals::detail::call_bound1<void>::caller<VariantList *,boost::function<void __cdecl(VariantList *)> >,boost::signals::detail::named_slot_map_iterator> & x={...}) Line 145 + 0x2b bytes C++
winRTSimpleApp.exe!boost::operator++<boost::signals::detail::slot_call_iterator<boost::signals::detail::call_bound1<void>::caller<VariantList *,boost::function<void __cdecl(VariantList *)> >,boost::signals::detail::named_slot_map_iterator>,boost::signals::detail::unusable,boost::single_pass_traversal_tag,boost::signals::detail::unusable const &,int>(boost::iterator_facade<boost::signals::detail::slot_call_iterator<boost::signals::detail::call_bound1<void>::caller<VariantList *,boost::function<void __cdecl(VariantList *)> >,boost::signals::detail::named_slot_map_iterator>,boost::signals::detail::unusable,boost::single_pass_traversal_tag,boost::signals::detail::unusable const &,int> & i={...}, int __formal=0) Line 734 C++
winRTSimpleApp.exe!boost::last_value<void>::operator()<boost::signals::detail::slot_call_iterator<boost::signals::detail::call_bound1<void>::caller<VariantList *,boost::function<void __cdecl(VariantList *)> >,boost::signals::detail::named_slot_map_iterator> >(boost::signals::detail::slot_call_iterator<boost::signals::detail::call_bound1<void>::caller<VariantList *,boost::function<void __cdecl(VariantList *)> >,boost::signals::detail::named_slot_map_iterator> first={...}, boost::signals::detail::slot_call_iterator<boost::signals::detail::call_bound1<void>::caller<VariantList *,boost::function<void __cdecl(VariantList *)> >,boost::signals::detail::named_slot_map_iterator> last={...}) Line 49 + 0x12 bytes C++
winRTSimpleApp.exe!boost::signal1<void,VariantList *,boost::last_value<void>,int,std::less<int>,boost::function<void __cdecl(VariantList *)> >::operator()(VariantList * a1=0x06ac0af0) Line 354 + 0xbb bytes C++
winRTSimpleApp.exe!MessageManager::Deliver(Message * m=0x06ac0a78) Line 253 C++
winRTSimpleApp.exe!MessageManager::Update() Line 286 C++
winRTSimpleApp.exe!BaseApp::Update() Line 181 C++
winRTSimpleApp.exe!App::Update() Line 235 C++
winRTSimpleApp.exe!WinMain(HINSTANCE__ * hInstance=0x00400000, HINSTANCE__ * hPrevInstance=0x00000000, char * lpCmdLine=0x002837c5, int nCmdShow=1) Line 1019 + 0x20 bytes C++
winRTSimpleApp.exe!__tmainCRTStartup() Line 263 + 0x2c bytes C
winRTSimpleApp.exe!WinMainCRTStartup() Line 182 C
kernel32.dll!7506ed6c()
[Frames below may be incorrect and/or missing, no symbols loaded for kernel32.dll]
ntdll.dll!76f9377b()
ntdll.dll!76f9374e()
How to solve this Exception?
|
|
|
|
|
By debugging the program, setting a break-point on this line and examining the var pHead->nBlockUse
Failing that, it's hard to say without seeing some actual code. Though from your stack trace it's happening during the action of delete, which has been called from a destructor.
Oh, & I see the editor munched all of your angle brackets too.
|
|
|
|
|
The assertion is about pHead->nBlockUse being an invalid Block. May be it's null?
Did you check the values of pHead & nBlockUse.
|
|
|
|
|
Or it's been deleted already...
|
|
|
|
|
In my function, Im assignning one Global CString to varaible declared in header file.But it shows unhandled exception error.
My code
CString sReceiceStr = _T("");
void CChatServerDlg::AddMsg( userinfo *udata, CString sIP)
{
sReceiceStr.Format("%s : %s : %s : %s : %s",udata->cSessionID ,udata->cTraineeName, udata->cPassword, udata->cClientServerMsg, udata->cInsName);
sTempassign = sReceiceStr;
It shows error in the above line. It shows error in CStringData GetData() function
Kindly help me.
Anu
|
|
|
|
|
Runtime exception or compile error?
You could try to use the _T macro for the format string - _T("%s : %s : %s : %s : %s")
|
|
|
|
|