|
Welcome...
- ns ami -
|
|
|
|
|
hello,
can anybody help me to knw that who mainapp, doc and view handles ID_FILE_CLOSE i want to override this as i m using AFXPrintPreview(this) where this is ponter to view. in that case my main ribbon button contains a close buttton. On which i want to just close my preview nt application. my application is an SDI application. plz help
thnakz
|
|
|
|
|
It's handled by the document. You may explain it better.
Some notes from MSDN:
ID_FILE_CLOSE Closes the currently open document.
CDocument::OnFileClose calls CDocument::SaveModified to prompt the user to save the document if it has been modified and then calls OnCloseDocument. All the closing logic, including destroying the document, is done in the OnCloseDocument routine.
ID_FILE_CLOSE acts differently from a WM_CLOSE message or an SC_CLOSE system command sent to the documents frame window. Closing a window will close the document only if that is the last frame window showing the document. Closing the document with ID_FILE_CLOSE will not only close the document but will close down all frame windows showing the document.
He never answers anyone who replies to him. I've taken to calling him a retard, which is not fair to retards everywhere.-Christian Graus
|
|
|
|
|
thanks for the reply... i could get it earlier but will it be ok from design point of view to call CmainFrame method from doc. i kindda need that.
|
|
|
|
|
I have created resource dll in english and french language.
Now I want to link these resource dlls to my MFC dialog based application.
In my application,I am chosing language from a combo box.I need to call the particular resource dll on the selection of language in combo box.
Can anyone help me? It's URGENT.
Thanks in advance.
|
|
|
|
|
Clikt[^]
He never answers anyone who replies to him. I've taken to calling him a retard, which is not fair to retards everywhere.-Christian Graus
|
|
|
|
|
here are some extra files which i don't have in my application. So I am not getting where to include these files.
Like CMainFrame class, I don't have .So i am not getting that where to include the handler..
Can u help me?
|
|
|
|
|
Hey you don't need to use the demo application. It's a Doc/view application. As you said yours is a Dialog application. You don't need to copy all those View,Doc files. Just search for CLanguageSupport usage in his demo application and try to implement it in your dialog.Helper[^]
He never answers anyone who replies to him. I've taken to calling him a retard, which is not fair to retards everywhere.-Christian Graus
|
|
|
|
|
I am trying to open a exe file through my application. I am using CreateProcess() for the same
But before the application lauches the next line starts executing.
I added Sleep(10000). But that does not help everytime
Please suggest how can I wait till application is up and then proceed with other calls.
|
|
|
|
|
What does the next line do? What kind of problem does the next line make to be execute? tell a little more about your problem...
|
|
|
|
|
Here when I open a application which is a server, the mounted file systesm should create a corresponding directory.So next line is to Check for the folder in fs.
This command executes imeediately and returns no folder.
|
|
|
|
|
Is'nt ShellExeute helping you?
|
|
|
|
|
WaitForInputIdle or GetExitCodeProcess may help?
He never answers anyone who replies to him. I've taken to calling him a retard, which is not fair to retards everywhere.-Christian Graus
|
|
|
|
|
I am using below function and its working fine for now.
DWORD dwExit = WaitForSingleObject(piProcessInfo.hProcess,5 * 10000);
This is incorporating required delay.
|
|
|
|
|
I think that's the only way. (up to my knowledge) because GetExitCodes just get the termination status. May be after waiting , you can check for STILL_ACTIVE status. But your design sounds little bad. What is that you are trying to do? May be you could synchronize your processes with kernel objects like Events. That would be a better solution.
He never answers anyone who replies to him. I've taken to calling him a retard, which is not fair to retards everywhere.-Christian Graus
|
|
|
|
|
Hello all,
One of my works requirement is customizing the context menu in inspector window of a MS outlook.
Details regarding it are as follows:
when we right click on a email-id(the one that is in front of a From: or To: ),
a context-menu pops-up.I want to add some items in it.
How this can be done? and what events should be handled?
i am writing a component in vc++ & working with outlook 2003.
reply me on n.chudekar.31@gmail.com
thanks in advance.
|
|
|
|
|
at last i got the solution...
anyone facing the same problem, you can visit following two sites everything will be
cleared then.
http://www.outlookcode.com/news.aspx?id=41[^]
http://www.crmreports.com/index.php/additional-actions-when-right-clicking-a-from-or-to-address.html[^]
cheers,
|
|
|
|
|
Hi,
I just saw a example of something I was trying to do on MSDN doing tcp sockets methods in its own thread
the exmpale head Csockets as derived Class With CWinThread as the Base
class CSockThread : public CWinThread my questions where would the code start executing I know Cwinthread has a
CreateThread method but that doesn't specfy where the code starts executing
thankx
|
|
|
|
|
The code starts execution in CWinThread::InitInstance[^]. YOu can override this in your derived class.
-Sarath.
"Great hopes make everything great possible" - Benjamin Franklin
|
|
|
|
|
So that would be my start thread function ????
looking at the Win32 API it would be the lptartAddress ?????
HANDLE WINAPI CreateThread(
__in_opt LPSECURITY_ATTRIBUTES lpThreadAttributes,
__in SIZE_T dwStackSize,
__in LPTHREAD_START_ROUTINE lpStartAddress, <------
__in_opt LPVOID lpParameter,
__in DWORD dwCreationFlags,
__out_opt LPDWORD lpThreadId
);
Can I give each Instance it own name to differanitate it via SetThreadName
|
|
|
|
|
You do not start a CWinThread derived thread using Win32's CreateThread[^] function. CWinThread 's purpose is to wrap the low level details behind the raw Win32 methods in a nice little object oriented package. The documentation[^] on CWinThread contains the following:
To create a thread, call AfxBeginThread. There are two forms, depending on whether you want a worker or user-interface thread. If you want a user-interface thread, pass to AfxBeginThread a pointer to the CRuntimeClass of your CWinThread-derived class. If you want to create a worker thread, pass to AfxBeginThread a pointer to the controlling function and the parameter to the controlling function. For both worker threads and user-interface threads, you can specify optional parameters that modify priority, stack size, creation flags, and security attributes. AfxBeginThread will return a pointer to your new CWinThread object.
Instead of calling AfxBeginThread, you can construct a CWinThread-derived object and then call CreateThread. This two-stage construction method is useful if you want to reuse the CWinThread object between successive creation and terminations of thread executions.
Note: The CreateThread mentioned in the above quote is CWinThread::CreateThread , not Win32's.
Always be wary when mixing the low-level (::CreateThread ) with the high level (CWinThread ). If you don’t know how the two relate and the manner in which the high level is implemented in terms of the low level you can easily get into trouble.
Steve
|
|
|
|
|
My point Being using The CwinThread::CreateThread Method there doesn't exist a way of pointing to the Starting executing Function
I know There is the Overridable Function CwinThread:: initinstance() is where the Code starts executing but
thats not the The starting thread function
in MSDN examble for CSocket::Attach
link below
http://msdn.microsoft.com/en-us/library/z2h4xz23(VS.80).aspx
which has Derived Csocket and a Base CWinthread e.g.
Class Csocket : pucblic Cwinthread how can specfiy the start function I guess you can'nt
|
|
|
|
|
Whenever I am debugging, I have this set of windows available to me, say memory, watch, call stack and breakpoints. If I click on one of the windows, the set of windows available changes. How do I make it not do this and just have a consistent set of windows?
Grache'
----------------------------------------------------------
Lorem ipsum dolor sit amet.
|
|
|
|
|
I have basic knowledge of C and C++(basically can read the code to understand what its doing and basically write a small utility here and there in C or C++). However for the last couple of days I am trying to research on the API's. I have seen examples being used in Visual Basic and haven't been able to come across a good sample or document as to how I could use the API in C++ or I might have just not understood it.
I personally would prefer doing a project in VB however am being told I will reach my limitations with VB within hours and am better off with either using C or C++.
Here are the API's I am trying to find examples with or any articles to try and understand with examples would be a great start. I just don't want to start and have to ask questions every hour...
The main API's I am intrested in are :
If I can I will explain this from some of the documents and the usage I have seen in VB.
A) WindowFromPoint(X, Y)...This has to be the point I am looking for on my desktop and it could end up being an external window or my own window at that location. Obviously no point to point it to my own window.
For usage in C++ I would be storing the return valuse in a long variable or do I have to declare my variable as a HANDLE?
C++ usage
1) HANDLE h = WindowFromPoint(499,15)
OR use as
2) Long h
h = WindowFromPoint(499,15)
////
B) GETDC(h) This is getting the device context from using the handle we just passed. However what is the return value for this...VB example states its long?
1) Long h
hd = GetDC(h)
C) BitBlt (Destination picture object's.hdc, a RECTANGLE BLOCK, hd we got from B above, nect two parameter 499, 15 used in the WindowFromPoint, COPY)
Please am I on the right track with this 3 API's.
Thanks a million.
|
|
|
|
|
WindowFromPoint[^] has the following prototype:
HWND WindowFromPoint(POINT Point);
As can be seen, the return type is HWND , not HANDLE . Also, it takes a POINT point structure, not two numbers. Try something like this:
HWND h = WindowFromPoint(POINT(499,15));
Steve
|
|
|
|