|
|
how do you print ? with the doc / view architecture or somehow different ?
OnPrepareDC (CDC* pDC, CPrintInfo* pInfo)
{
..
DEVMODE* pDevMOde = pInfo->m_pPD->GetDevMode();
pDevMode->dmOrientation = DMORIENT_LANDSCAPE;
pDC->ResetDC (pDevMode);
}
This would be the approach for the doc / view arch. if you use another way, post the code...
hope this helps..
bernhard
"There are three roads to ruin: women, gambling and technicians. The most pleasant is with women, the quickest is with gambling, but the surest is with technicians." Georges Pompidou
|
|
|
|
|
I'm an experimented developper (I believe I am) but I'm a bit lost.
I want to create a Internet Explorer PlugIn but when I open the new project dialog, I don't know what to choose. It's very embarrasing .
FYI, I want to put some buttons and a listbox.
How can I force the user to install it when he opens the page?
Can I create a Dialog application with automation server? Does that work?
|
|
|
|
|
|
Hi,
I'm wondering if it is possible to 'push' a thread to execute more often when another thread is waiting for some data from the first one?
The concret case is the following: My application created a secondary thread for displaying data. The main thread modifies that data and to avoid displaying wrong data I use flags.
When the secondary thread is busy, the first one waits until the security flag is reset. Depending on the compiler options the results are different: for 'standard optimization' there is no problem, but for 'speed optimized' the main thread waits forever because somehow the secondary thread doesn't continue... ??
Can someone help ??
Thanks
|
|
|
|
|
You can increase the thread priority SetThreadPriority in MSDN
|
|
|
|
|
Set the priority to THREAD_PRIORITY_HIGHEST or even THREAD_PRIORITY_TIME_CRITICAL, do your stuff and then put it back to THREAD_PRIORITY_NORMAL
Nish
Sonork ID 100.9786 voidmain
www.busterboy.org
If you don't find me on CP, I'll be at Bob's HungOut
|
|
|
|
|
Have you declared the flag variable as volatile ? If you didn't, the compiler doesn't know it may be changed in another thread, and can optimize away checks for its value.
|
|
|
|
|
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
|
|
|
|