|
How to display a dialog in SDI app that has a class derrived from CRecordView?
|
|
|
|
|
ivanris wrote: How to display a dialog in SDI app that has a class derrived from CRecordView?
The same way you would any other dialog (e.g., DoModal() ). Having a CRecordView -derived view has no bearing on that.
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
How do i can shell a program hidden and i want my program to wait until the shelled program ends.
thanks.
|
|
|
|
|
that's a "hard-to-undeerstand" english...
what do you mean by "to shell a program" ?
also, please rephrase your question in a more lexical speaking...
|
|
|
|
|
Can you be more specific,Do you need to ShellExecute
|
|
|
|
|
Sina Parastgary wrote: shell a program hidden and i want my program to wait until the shelled program ends
I think that you are starting a process from your application that should run hidden in the background and also not show itself in the System Process list.
Am I right?
Sina Parastgary wrote: wait until the shelled program ends
Are you trying to achieve this in two different process?. If yes you can use a shared variable. When the value of that shared variable changes post a message from your application and ask the parent application to quit.
I think I am on the right track in understanding your statement...
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
From what I understand you want to start a program using ShellExecute and wait for that 'shelled' program to end. If this is true, you can use the following -
1. Use FindExecutable() API to find the associated EXE
2. Use CreateProcess() API to create the process for the EXE got from step#1
3. Use WaitForSingleObject() API to wait on the process created in step#2
If you can state your problem more clearly, people here will be able to help you in a better way
S o h a i l K a d i w a l a
modified 21-Apr-21 21:01pm.
|
|
|
|
|
Use ShellExecuteEx() instead, followed by WaitForSingleObject() .
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Hi there,
I've now encountered a hard problem.
As we know, in a dialog-based program, when we press a
button, the windows wait for the corresponding procedures
to be executed. During executing those procedures, the other
windows message won't be taken care.
I've ever used a library, it provides two functions.
One is Go(), and the other is Stop().
I created two corresponding buttons ButtonGO, and ButtonStop
to do Go() and Stop().
I don't have to use AfxCreateThread in OnBottonGO. When I press
ButtonGo, the ButtonStop button is still pressable!
When I press ButtonStop, the OnButtonGo() function shall return.
How this can be done?
Any suggestion will be appreciated.
|
|
|
|
|
cwyang wrote: OnButtonGo() function shall return
Set a flag when you click OnButtonGo.Modify that flag when you click OnButtonStop.
In Go Function keep checking the value of the flag.If it's set continue with your processing else return from the function.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Method 1: use a shared boolean flag between your main thread and the Go-thread (protected by critical sections of course). When stop is pressed, change the value of the flag. In the Go-thread loop, check the value each time (again, making sure to protect it).
Method 2: Use a event handle. Set up the event before creating the thread, and pass it in as part of the thread's data. Use WaitForSingleObject at some point during each iteration and break out of the thread's loop when the event is signaled. When Stop is pressed, call SetEvent.
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week
Zac
|
|
|
|
|
Thanks for thr instant reply.
But my problem here is, I don't wanna use thread here.
I want the Go() function could do the "PeekMessage"
for the main window.
Just don't know to do so.
|
|
|
|
|
cwyang wrote: I want the Go() function could do the "PeekMessage"
for the main window.
This is a VERY bad practice. You do NOT want to keep making message loops in your main thread. It makes your code overly complicated, impossible to maintain, and royal pain to debug. If you have a section of code that will be doing enough processing to block your UI thread (aka, your main thread), you do want to us a worker thread.
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week
Zac
|
|
|
|
|
Dear sirs
I need to use a Open Office SDK to conversion doc to PDF files in a dll that is created by C but compiled by Visual C++ 2003. After including files:
#include "cppuhelper/bootstrap.hxx"
#include "osl/file.hxx"
#include "osl/process.h"
#include "com/sun/star/bridge/XUnoUrlResolver.hpp"
#include "com/sun/star/frame/XComponentLoader.hpp"
#include "com/sun/star/frame/XStorable.hpp"
#include "com/sun/star/beans/XPropertySet.hpp"
#include "com/sun/star/beans/XProperty.hpp"
#include "com/sun/star/beans/XPropertyAccess.hpp"
#include "com/sun/star/lang/XMultiServiceFactory.hpp"
#include "com/sun/star/uno/Sequence.hxx"
#include "com/sun/star/util/XCloseable.hpp"
#include "string.h"
the compiler return:
Fatal error C1189: #error: "Could not find 16-bit type, add support for your architecture"
After it I define:
#define WNT
#define CPPU_ENV msci
Then compiler return:
Fatal error C1070: mismatched #if/#endif pair.......
My project is created without StdAfx.h precompiled header and with makefile. Also in other program I successfully add these header files and no error appear.
What is necessary to do for resolve the problem?
Best regards
Kamen
-- modified at 7:07 Monday 28th August, 2006
|
|
|
|
|
might be best to try the open office mailing lists.
|
|
|
|
|
Few days back i got this linker error when i rebuild my coding..
Linking...
nafxcwd.lib(afxmem.obj) : error LNK2005: "void * __cdecl operator new(unsigned int)" (??2@YAPAXI@Z) already defined in Communciation.obj
.\Debug/CS3OperatorStation.exe : fatal error LNK1169: one or more multiply defined symbols found
Error executing link.exe...I posted question for this and get some soluitons too...
But myself i got solution for this error.
In my project settings under Microsoft Foundation Classes :Use MFC in static library
Then i changed this to "Use MFC in shared DLL" then the error didnot come after that and its work properly...why its came?whats the differnec between static library and shared dll?
I am using some DLL function in my applcation.Is there any connection between this?
-- modified at 6:11 Monday 28th August, 2006
Anu
|
|
|
|
|
May be this[^]could help you.
2 bugs found.
> recompile ...
65534 bugs found.
|
|
|
|
|
See here[^] maybe it is some helpful to you
|
|
|
|
|
I have two dlls with some functions. Both the dlls have to update a text file almost in all functions they have ( its like a log file). I have another client application which creates threads and uses those dlls in those threads.
Now how to achieve syncronization?
Please help me.
Thank you.
KIRAN PINJARLA
|
|
|
|
|
There is a number of ways to achieve this.
The methods I came to think about is (amongst others):
1.
Open/create the file for exclusive access (from each dll), and let the other dll wait/retry until it can open/create the file for exclusive access.
2.
Use a named semaphore (see OpenSemaphore() and CreateSemaphore()) to flag the file is busy.
3.
Use file locking
4.
Use a CriticalSection
5.
Use a Mutex (Owned by the main code, passed as a pointer?)
6.
e.t.c
Alcohol. The cause of, and the solution to, all of life's problems - Homer Simpson
|
|
|
|
|
Hi, All
I have one problem with rich edit view
My Frame:
BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext)
{
// TODO: Add your specialized code here and/or call the base class
int nID = AFX_IDW_PANE_FIRST; //50421
if (!m_wndSplitter.CreateStatic(this, 1, 3, WS_CHILD|WS_VISIBLE|WS_BORDER, nID)) //50421
return FALSE;
if (!m_wndSplitter.CreateView(0, 0, RUNTIME_CLASS(CTreeView), CSize(100, 100), pContext) ||
!m_wndSplitter.CreateView(0, 1, RUNTIME_CLASS(CRichEditView), CSize(400, 400), pContext)||
!m_wndSplitter.CreateView(0, 2, RUNTIME_CLASS(CHtmlView), CSize(0, 0), pContext))
{
m_wndSplitter.DestroyWindow();
return FALSE;
}
}
After run application, when i drag and drop file in to RichEditView window, program will terminate.
I want to prevent drag and drop item (file, text) in to RichEditView.
I OverWrite OnDragEnter of View and return DROPEFFECT_NONE but this function not effect.
I have debuged and found :
STDMETHODIMP CRichEditView::XRichEditOleCallback::GetDragDropEffect(
BOOL fDrag, DWORD grfKeyState, LPDWORD pdwEffect)
{
if (!fDrag) // allowable dest effects
{
DWORD dwEffect;
// check for force link
if ((grfKeyState & (MK_CONTROL|MK_SHIFT)) == (MK_CONTROL|MK_SHIFT))
dwEffect = DROPEFFECT_LINK;
// check for force copy
else if ((grfKeyState & MK_CONTROL) == MK_CONTROL)
dwEffect = DROPEFFECT_COPY;
// check for force move
else if ((grfKeyState & MK_ALT) == MK_ALT)
dwEffect = DROPEFFECT_MOVE;
// default -- recommended action is move
else
dwEffect = DROPEFFECT_MOVE;
if (dwEffect & *pdwEffect) // make sure allowed type
*pdwEffect = dwEffect;
}
return S_OK;
}
Help me slove this problem. Thank for reading.
Huynhnb
.: Your success is also mine :.
|
|
|
|
|
I have bulk of data . I want to find a specific data from the bulk and doing some calculation on the data. i should not use STL Object(Map) or MFC . It should be a pure SDK. Can u suggest any build in functionality for this ?
Thanks in advance
g.shadrach
|
|
|
|
|
With limited information from you, probably a linked list or an array (probably array of pointers) can be used to do it.
-Prakash
|
|
|
|
|
Mr.Prakash wrote: probably a linked list
probably linked list is very slow at searching in compare to other datastructure
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
sorry, but STL is fully portable, because provided with the C++ language. it's not a Microsoft product
|
|
|
|