|
You don't explain what you mean with a response window. Given your other post, I suspect that you mean a modal dialog? In that case, create a dialog box in the resource editor, assign it to a class (with the Class Wizard), create an instance of the class, and call DoModal on the instance.
|
|
|
|
|
AOA !
I recently am involved in developing a Remote Desktop Monitor, (I can view the active desktop of any of the machines on my network). I already have reached a static solution where I recieve a static desktop image from each of my clients and I have to send a refresh request to get the image again.
I want that my client automatically sends me the image each time any portion of his screen is updated. I thought of sending the entire image again and again but it would be extremely inefficient. I want to send Only the portion of (Invalid Rectangle) whcih is updated.
I have used Windows Hooks to get any WM_PAINT message when it is posted in system message Queue and I get the Invalid Rectangle, but this rectangle has not been validated yet and I want a certain notification after a WM_PAINT message is processed. So I could copy the updated portion (image) from Desktop and send it again.
I do get which portion of screen is invalid but How can I know when a certain portion is Validated ...
Please Help .... Anyone !!
Aleem
|
|
|
|
|
|
Hi,
I am almost at the ending of my project. Now I have to build a statically linked exe file. How can do it?
Thank you,
R.Ravi Kiran
|
|
|
|
|
Is it an MFC application?
If so, selected "Use MFC in a Statically Linked Library" from the Project->Settings dialog will do it.
augy
|
|
|
|
|
I am using qt for the front end with MFC sockets and threads. I used qmake tool of qt to create a dsp file. And
I am getting the following error if I compile the project using the "Use MFC in a statically Linked Library" option set in project settings:
Generating Code...
Linking...
nafxcw.lib(afxmem.obj) : error LNK2005: "void __cdecl operator delete(void *)" (??3@YAXPAX@Z) already defined in libcpmt.lib(delop.obj)
libcmt.lib(crt0init.obj) : warning LNK4098: defaultlib "msvcrt.lib" conflicts with use of other libs; use /NODEFAULTLIB:library
LINK : warning LNK4199: /DELAYLOAD:oleaut32.dll ignored; no imports found from oleaut32.dll
LINK : warning LNK4199: /DELAYLOAD:winspool.dll ignored; no imports found from winspool.dll
Release/max.exe : fatal error LNK1169: one or more multiply defined symbols found
Error executing link.exe.
max.exe - 2 error(s), 4 warning(s)
Plz help me out.
Thank you,
R.Ravi Kiran
|
|
|
|
|
I have 0 experience with qt, so I don't really know how it works.
However, maybe I can still be of some use...
So you don't get this error if you dynamic-link your MFC?
Are you compiling debugging symbols in?
Are you including stdafx.h twice?
I don't know what the contents of nafxcw.lib or libcpmt.lib are, so these are just stabs at the problem.
augy
|
|
|
|
|
Yes I am not getting any error if I dynamically link MFC.
What do mean by "Compiling debuggin symbols in?".
No I am not including stdafx.h twice.
What can I do abt the library files.
Thank you,
R.Ravi Kiran
|
|
|
|
|
I want to know How can I get my program to chainge it's Icon to anothher program's Icon. If i get the icon handle of c:\winamp.exe with ExtractIcon how do I make my program chanbge it's icon to that ?
gabby
|
|
|
|
|
Call the main window's (main frame's) SetIcon() function.
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04
Within you lies the power for good - Use it!
|
|
|
|
|
I am making a win32 api and even with MFC support in a static library I can't use SetIcon function. Even if I used MFC this would have helped because my app icon. I want to know how can I change my icon. My app does not contain any dialog boxes or resources.
gabby
|
|
|
|
|
All the SetIcon() function does is send a WM_SETICON message to the window. You could send the WM_SETICON message yourself. To get the icon handle you can use the LoadImage() function. Look up WM_SETICON and LoadImage in MSDN.
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04
Within you lies the power for good - Use it!
|
|
|
|
|
hi i'm working on my graduation project and i could use any help on how to convert a file (eg : txt , jpg..) to a bit stream .i read something about openning file in binary mode but i dont know much about it. plz any comments will be very helpful . thanks.
|
|
|
|
|
mohamed elemam wrote:
convert a file (eg : txt , jpg..) to a bit stream
Umm... I think a file is a bit stream. Am i wrong? Anyone?
"No matter where you go, there your are." - Buckaroo Banzai
-pete
|
|
|
|
|
I'm not sure I understand the context of the question either. In a sense, yes a file is a bit stream. It's just data. You don't have to convert a file to a bit stream you simply have to use a tool to get the data out of the file and into a file stream in your program so that you can read the data.
Binary mode; sounds like you might be referring to the CStdioFile which is an MFC class. This class inherits from CFile which is used for binary files. CStdioFile allows you to specify binary or text mode and has some extra functions that make reading lines of text very easy. The MFC documentation is fairly clear on how this works; it's just a matter of reading the class documentation in the MSDN library. Of course, there are the basic C++ file streams that can be used to read files and stream data into your program. These are just STL classes which you can learn about in most basic C++ books.
I guess I don't know if I really answered the original question since it was rather vague. We don't really know what is going to be done with the file so all I can say is that streaming data into the program from a file or vice versa is done with file streams or an MFC framework class such as CFile or CStdioFile. A file is just a stream of bits waiting to be processed. You don't have to convert it to do this; you just do it with an existing programming tool and stream the data into your program.
Best Regards,
Shawn
|
|
|
|
|
All files are just a series a bytes stored on disk. There is no conversion needed. The only differnce is which program or piece of code you try to open them with. You can open a .exe file with note pad if you want, of course it will look very strange, but it is not text is it.
INTP
|
|
|
|
|
Hi guys
There is an easy way to create a PDF instead to print programatically?
Best Regads
DOC
|
|
|
|
|
There is no 'easy' way, but there are a multitude of PDF programming APIs, such as TallPDF. These allow you to easily create PDF output files from C++ programs. Naturally, they are commercial and probably none is freeware.
The cheapest way is to invest to Adobe PDF Writer and then print documents directly into PDF format. This software acts as a print-to-file application that outputs PDF files.
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
Thanks Antii
I suposed (((
I'll investigate more
Doc
|
|
|
|
|
There are freeware PDF writers, though I don't know all the details. I've never needed one myself. linux has a number of different ones.
http://printing.kde.org/ for instance references one, but I'm not sure what the details are. I think it coverets postscript to PDF. (since PDF is basicly a more complex postscript or something like that, this is really easy) source code exists for your reference.
PDF is an open specification, so in theory you could write your own. Most of us don't wish to spend that much time (years most likley).
|
|
|
|
|
hi,
i got a 2 CFormView classes attached to one CDocument (with member variable myVar).
i open the first CFormView, in onInitialUpdate() do GetDocument() and change myVar to 1;
i open the second CFormView, in onInitialUpdate() do GetDocument() and get myVar,
but then i see that myVar is not 1. like i didnt got the doc i wanted.
is my assumption is wrong, and if so what can i do to fix it?
|
|
|
|
|
You are using GetDocument correctly, but you are misunderstanding the concepts of how object-oriented C++ and MFC work. To fill in this gap, consider this example:
You have a class called CDocument , that represents the layout (design) of a document class. When you use the new operator or declare an object on the stack, an instance of the class is created. All standard data members of this class belong to this very instance. If you declare a new instance of the class, the new instance will have it's own data members.
What is happening in your code is that you have two CFormView classes which use the same CDocument class. But, when the CFormView objects are created, they both create seperate instances of the CDocument class. This means that though you have told both form views to use the same document class, the actual document objects created from these classes are different objects, both with their own variables. Changing one variable does not change the other one. In short, the form views do not share the document object: both views haver their own instance of the document.
However, there is an option to achieve what you desire in C++. It is called the static keyword. Determine the variable myVar as static in the class declaration. Now, each instance of the CDocument class will share the variable. Here is a code example to clarify:
#include <iostream>
using namespace std;<DIV>
class CDoc
{
public:
CDoc() {}
~CDoc() {}<DIV>
public:
static int nIndex;
};<DIV>
int CDoc::nIndex;<DIV>
int main(void)
{
CDoc* ptrDoc1 = new CDoc();
ptrDoc1->nIndex = 2;<DIV>
cout << "The contents of the static variable is " << ptrDoc1->nIndex << endl;<DIV>
CDoc* ptrDoc2 = new CDoc();
ptrDoc2->nIndex = 60;<DIV>
cout << "The static variable was altered and became " << ptrDoc1->nIndex << endl;<DIV>
delete ptrDoc1; ptrDoc1 = NULL;
delete ptrDoc2; ptrDoc2 = NULL;<DIV>
return 0;
}<DIV>
The output is:
The contents of the static variable is 2
The static variable was altered and became 60 I hope this will clarify the idea.
Additionally, The MFC Framework offers it's very own style to implement the idea 'multiple views for a single document'. You should follow the example set forth in this MSDN link to implement similar functionality. Actually, I suggest you follow only the MSDN example, as I am not perfectly sure the static variable approach would work in MFC. But hopefully the huge code paste was useful
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
your reply was very helpfull!!!
thanks very much!
|
|
|
|
|
Hi.
I am trying to create an autofill program.
This is similar to what the google toolbar does. it looks at the name of the controls, and puts some values accordingly.
The difference is that i am not creating a toolbar. I am using a CHTMLView. So the page is showing inside my program.
I don't know how to access the controls in order to fill them.
Could you please help..
Thank you very much in advance
|
|
|
|
|
Internet Explorer is all COM objects so you have to learn the COM interfaces to accomplish that. What you are interested in is the DHTML interface to the Document Object.
"No matter where you go, there your are." - Buckaroo Banzai
-pete
|
|
|
|