|
Are you using another thread to read/load the necessary files or the dll's or you are doing it in the main thread?
You talk about Being HUMAN. I have it in my name
AnsHUMAN
|
|
|
|
|
I am loading it in the main thread itself...
|
|
|
|
|
Then obviously your code for loading the dll's etc will not run during the freeze/sleep as the main thread is sleeping. You should load all dll's in a separate thread and once you are sure that they are loaded, notify the main thread to resume. May be you could have a better idea as well.
You talk about Being HUMAN. I have it in my name
AnsHUMAN
|
|
|
|
|
great feedback for OP
|
|
|
|
|
UI frozen=Sleep worked... like it was suggested, create a loading thread and have that thread message back to the original thread when he's done. Using Sleep() in this manner is not acceptable, you're freezing the user interface on purpose, many do it on accident, but on purpose!?
|
|
|
|
|
So does that means using Sleep() (in main thread) in mfc in condemned??? I never realized that. I think a lighter way was what I did (activated a timer and went to sleep there). Thread is also a good option. Thanks for the reply.
|
|
|
|
|
It's condemned to use Sleep()(for this length of time) in UI thread(its common for people to separate the UI from the rest of the code).
|
|
|
|
|
How do i find last created file in a specified directory?
|
|
|
|
|
Enumerate the files using FindFirstFile & FindNextFile. Using WIN32_FIND_DATA compare the properties and time stamps or whatever is required. You will need to compare the file creation times using an algorithm
FILETIME ftCreationTime; will be of interest in your case.
You talk about Being HUMAN. I have it in my name
AnsHUMAN
|
|
|
|
|
|
Hi ,
I have used the following code to send Message to a vb window,
While using this code in win32 application i can able to find the child window and no problem with my code,
But while using this in an mfc application cant able to find the child window and
it is always null.
Please help to solve my problem,
Thanks in advance.
HWND FormhWnd;
long uClickYes;
long Res ;
long lngresult;
UINT sendtxtmsg;
sendtxtmsg = RegisterWindowMessage("SEND.TEXT.MSG");
LPCSTR strCaption ;
LPCSTR strClass ;
LPCSTR TextBoxCaption ;
strCaption = "WINDOWNAME";
strClass = "ThunderRT6TextBox";
TextBoxCaption = "";
FormhWnd = ::FindWindow(NULL, "WINDOWNAME");
CString txtval;
txtval.Format("%d",sendtxtmsg);
if (FormhWnd != NULL)
{
HWND findchild;
AfxMessageBox("FormhWnd not null");
findchild = FindWindowEx(FormhWnd, NULL, strClass, NULL);
if (findchild != NULL)
{
AfxMessageBox("findchild not null");
FILE *fp;
fp=fopen("sendmsg.txt","w");
fputs("joined Channel..",fp);
fclose(fp);
Res = ::SendMessage(findchild, sendtxtmsg, 1,0);
}
else
{
AfxMessageBox("findchild null");
}
else
{
AfxMessageBox ("PARENT WINDOW NULL");
}
nick
|
|
|
|
|
You should check the results of
GetLastError() after each API call to try and determine why your code is failing.
The best things in life are not things.
|
|
|
|
|
Is the child window you're trying to find a CEdit?
|
|
|
|
|
hi,
thanks for ur reply,
i am trying to find a edit control in vb application,
i used the same coding in not using mfc application
in that i can able to find the child window ie., edit control (vb)
but in mfc i cant able to get the child window.
thanks in advance,
chithra
nick
|
|
|
|
|
Hi all,
I have made a CString variable in that variable i have a single character value like A,B,C.....
I want to put this value in simple char variable(not into char* or char[]).
How can i do so????
thanks in advance
|
|
|
|
|
|
CString can be compiled in UNICODE or NON-UNICODE mode.
In NON-UNICODE mode, the underlying data type is a char .
But in UNICODE mode, the underlying data type is a wchar_t .
So in UNICODE mode, you may not be able to directly assign a single character to a char variable using the GetAt function or []operator .
Here is something you can do so that it works in both UNICODE and NON-UNICODE builds -
CString str("Hello World");
CStringA stra(str);
char C = stra[6];
|
|
|
|
|
Use CString::GetAt() and pass it ti WCHAR or TCHAR - whar ever you are comfertable with...
---
CHEERS!!!
|
|
|
|
|
Hi,
I have one linux cpp executable file. i want how to run this executable file in windows OS?.
please give any idea? or urls
Regards,
M.Mathivanan
|
|
|
|
|
You can use cygwin ( http://www.cygwin.com/ ) on windows. While installing the cygwin you need to select the packages you want to install in cygwin some of the packages are gcc, vim editor, some library.
|
|
|
|
|
|
mathivanaan wrote: I have one linux cpp executable file.
Is it an uncompiled cpp file, or an executable created using c++? You cannot execute a cpp file.
|
|
|
|
|
I have made some important changes to the VC tool box and I can find nowhere to save the changes.
Is it possible to save the changes? such as locate the file ,save it, then after the vc's reinstallation, recover the file so that I can access the changes I have made to the tool box?
|
|
|
|
|
Try saving the files in the folder C:\Users\<user name>\Documents\Visual Studio 2010\Settings .
I'm not sure if this file includes the toolbox settings.
|
|
|
|
|
It's amzing. I've found the data in that settings file. Thanks.
|
|
|
|