|
Hi,
I'd like to know how to use the HTMLView Navigate2 method with HTML files that are contained as resources in the .exe in which the HTMLView is located. Anyone have some sample code? Something like:
Navigate2("res://??????")
Or something like this?
Thanks,
Aaron
|
|
|
|
|
You mean this???:
Navigate2(_T("D:\\MyPage.htm") ,NULL,NULL);
Mazy
"So,so you think you can tell,
Heaven from Hell,
Blue skies from pain,...
How I wish,how I wish you were here." Wish You Were Here-Pink Floyd-1975
|
|
|
|
|
|
The syntax is res://sFile[/sType]/sID ( check MSDN / Internet development SDK for samples ).
|
|
|
|
|
I am looking for help in understanding how to have a parent dialog be made aware of button presses that occur from buttons that are pressed on the panes of a property sheet.
I already have code in the classes, for each of the property pages, that gets attention when each of these buttons is pressed. I have that code in the property page class becasue some information from the page controls needs to be gathered and then the parent dialog needs to know this information. The parent dialog uses this to change an edit control contents that is on the dialog outside the client area of the property sheet.
What is the method to report this information out to the parent dialog?
MIKE
|
|
|
|
|
This is far from standard, but you can try the following:- Go to the source code for your propery page and replicate the handler declaration in your property sheet (the message map stuff, you know).
- In
CYourPropertyPage::OnButtonClicked propagate the message at the end of the handler with GetParent()->SendMessage(WM_COMMAND,MAKEWPARAM(ID_BUTTON,BN_CLICKED),(LPARAM)m_hWnd) . - Do whatever you need to in
CYourPropertySheet:OnButtonClicked .
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Thanks for your reply. Your suggestion game me an idea to try. Instead of cloning the handler and the message table I can see (from a debuggger trace) that within the button handler of the property page I can use GetParentOwner() to get the CWnd* of the parent dialog. Using this
I can send a message right to the base dialog. I do have yet to work out just what message to send. I would like there to be a single handler in the base dialog for all of the various buttons on the proprety pages. Due to this I inclined to look into the WM_NOTIFY scheme or
to otherwise use the ON_REGISTERED_MESSAGE() macro mechanism inthe message map and make a custom message type via a registration with windows.
Mike
|
|
|
|
|
Hio.. im trying to move a button down like 10 pixels, but not having any luck..
CButton* pSelectBtn = (CButton*)GetDlgItem(IDC_CREATESELECTBTN);
CRect SelectRect;
pSelectBtn->GetWindowRect(SelectRect);
SelectRect.top +=10;
pSelectBtn->SetWindowPos(&wndTop, SelectRect.left, SelectRect.top, 0, 0, SWP_NOSIZE);
whenever i do this the button just dissapears.. if i change the flag to SWP_NOMOVE and set the width and height it will resize the button, but i just cant seem to move it.. even if you remove the 'SelectRect.top +=10;' the button still dissapears.. i have tried doing GetWindowRect, and then passing SetWindowPos(&wndTop, SelectRect.left, SelectRect.top, (SelectRect.right - SelectRect.left), (SelectRect.bottom - SelectRect.top), SWP_NOSIZE), and even then the button just dissapears..
i know its moving, but obviously im giving it the wrong left and top parameters.. any helP?
-dz
|
|
|
|
|
SetWindowPos positions are relative to the parent's client area and GetWindowRect returns a position on the screen.
Try doing something like...
....
pSelect ->GetWindowRect (SelectRect);
ScreenToClient (SelectRect);
....
Tim Smith
I know what you're thinking punk, you're thinking did he spell check this document? Well, to tell you the truth I kinda forgot myself in all this excitement. But being this here's CodeProject, the most powerful forums in the world and would blow your head clean off, you've got to ask yourself one question, Do I feel lucky? Well do ya punk?
|
|
|
|
|
super sweet, thanks!
-dz
|
|
|
|
|
Use setwindowplacement...
Regards
Carlos Antollini.
Sonork ID 100.10529 cantollini
|
|
|
|
|
When I use the classwizard to create a MFC class the constructors are protected. Why is this? My programs run if I move the constructor out into the public: section but I have this nagging feeling that something terrible will happen one day becasue of it. Could somebody shed a little light on this subject for me?
|
|
|
|
|
Some classes created by the MFC wizard (like for instance those derived from CView ) have their ctors protected by default because they are intended to be created by the framework dynamically, i.e. whithout knowing the exact type of the CView -derived class until runtime. This is accompished by means of CRunTimeClass objects:
CRuntimeClass* pRTClass;
...
CView* pView=(CView*)pRTClass->CreateObject(); This technique implements a design pattern commonly known as virtual constructor.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Hi all
I have been customizing overridden print methods like onPrepareDc() and print() etc. My programs work but my knowledge is still fuzzy.
My question is - can somebody please explain to me the definition and differences between
- windowExt
- viewportExt
- logical units
- dots per inch
and how these 4 things really interact when it comes to printing.
I have checked MFC's documentation and about 4 diff MFC books and the MIcrosoft site. Nobody comes out and defines these things, they all just talk about how to use them.
Any help appreciated
or just point me to some references please
IGeorgeI
George W
Software Developer
www.zsystems.ca
|
|
|
|
|
Device Units / Coordinates:
Device units are the actual units of the device context. This would be pixels.
Logical Units / Coordinates:
Since different devices have different resolutions, windows allows programmers to define Logical units in order to make the graphics programming more device independant. Logical units are also called the page coordinate space. This allows the programmer to define the units that they would like to work with instead of pixels. For instance, say you are writing a landscaping program, you could define the base unit as 1/8 inch.
WindowExtent:
This is a value that indicates what units that you would like to work with.
ViewportExtent:
The size of the viewport that the WindowExtent will be mapped to. Say you wanted to make a mini-view of a document, you would set the WindowExtent to the size of the document regularly, and the Viewport extent to the size of the mini view. Then you use the same paint code, and you will have a mini-view of your document.
Dots / Inch:
This is the resolution of your printer or display device. Usually monitors aren't measured like this so I will explain printers. A fairly standard resolution for printers is 600 dpi, which is 600 dots / inch. You can think of this as 600 pixels / inch. If you left you DC that you received from your printer as the default, you would be painting each individual pixel, but since you set the window extent and the viewport extent, the logical or page coordinates get remapped to allow you to paitn your graphic on the entire page.
There is alot of information in MSDN and in Charles Petzolds Windows programming book.
|
|
|
|
|
Consider the following section of code:
int a = 10;
int* b;
Which of the following statements places the address of a in b. Remember, more than one of these options may be correct. In your response, explain which ones work and why, and also explain why the incorrect answers will not work. I want more than a listing of the syntax errors!
b = a;
b = &a;
b = *a;
*b = a;
&b = &a;
Loli10
|
|
|
|
|
|
Not quite. It's something that came up in lecture. My homework is writing a program.
Loli10
|
|
|
|
|
Loli10:
b=a; will give compile time error becasue it is not legal to assign the int value from a to the pointer value in b.
b=&a; this moves the address of a to the pointer variable b....the answer you were looking for.
b=*a; this is not legal because *a means get contents pointed to by a and yet a is not a pointer variable.
*b = a; this is a legal statement IF b has a valid pointer in it. If so then the value of a is moved to the integer pointed to by b.
&b=&a; this is not legal becasue it does not make logical sense to use the & address of operator on the left side of an = sign.
Mike
|
|
|
|
|
Thanks Mike - it makes sense!
Loli10
|
|
|
|
|
Hi all
I have created an ATL 7.0 service with a simple COM object in it. The service is multithreaded (_ATL_FREE_THREADED defined and my coclass has the threading("free") attribute).
The problem is that when a client tries to create an instance of the object, it gets the error number 0x80080005 (Server execution failed). This error occurs in the CoGetClassObject call. When this error occurs, I get the following message in the system event log:
The server {50DDF6F0-0A98-4126-9D38-606FE167C56F} did not register with DCOM within the required timeout.
Not that this is the GUID of the module.
I don't try to create the object via DCOM. I don't have this problem if I don't register the exe as a service (a standalone exe COM server).
Tx for the help!
Michel
Michel
If I am wrong or said something stupid, I apologize in advance
|
|
|
|
|
Hi,
It seems that whenever I get going on a large project I always get tangled up in #include header file issues. I've looked around the internet for articles to learn more about where I should put the headers in the first place but I have not turned anything up.
Could some of you share your experinces and send links on this topic?
PS: I did find an article: _Creating your own GUIDs_ here on codeproject that covers multiple inclusion which was nice but I'm looking for a little bit more on the general topic.
|
|
|
|
|
Always I create groups of functions that are declared in different headers. I prefer to work with classes, and I put the declaration of the class in hader, (one header per class) other peoples prefer to put two or more classes in the same header, deppendong the size of the size, but I prefer to use one header per class, for me is comfortable, and easy to find functions, when I know in what class is.
For me is important because I sahre the classes between diferent projects, In that case I include only the class that I am interesting for...
Is dificult to find a rule, is difficult to find a because, every develpper works the different way, but always you can find a group of developer that prefer to work in that mode...
Best Regards.
Carlos Antollini.
Sonork ID 100.10529 cantollini
|
|
|
|
|
Read John Lakos' "Large Scale C++ Software Design". This book deals mostly with physical (not logical) design issues, like header files etc.
The rule of the thumb with non-trivial projects is: do not #include anything just because it's convenient. Use forward declarations wherever possible.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
Tomasz Sowinski wrote:
Use forward declarations wherever possible.
Very true
My and my colleagues one time optimized the compile time to 20% of total time, it took 1º time 25 minutes , and after optimizing only 5 minutes
Cheers,
Joao Vaz
|
|
|
|