|
After using VS.NET c++ for several hours and doing many "find in file" operations. Find in files will hang at the begining of a search and you will not be able to interrupt it. If subsequently you try to do a normal Find the whole application hangs.
Has anyone else noticed this?
I seen a newspost saying that pressing ctrl scroll
lock may fix this, but I tried that and it does not work.
I am using Microsoft Development Environment 2003 Version 7.1.3088 under Windows XP.
|
|
|
|
|
Hi.
I'm using FindFirstChangeNotification to get an event about a new file being created in a specific directory. for some odd reason, calling DeleteFile on that file doesn't do anything.
Even when calling the deleteFile after calling CloseChangeNotification.
Any idea ?
|
|
|
|
|
Have you tried using ::GetLastError() after the delete to check why it fails? Also from memory you can't delete r/o files.
Neville Franks, Author of ED for Windows. Free Trial at www.getsoft.com
|
|
|
|
|
Is the file on your local drive or on a network drive? I could not get it to work on a network drive, only on my local c: drive. I have found some articles on the internet that says it works with network drives and other articles that says it does not work with network drives.
|
|
|
|
|
Hi,
How do i toggle a checkbox? if lets say i want it to be FALSE initially...the moment i click on it...i want it to be TRUE, and so on...how do i do that?? Also, how do i get the state of the check box? Thanks 4 ur help!!
|
|
|
|
|
checkbox is button with style as BS_CHECKBOX
Use GetState() and SetState() of CButton class.
The chosen One
|
|
|
|
|
If you give it the BS_AUTOCHECKBOX style, it toggles automatically when you click.
otherwise, as already said, it's internally a BUTTON class, you can query and change the check state with BM_SETCHECK and BM_GETCHECK (or CButton::SetCheck, GetCheck)
"Vierteile den, der sie Hure schimpft mit einem türkischen Säbel."
sighist | Agile Programming | doxygen
|
|
|
|
|
Hi all,
I have the file strings.mc (from the message compiler).
i want to read it using CStdioFile class....
performing :
CStdioFile file(szFile,CFile::modeRead);
char buff[MAX_PATH];
do
{
file.ReadString(buff,MAX_PATH);
} while (buff != NULL);
doesn't work so good.....
can any1 help?
thanks in advanced
Yaron
Ask not what your application can do for you,
Ask what you can do for your application
|
|
|
|
|
Hi,
add "_UNICODE" in project/settings/C++/general/Preprocessor definations.
CStdioFile file;
CString str;
while( file.ReadString(str))
{
//Do something
}
if u get any linking error with libraries starting or ending with "u" (e.g. uafxcwd.lib), then u need to install unicode support for VC ide on ur machine.
The chosen One
|
|
|
|
|
thanks
Ask not what your application can do for you,
Ask what you can do for your application
|
|
|
|
|
You need to take into consideration using TCHAR instead of char cause all the charaters in your program are in two bytes.
Sonork 100.41263:Anthony_Yio
|
|
|
|
|
Hello,
(VC++ 6 SP5)
I have a simple MFC dialog-based app with ActiveX control in it.
This is a control written by friend of mine.
VC created a nice wrapper class for me.
Control displays just fine during execution.
THE PROBLEM:
When I try to access a method from the wrapper class, the program compiles
BUT during execution MFC throws exception : Wrong number of parameters.
BUT THE NUMBER OF PARAMETERS IS GOOD!!
Wrapper for the method has a good prototype etc.
This method can be invoked in ActiveX Control Test Container and in some other 3rd party tool.
So... what's going on??
The message pops out during Debug. In Release, no message, no action.
Thanks in advance for any input
Przem
BTW.
Original method prototype:
BOOL CPrismEdCtrl::LinkReport(long report_handle)
Wrapper class method prototype:
BOOL CPrismEd::LinkReport(long REPORT_HANDLE)
----------------------------
"Fate it'seems is not without a sense of irony"
|
|
|
|
|
hi, i am hoping someone can give me some hints as to how to debug a layered service provider.
I have got microsoft's latest sample code from the SDK and it's up and running. i really just want to play around with it to see how it works. The problem comes because after i have compiled and loaded in the LSP dll using the install exe, all the network services are using it even after i uninstall it. this means i can't recompile and overwrite the old dll with a new one because my computer is still using the old one. i can reboot my machine to free it up and then install the new dll but i don't really want to reboot everytime i want to test alterations to my code.
Can anyone help me come up with a way of developing my LSP which avoids this problem?
many thanks
andy
|
|
|
|
|
Hi, I'm a little confused...
Under MBCS the following code works...
---------------------------------------------------------------------
main_doc->SelectByID(au2B(CEditUPara::UComp),au2B("COMPONENT"), 0, 0, 0, &retval);
main_doc->ShowComponent2 ( );
=====================================================================
But under Unicode, i needed to do this for a particular part of the code...
---------------------------------------------------------------------
CString type = "COMPONENT";
BSTR ucomp = CEditUPara::UComp.AllocSysString();
BSTR Type = type.AllocSysString();
main_doc->SelectByID(ucomp,Type, 0, 0, 0, &retval);
main_doc->ShowComponent2 ( );
=====================================================================
The weird thing is that,
---------------------------------------------------------------------
main_doc->IParameter(au2B(Diameter), &dim );
=====================================================================
still works in some other parts of the code...I can compile and run it successfully...Why is this so??
Thanks!
|
|
|
|
|
In MBCS, a 'character' as the user thinks of it may be one or two bytes and in Unicode, it is two bytes.
More info regarding conversion from Unicode to mbcs refer MSDN with key as "MBCS/Unicode conversion"
The chosen One
|
|
|
|
|
In UNICODE, all the characters are in two bytes. (english characters, chinese characters, kanji characters, vietnamese character, etc )
In MBCS, english characters A-Z , a-z are in single bytes, but some characters like numeric 1- 10, chinese characters, kanji characters, vietnamese character, etc should be treated as two bytes or else you will not be able to read it properly.
You need a in depth study to understand it.
For your case as I assume you do not know about the languages like Chinese, Kanji, and etc. I suggest you to stick to UNICODE.
Just my suggestion.
Hope this helps.
Sonork 100.41263:Anthony_Yio
|
|
|
|
|
|
I see, au2B is defined like this,
#define au2B( STUFF ) auT(STUFF)
#define au2B( STUFF ) (LPTSTR)((LPCTSTR)STUFF)
but i'm still not sure what that means...and why there are 2 definitions...
Thanks for ur help guys...
|
|
|
|
|
I am uploading mltiple files at a time using FTP protocol. For this i am using multithreading. Each file is transferred through a different thread. But when i start more than one thread my CPU usage shoots up to 100 % and then everything becomes very slow. and sometimes the application hangs. What might be the reason for this???
|
|
|
|
|
are u looping somewhere?
hint
Sleep
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
hi,
What kind of syncronization objects u r using? Whats the priority of threads u have set?
I think u have posted this question few days back. Did u check with Trace() function as per suggested by somebody.
The chosen One
|
|
|
|
|
Synchronization object used is Critical section and priority of all the threads is Normal.
There is no looping. I have removed all the infinite loops.
Well to communicate with the main thread i am using SendMessage and not PostMessage. Is this the culprit???
As it is recommended to use PostMessage. I have to pass some structure and if i use PostMessage then that sturcture passed to the PostMessage function goes out of scope. So i have to use SendMessage for that. If there is any other alternative to achieve this.
|
|
|
|
|
samhita wrote:
SendMessage and not PostMessage. Is this the culprit???
Sure it is - You can't SendMessage from a thread (as you have seen demonstrated )
samhita wrote:
[...]that sturcture passed to the PostMessage function goes out of scope.
Construct that structure on the heap (new ...). (Your whole process with all threads shares one memory space)
Then send the address of that struct with PostMessage and do not delete it in your calling function. With the call to PostMessage , you transfer the ownership to your message handler.
After use (in your message-handler), you call delete on the struct, so as not to leak memory.
Hope this helps
Who is 'General Failure'? And why is he reading my harddisk?!?
|
|
|
|
|
|
Michael Dunn wrote:
[Sendmessage from a thread]
But then you have to do a lot of synchronisation yourself.
Who is 'General Failure'? And why is he reading my harddisk?!?
|
|
|
|