|
When you say a "flag" do you mean a bool variable? If so, then that is the wrong way to synchronize threads. Use a critical section instead. See InitializeCriticalSection() and related APIs.
--Mike--
http://home.inreach.com/mdunn/
Help! Help! I'm being repressed!!
your with and
Sonork - 100.10414 AcidHelm
|
|
|
|
|
Thanks for all your replies.
It's right, I forgot to specify the flag as 'volatile'. Without this even when increasing the other thread's priority it wouldn't have worked.
But I didn't use a critical section... I'll try to implement it in future
cheers
Marc
|
|
|
|
|
About Server Application
.........................
The server is a full server with automation support.
Server Applcation name is "TestServer"
About Container Application
Container Application name is "CONTAIN"
I am embedding server application in container by using following code
CCONTAINCntrItem* pCntrItem;
CCONTAINDoc* pDoc = GetDocument();
pCntrItem= new CCONTAINCntrItem(pDoc);
CLSID clsid;
CLSIDFromProgID(L"TestServer.document",&clsid);
pCntrItem->CreateNewItem(clsid);
pCntrItem->DoVerb(OLEIVERB_SHOW, this);
It works well.
Now What is the problem?
----------------
i want to provide some information to the "TestServer" before embedding. so how i provide this information from "CONTAIN" to "TestServer".
One way is that "TestServer" should have a method like SendData(CString strData), but how i invoke this method in "CONTAIN".
|
|
|
|
|
How can I generate reports in vc++ like we can in vb.Can you tell me any other way or way of using crystal repors in my application.Please give me an example.
Thanks
imran
|
|
|
|
|
I Write a Visual C++ Program and I Want Run This Program in Other Computer That Haven't Visual C++(Don't Install Visual C++)a I Have a Problem.How to Run This Program..
Or
I Want Visual C++ 6 Runtime Library
Or
Another Way to Help Me.
thanks for your help
|
|
|
|
|
Copy msvcrt.dll (or msvcrtd.dll for a debug build) to \winnt\system32 (or similar).
|
|
|
|
|
Select the static version of the runtime library: Project->Settings->C/C++ sheet->Category: Code Generation->Use run-time library: Multithreaded or Debug Multithreaded, depending on the configuration you're changing the settings for.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Use Dependency Walker to find out the required DLLs
or link MFC statically
Nish
Sonork ID 100.9786 voidmain
www.busterboy.org
If you don't find me on CP, I'll be at Bob's HungOut
|
|
|
|
|
I Write a Visual C++ Program and I Want Run This Program in Other Computer That Haven't Visual C++(Don't Install Visual C++)a I Have a Problem.How to Run This Program..
Or
I Want Visual C++ 6 Runtime Library
Or
Another Way to Help Me.
thanks for your help
|
|
|
|
|
When you compile a project, you get an exe or a dll or a lib file.
Exe file can run on every windows platform, that's the application extension.
Dll file can be run also if you install a application using it.
Lib file must be link into an exe or a dll before usage.
|
|
|
|
|
If the problem is that you get some error-messages about missing modules, you just need to locate the .dll:s missing and copy them to the new computer (like you do with the VB runtime).
/moliate
|
|
|
|
|
Use the depends app, that application will say you the depends of your application, the dll that you need. You need to take care because some dll are in the operating system, and other can be in a old version....
Best Regards.
Carlos Antollini.
Sonork ID 100.10529 cantollini
|
|
|
|
|
I am developing a media player,but due to a stack overflow during runtime my whole application crashes...how to tackle this problem. Please help me???
harish
software engineer
|
|
|
|
|
Use the heap instead of the stack. Did you have a fonction using a array define on the stack like:
void myfunction(tatata)
{
DWORD data[1024]; // 1024*4 bytes allocated on the stack
DWORD *pdata = new DWORD[1024]; // 1024*4 bytes allocated on the heap
....
}
Does that help?
|
|
|
|
|
Use the debugger.
Run your program inside the debugger and before it gets to the stack overflow, open the Debug/Exceptions box and look for the "Stack Overflow" exception. Click on the "Stop always" radio button and then OK. Continue running. When the stack overflow occurs, the program will stop at the point where it's happening. That should give you a clue as to why it's happening and you can then fix it.
Good luck,
Alvaro
|
|
|
|
|
Hi there,
I'm working on webbrowser kind of application. I have a problem in open in new window part. I want to open the new link in the new frame of my mdi application. that part is done but i face the problem with popup windows. for that i need the exact dimention(height+width) of the popup window which is set in the script.
is there any way to get the exact size of the popup window?? i can get the height and widht usign get_Height and get_Width function of iwebbrowser2 interface but it doesnt give me the exact dimention all the times. in lot of popup windows it gives the wrong size.
if anybody knows the soln. pls help me out.
thanx in advance,
Paras Shah
|
|
|
|
|
I use MSWord component in my project. I create a new MSWord document with name such as "d:\temp\mydoc1.doc" from template (example mytempate.dot). This template contain a macro to insert a text into document.
It runs OK even there are some MSWord applications (instances) currently open unless "mydoc1.doc"
Please see these codes:
int ret = NO_ERR;
CString strMacroName;
CStringList argList;
strMacroName = _T("LC_WriteText");
argList.AddHead("This is a text");
ret = CallMacro(strMacroName,&argList);
........
int CExportMSWord::CallMacro(CString& strMacroName, CStringList* pArgList)
{
int bRetVal = NO_ERR;
HRESULT hr = S_OK;
ASSERT(m_pWrdDoc != NULL && m_pWrdDoc->m_lpDispatch != NULL);
OLECHAR FAR* strMacro = strMacroName.AllocSysString();
DISPID dispid;
// Error occurs here
hr = m_pWrdDoc->m_lpDispatch->GetIDsOfNames(IID_NULL, &strMacro, 1, LOCALE_SYSTEM_DEFAULT, &dispid);
SysFreeString(strMacro);
if (FAILED(hr))
bRetVal = UNABLE_CALL_MACRO;
//Some codes....
}
Now I create a new document (mydoc2.doc) from template.dot. Initialize MSWord OK! Create new document OK.
When there is a document which was created from mytemplate.dot (mydoc1.doc) currently open, after executing CallMacro, hr = DISP_E_UNKNOWNNAME!
But if I close "mydoc1.doc", execute again, CallMacro runs OK (hr = S_OK).
Could you tell me what problem and how to fix it??
Thanks in advance
Tuy Le
|
|
|
|
|
Hi,
I'm running on a project, which reuse MS Office component, too
In fact, I still don't understand your problem, but I let you know some issues I have faced
1. The Worf instance you automated will be the same with another instance user run after your application started up, and supprise, it will be visible on screen !!!
2. In fact, Office applications is buggy when you manipulate them via automation, one of the most nasty bug I've faced is it conflict with NAV 2k
Tien,
|
|
|
|
|
Hello,
I have a problem with DLL that I can't solve. I'm working on a quite important projects, with a lot of interfaces sharing several controls.
I want to make a DLL, Project_IHM.dll, containing common parts of the interface with a CGeneric_Dlg class, inherited from CDialog_Dlg in it.
This class is exported trhough the AFX_EXT_CLASS macro.
Then, in another DLL, I create classes inheriting from CGeneric_Dlg. Everything works perfectly, except the message map. If I use
BEGIN_MESSAGE_MAP(CMyDialog_Dlg, CGeneric_Dlg),
I got the following error
unresolved external symbol "protected: static struct AFX_MSGMAP const CGeoConcept_Dlg::messageMap" (?messageMap@CGeoConcept_Dlg@@1UAFX_MSGMAP@@B)
The only way I have found is to use
BEGIN_MESSAGE_MAP(CMyDialog_Dlg, CDialog_Dlg),
and add in the message map all the message that currently exists in CGeneric_Dlg.
It works, but it is not very nice.
How can I properly export the message map of my DLL?
Stephane David
CGx
Head of aeronautical department
|
|
|
|
|
If I understand your problem correct you have one MFC extension dll from which you export CGeneric_Dlg, and another MFC extension dll where you uose CGeneric_Dlg, right? If so, this will give you problems with AFX_EXT_CLASS. It will be evaluated to __declspec(dllexport) in both dlls, also the one where you want to import CGeneric_Dlg.
The standard solution is to use your own macro, like EXPORT_CGENERIC_DLG. Define it this way:
#if defined _COMPILING_PROJECT_IHM_DLL
#define EXPORT_CGENERIC_DLG __declspec(dllexport)
#else
#define EXPORT_CGENERIC_DLG __declspec(dllimport)
#endif
class EXPORT_CGENERIC_DLG CGeneric_Dlg : public CDialog_Dlg
{
}
Put _COMPILING_PROJECT_IMH_DLL as a defined symbol in the project settings of your Project_IMH.dll project, and *dont* put it in the dll that uses CGeneric_Dlg and you should be safe home!
Cheers
Steen.
"To claim that computer games influence children is rediculous. If Pacman had influenced children born in the 80'ies we would see a lot of youngsters running around in dark rooms eating pills while listening to monotonous music"
|
|
|
|
|
I want to develop a client-server application. In my opinion this application would consist of WinNT service and GUI client program. Please help in which way I should manage and control WinNT service program from my GUI client program and visa versa. I need not in detail explanation but show me where I can start from?
Thanks in advance
|
|
|
|
|
|
?
|
|
|
|
|
Ravi posted a link which will show you similar examples.
Nish
Sonork ID 100.9786 voidmain
www.busterboy.org
If you don't find me on CP, I'll be at Bob's HungOut
|
|
|
|
|
I see But I didn't find any answer to my question there. I need not WinNT with GUI interface, in contrary I need TWO processes. First one is a WinNT service and second one is a GUI program to manage first. Also this interacting should be double sided in order to service was be able to notify GUI program about its state. Sorry if I can mistake but I've really find not answer in topic being advised. Sorry again if I am silly At such case give me exact link please.
Thanks (and sorry) in advance
|
|
|
|