|
Ok, it works just the same.
The hardest part is to get a valid pointer of the class you want to access.
I typical use an extra constructor parameter, e.g. for access to the Document in dialogs, or special Set-functions (but I then normally make my pointer a const pointer to a const object and carefully test for non-nullness).
Who is 'General Failure'? And why is he reading my harddisk?!?
|
|
|
|
|
Assuming that you know ahead of time which classes need access to each other, you can hardwire it in. Write a function in each class to receive a pointer to the other class (the one it has to communicate with), and in that other class write a function that will send a pointer to itself to the first class. Do this as often as you need to, depending on the number of the classes that need to interact and the required directions of the interaction (i.e, one-way or two-way).
Ed
|
|
|
|
|
I need to be able to open a .pdf file (by launching acrobat reader or writer) and show a specific page.
This should be a simple thing, but I googled the whole freaking internet + news groups and could not find any usefull information. It seems the only way to find out how to do this is to buy the adobe SDK, but I don't have the funds to do that. Besides, I don't want to incorporate the whole freaking reader in my own application, I just want to open a file on a certain page!
So is there anyone out there that can solve my problems and frustrations ?
|
|
|
|
|
Use ShellExecute[^]. You will, of course, have to have Acrobat Reader installed on any PC that it runs on.
|
|
|
|
|
jdunlap wrote:
Use ShellExecute[^]. You will, of course, have to have Acrobat Reader installed on any PC that it runs on.
I thought about that, but then I still can only open the document, and not display a specific page of that document.
|
|
|
|
|
Should have paid closer attention to what you said in your post! I wonder if there's a command line option that will let you specify the page.
|
|
|
|
|
i always thought that the Adobe Reader installs an ActiveX Control. With this this should be possible. (the only thing.. you have to make a dialog with the Control on it)
"I'm from the South Bronx, and I don't care what you say: those cows look dangerous." U.S. Secretary of State Colin Powell at George Bush's ranch in Texas
|
|
|
|
|
I've read that you can use an ActiveX control, but this control seems to be very poorly documented. Besides, this is not really what I want, I just want to launch the acrobat reader or writer.
Thanx anyway.
|
|
|
|
|
[RANT]
it is documented like 99.9% of all the ActiveX Controls.. NOT AT ALL
[/RANT]
and i've quickly watched the functions of the interfaces.. it doesn't look like it has a "goto page" - function.. but you can call the "goto next page" function in a loop
yaya.. the joys of programming
"I'm from the South Bronx, and I don't care what you say: those cows look dangerous." U.S. Secretary of State Colin Powell at George Bush's ranch in Texas
|
|
|
|
|
I am developing a small windows XP application that iterates over a set of files in a folder and extracts information from the files properties (right-click, select properties and then the summary tab) like title, summary etc.
The article Microsoft Knowledge Base Article - 186898 shows how to do this for compund docuemnts like Word documents and so on, using IPropertyStorage.
However, In my application, I access non-compound documents (jpeg-files mostly). They can also have attributes like the office files, but IPropertyStorage doesn't seem to be the right choice for finding the information. Does anyone have any excpreience with this?
Regards // Jonas Pettersson
Regards // Jonas
|
|
|
|
|
It does work for JPG files, assuming they have information to show. You will, however, need to use StgOpenStorageEx() instead.
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
Can anybody provide me a sample code in c++ for creating classes using absrtact factory design patterns.
Only a layout will work (one bacse class with 1 -2 methods, and one derived class).
|
|
|
|
|
C++ Programmers needed at our site at www.losttware.com for new project.
|
|
|
|
|
Try in this forum[^] instead.
HTH,
K.
New, what do you own the world?
How do you own disorder?
|
|
|
|
|
Unlike a global variable that can be misused, does a global 'typedef' pose any such danger?
Are there any special constraint where I place a 'typedef'?
Thanks for any insight into this matter.
William
Fortes in fide et opere!
|
|
|
|
|
Check the below article.
In global scope, variables defined will be global in scope.
In local scope, variables defined will be local in scope.
If a variable is local, it can be redefined in global scope. Any previous global variable is overwritten and the local definition no longer exists.
If a variable is global, it can be redefined in local scope. Any previous local variable is overwritten and the global definition no longer exists.
Global variables (and methods) created by the concept instance have a super-global scope, they are visible to all instances providing the instance has not already defined the variable in local or global scope. If the instance un-defines its own global and local copies of the variable, then the variable defined in the concept instance becomes visible. Local variables created in the concept instance are not accessible by other instances and visa versa.
A common mistake when trying to create a local variable over top of a global variable is not to typedef it. For example:
// Define global scope
global ;
// Define a global variable (we didn't use a typedef, so the type is 'list'
a = 100 ;
// Define local scope
local ;
// The following statement simply overwrites the global variable 'a'
a = 101 ;
// But the next statement creates a new local variable because it was typedef'd
int a = 1 ;
CH.L.RAMANA RAO.
chlramanarao@sify.com
|
|
|
|
|
Are you sure you read the question right?
William
Fortes in fide et opere!
|
|
|
|
|
Whilst it cant be misused like a global (you cant change it from numerous places in your code, for example), it is suspectable to a namespace clash with something else of the same name. Just follow the standard rules of defining it before use, putting it into the smallest scope you can, and if necessary, use a namespace.
|
|
|
|
|
Thanks for replying.
What you said, makes a lot of sense!
William
Fortes in fide et opere!
|
|
|
|
|
I've been using SetWindowOrg for quite a while now, but it still bugs me that I don't completely understand what's happening with the "y" coordinate. I know that SetWindowOrg maps the logical (x,y) coordinates to the physical device's (0,0) coordinates (upper left), but I don't understand the sign associated with the "y" coordinate of SetWindowOrg. For example, the following code will draw a circle in the center of the screen (assuming that you've got a device context):
CRect rect;
GetClientRect(&rect);
CPoint point(rect.Width()/2, rect.Height()/2);
dc.SetMapMode(MM_LOENGLISH);
dc.DPtoLP(&point);
dc.SetWindowOrg(-point.x, -point.y);
dc.Ellipse(-50,50,50,-50);
So the origin has been shifted to the center of the screen. Here's my question. Why must negative point.y be sent to SetWindowOrg and not positive point.y? After all, in the MM_LOENGLISH mapping mode the coordinate system is with positive y up and negative y down. So if this code makes the logical upper left be in the second quadrant somewhere (-x,y), which is where it has to be if the logical origin is now in the center, then why do I have to send a negative point.y into the SetWindowOrg? Sending a positive point.y makes more sense, but sending a positive point.y ends up with the circle off the screen. The sign associated with point.x makes sense.
Ed
|
|
|
|
|
I'm trying to align static text windows on a CFormView dialog. I used the visual editor, but sometimes there's a larger gap between text windows than others, so I want to make this even.
I've tried to adjust the window positions in the OnInitialUpdate function. The confusing part to me is that the following 4 lines end up putting my static text window in random places within my application. Between the 3rd and 4th lines of code I would obviously adjust the CRect borders, but I was hoping somebody could give me a reason as to how and why these lines of code cause my window to appear (if it shows at all) in random locations within my dialog. How can I fix this? Thanks a ton!!!
CWnd * MyWindow = GetDlgItem( NUMBER_STATIC );
ASSERT( NUMBER_STATIC );
MyWindow->GetWindowRect( &WindowRect );
MyWindow->MoveWindow( &WindowRect );
Douglas A. Wright
dawrigh3@kent.edu
|
|
|
|
|
you're using GetWindowRect, which is the rect of the window on the screen.
GetClientRect would return the control rect on the client x,y
BUT, grabbing a rect, then moving the window right back to the same position will do absolutely nothing, even if you do it right.
|
|
|
|
|
GetWindowRect() retrieves the window position in screen co-ordinates (i.e. 0,0 is the top-left corner of the screen. MoveWindow() moves the window to the specified client co-ordinates of its parent window (i.e. 0,0 is the top-left corner of the parent window).
You need to peform a conversion between the screen and client co-ordinates before moving the window as follows:
MyWindow->GetWindowRect( &WindowRect );
ScreenToClient( &WindowRect );
// Adjust the position here...
MyWindow->MoveWindow( &WindowRect );
Dave
http://www.cloudsofheaven.org
|
|
|
|
|
I put a CEdit control into a simple frame OLE Active X MFC project, and created it on the OnCreate function, and it works fine, except that when I embed the active x control into a webpage, it will not receive the backspace messages.
Where did they go?, what took them? Is it internet explorer's client window that's filtering the keypress message?
Here is my project example, which is simply a standard MFC Active X control VC++6 project wizard output with a public CEdit member m_edit, that is initialized on the component's OnCreate function.
Please take a look and let me know what's going on
http://www.employsoft.com/test.zip[^]
|
|
|
|
|
Most likely they are going to the IE main window. The backspace causes IE to navigate back one page.
"What lies behind us and what lies before us are small matters compared to what lies within us." -- Ralph Waldo Emerson
FLUID UI Toolkit
|
|
|
|