|
Item 2 - got it. But remember, it's not the application that's terminating, it's a single dialog.
Item 1 - you see how I am invoking PostMessage, from the CWnd object. This object has an m_hWnd variable, but how would I post a message using this? Based on what you have said, I'm not thread safe.
I'm tired, so might be a brain fart question....
Charlie Gilley
<italic>You're going to tell me what I want to know, or I'm going to beat you to death in your own house.
"Where liberty dwells, there is my country." B. Franklin, 1783
“They who can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.” BF, 1759
|
|
|
|
|
charlieg wrote: Item 1 - you see how I am invoking PostMessage, from the CWnd object. This
object has an m_hWnd variable, but how would I post a message using this? Based
on what you have said, I'm not thread safe.
Do not use CWnd::PostMessage, use the windows API ::PostMessage instead. It allows you to specify the HWND that is to recieve the message.
When you create the worker thread, pass the main window's HWND to it via the LPVOID parameter of the CreateThread function:
CreateThread(NULL, 0, MyWorkerThreadFunc, (LPVOID)m_pMainWnd->GetSafeHwnd(), 0, NULL) Then from the worker thread you can directly post your message to the main window
DWORD MyWorkerThreadFunc(LPVOID pParam)
{
HWND MainWnd = (HWND)pParam;
...
::PostMessage(MainWnd, WM_MYMESSAGE, 0, 0);
...
}
Independent ACN Business OwnerNeed a new cell phone? We supply most of the major carriers. Telus in Canada. Flash, Verizon, T-Mobile and Sprint in the USA. O 2, talkmobile, tmobile, orange, three, and vodafone in Europe. See my website for details.
Within you lies the power for good - Use it!
|
|
|
|
|
oh, I truly appreciate the comments...
Charlie Gilley
<italic>You're going to tell me what I want to know, or I'm going to beat you to death in your own house.
"Where liberty dwells, there is my country." B. Franklin, 1783
“They who can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.” BF, 1759
|
|
|
|
|
No worries, but you should still fix the problems I described and post up the modifications for checking.
|
|
|
|
|
Post a stack trace after the problem has occurred.
Steve
|
|
|
|
|
Steve,
I would if I could. So far, the application crashes in extremely rare circumstances and only in retail. Working hard on the debug version crashing. We shall see. Changes in the works per the comments above.
thanks all
Charlie Gilley
<italic>You're going to tell me what I want to know, or I'm going to beat you to death in your own house.
"Where liberty dwells, there is my country." B. Franklin, 1783
“They who can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.” BF, 1759
|
|
|
|
|
Hi,
I want to learn about Namespaces. I know how includes work, I have used them for many years. When I google the subject, I get explanations about 'include',(which I already know), and a statement that Name Spaces are a Compiler Construct.
How does this 'Compiler Construct' work in terms of the "Compiler's Symbol Table" Compiler Action and "Linker".
Bram van Kampen
|
|
|
|
|
It is a compiler construct because it affects only the source code and the name of the symbols your compiler outputs to object files. A simple linker works simply with the object files and their imported/exported symbols that are basically just strings (symbol names) and it doesn't care whether the name of your variable/function(/any other symbol) is prefixed with one or more namespaces or not. If we want to describe the job of the linker in simple terms then all the linker does is building up two big lists of strings (all imported symbol names and all exported symbol names from all linkable object files) and then finding all of the imported strings in the exported string list. (of course the strings have additional info attached in both lists - like object file, ...)
|
|
|
|
|
So, what's the difference! Is it that the compiler now takes part in the linking? I understand intimately how the compiler and linker work together in the #include model. How does it work with namespaces.
Viz,
In the #include model, the Compiler builds one object file,out of each cpp file. Each object needs to be declared, before an instance can be instanciated)
Classes and Manifests are defined in a header file. This gives the compiler the confidence to produce an object file, containing Inward and Outward references. The compiler is happy to produce these, based on promises in the Header file.
Now, the task of the Linker is to knit this lot together, into an executable ( an exe or dll). It tries to resolve the Links, (i.e. called Named locations in the executable text in One Obj File, to actual Locations of where the code ends up in the final executable). If names cannot be resolved within the 'Project Object Files', further searches are carred out in folders, specified in the project documentation.(paraphrased as spaces where 'Lib Files'are held.) Where this process fails, we get 'Linker errors.'
Now, how does this process take place differently with 'namespace',
and in what way is'namespace' substantially different.
Bram van Kampen
|
|
|
|
|
Hello Every one.
how one can hide file or folder from the explorer even it should not be visible when some one click on show
hidden file and folder .
is there any shell api for this ....
Regards
sarfaraz
|
|
|
|
|
You could mark it as a system folder, which will hide it until the "Hode protected operating system files" option is unchecked.
You can use the SetFileAttributes[^] function to set the folder attributes to FILE_ATTRIBUTE_SYSTEM .
0100000101101110011001000111001011101001
|
|
|
|
|
Hi,
Well, Ultimately you can not. You can hide it from casual 'browsers'. The situation is still that ultimately a designated administrator for a machine is considered 'the owner' of the contents of a drive, who has as such un restricted access to all files, stored on that machine.
Anything short of that would leave the 'data Controller' unable to control the data.
I think you refer to the MS Section of the disk (invisible to WinExplorer) from which the OS can be recovered. Part of the game is, that those sectors can 'NEVER'be written to by Users, hence it cannot contain any reportable personal data.
Bram van Kampen
|
|
|
|
|
At the very least, anyone with admin rights will always be able to see it. If nothing else, this is necessary for virus scanners and backup programs! Why is the standard hide flag not sufficient for your purpose? Maybe your problem can be solved in another way.
|
|
|
|
|
when I use following function get the web info,it always takes a long time,My application can not do anything ,so how to create a thread to get the info .
void CMainFrame::GetXMLInfo(string& strweb,wstring& strErrorMsg)
{
CString strURL = _T("http://xxxxx.com");
CInternetSession Session(_T("MyWeb"));
CHttpFile *lpFile = NULL;
try
{
lpFile = (CHttpFile*)Session.OpenURL(strURL,1,INTERNET_FLAG_TRANSFER_ASCII|INTERNET_FLAG_RELOAD|INTERNET_FLAG_DONT_CACHE);
if (lpFile != NULL)
{
while(TRUE)
{
char szBuff[1024] = {0};
if ( lpFile->Read(szBuff, 1024) <= 0)
{
break;
}
strweb += szBuff;
}
}
}catch(CInternetException* pEx)
{
TCHAR pszError[64];
pEx->GetErrorMessage(pszError, 64);
strErrorMsg = pszError;
pEx->Delete();
}
delete lpFile;
lpFile = NULL;
Session.Close();
}
|
|
|
|
|
Which framework are you using?
.Net?
Qt?
|
|
|
|
|
Try using some of the tutorials from MSDN site.
You can download them from here.
|
|
|
|
|
i'm making a disk(volume) backup/restore system.
i would unmount volume before backup,
but the system volume can not be unmounted.
so the change or access of system volume is worry for me while that system volume is backup.
is it possible that detect which disk sector or ntfs cluster was changed realtime?
that can be filter driver, can it be possible?
|
|
|
|
|
|
Raw sector/cluster accesses on a *LIVE* system is virtually impossible, you would be fighting against running background processes in windows which may be doing a similar task.
See Volume Shadow Copy info.
The only safe way to do raw sector/cluster copying is *offline*, boot from a DVD with a recovery environment like Windows PE (Pre-installation Environment) see Windows AIK Download or something similar.
You just can't trust what you get backed up from a live system. Some files are locked for read/write etc, hence the need for Volume Shadow Copy service or inaccessible due to filesystem/user permissions.
"It's true that hard work never killed anyone. But I figure, why take the chance." - Ronald Reagan
That's what machines are for.
Got a problem?
Sleep on it.
|
|
|
|
|
Hello All,
I have a MFC app in VS 6.0 in which am trying to move the postion of a button during the run time. I am calling function SetWindowPos and for some reason it's not working. I tried MoveWindow and that too didn't work.
The same code runs on a different dialog with a different (ID) button.
But for some reason the SetWindowPos & MoveWindow functions are not working in this particular dialog.
Is there any reason for that? like, all controls are locked or something....
How to resolve this issue?
Thanks in advance.
|
|
|
|
|
Without seeing your code it is impossible to guess what you may be doing.
Use the best guess
|
|
|
|
|
Controls cannot be locked.
The reason for it not working is definitely something wrong with the code.
So as Richard said, we need to see it.
|
|
|
|
|
Donguy1976 wrote: all controls are locked or something....
Controls can't be locked. Show use the code...
|
|
|
|
|
Дан двумерный массив. Найти минимальную сумму элементов по строкам. последовательно решила, а как параллельно все это решить?
|
|
|
|
|
Not too difficult to figure out that this is an English language forum. And, translated your question makes little sense.
Use the best guess
|
|
|
|