|
GetModuleFileName
Nish
Sonork ID 100.9786 voidmain
www.busterboy.org
If you don't find me on CP, I'll be at Bob's HungOut
|
|
|
|
|
Hello Wally,
Use GetModuleFileName().
Regards,
Bio.
|
|
|
|
|
assume a windows client 's height and width is yClient,xClient,
what's the relation between the ScrollInfo structure 's member nMin,nMax and
the yClient,xClient;
assume the font's height is ftheight, the client window should contain
yClient/ftheight lines buffer(buffer[yClient/ftheight][]).
if there is already yClient/ftheight LINES buffer displaying in the client area.
when the scroll box is moved , assume member nPos in the ScrollInfo structure
amount to 1, then the buffer[0] will dispear, and the Client Area shows the buffer from the 2nd row in the buffer, and so on.
then if nPos=yClient/ftheight,the the scroll box is showed in bottom of Scroll Shaft?
can anyone explains those concept about usage of ScrollBar?thanks in advance a lot
sorry for my poor english.
one is the other who absorbs the thoughts of others
one is the other who absorbs the thoughts of others
|
|
|
|
|
I'm not sure what you're asking, but if a bitmap is 800 pixels high and the window that shows it is 300 pixels high, the scroll range will be 500, because at position 0 you see the top and at position 500 you see from 500-800, i.e. all the way to the bottom.
Christian
I have come to clean zee pooollll. - Michael Martin Dec 30, 2001
Sonork ID 100.10002:MeanManOzI live in Bob's HungOut now
|
|
|
|
|
Hey all
Just wondering, why is it when you check ownerdrawn for Combobox controls in dialogs, the combobox appears to have grown in height when compiled and run...?
this doesn't make a huge diff, but my colorpicker combobox just doesn't fit in with his fellow brothers, cuz he's a tad larger in the vertical and i don't want him to feel outta place. Is there anyway(which i sure there is) to correct this height difference and how...?
TIA
P.S-This is only my second question posted on an online message board...i've never chatted, joined forums or anything so i'm unsure of the proper etiquette or forum ehtics. What i'd like to know is...will i be hated if i ask too many questions...?
"An expert is someone who has made all the mistakes in thier field" - Niels Bohr
|
|
|
|
|
Perhaps you can override MeasureItem. Not sure about this.
Nish
p.s. No probs with any number of questions. As long as you post them in the right forum
Sonork ID 100.9786 voidmain
www.busterboy.org
If you don't find me on CP, I'll be at Bob's HungOut
|
|
|
|
|
Can I add an icon resourse to a CImageList? I have added bitmaps but can I add Icons, if so how. Thanks.
- Matt Newman
- Matt Newman
-Sonork ID: 100.11179:BestSnowman
|
|
|
|
|
CImageList::Add has this overload which might interest you :-
int Add( HICON hIcon );
Nish
Sonork ID 100.9786 voidmain
www.busterboy.org
If you don't find me on CP, I'll be at Bob's HungOut
|
|
|
|
|
Ahh. I was working with a sample I had a while back and all I saw was the CBitmap. Thanks for pointing that out.
- Matt Newman
- Matt Newman
-Sonork ID: 100.11179:BestSnowman
|
|
|
|
|
When I start a new project, I have Edit at the top
with undo, cut, copy and paste. How can I
activate these options? If I click the right
mouse button on an edit box, then alittle box
pops up which lets me access these commands. But
I would really like to know how to activate the
menu bar Edit command as well. It just seems like
a waste unless its activated.
Please, any response any one can give me will be
greatly appreciated.
Sincerely,
Danielle (an overworked graduate student)
|
|
|
|
|
The edit box is handling these for you in the edit box. To activate them in the menu, you need to write code that handles undo for your app, and cuts/copies/pastes to and from the clipboard.
Christian
I have come to clean zee pooollll. - Michael Martin Dec 30, 2001
Sonork ID 100.10002:MeanManOzI live in Bob's HungOut now
|
|
|
|
|
Change the IDs of the menu items to these values :-
ID_EDIT_COPY
ID_EDIT_CUT
ID_EDIT_PASTE
Nish
Sonork ID 100.9786 voidmain
www.busterboy.org
If you don't find me on CP, I'll be at Bob's HungOut
|
|
|
|
|
Nish [BusterBoy] wrote:
Change the IDs of the menu items to these values :-
ID_EDIT_COPY
ID_EDIT_CUT
ID_EDIT_PASTE
I don't understand - that's what they are to start with, isn't it ? There's still no way that the items will ever be visible unless there are functions linked to them, or does MFC provide basic, text only ones by default ?
Christian
I have come to clean zee pooollll. - Michael Martin Dec 30, 2001
Sonork ID 100.10002:MeanManOzI live in Bob's HungOut now
|
|
|
|
|
Actually MFC provides cut, copy and paste functionality if you use those IDs. But your edit control or view must be in focus.
Create an SDI project using app-wizard and set the CView to CEditView. Now build and run it. Select some text and you'll notice that the cut, copy and paste in the edit menu are now active and fully functional.
In a normal [say a formview] view when we have an edit box, the problem is that when we select a menu item, the edit box goes out of focus and thus the menu items are disabled. But if we have a toolbar and we use these IDs for 3 of the buttons, then we can cut, copy and paste
Nish
Sonork ID 100.9786 voidmain
www.busterboy.org
If you don't find me on CP, I'll be at Bob's HungOut
|
|
|
|
|
Well, you learn something every day. I've always written code that copys/pastes images so I'd never noticed that functionality.
Christian
I have come to clean zee pooollll. - Michael Martin Dec 30, 2001
Sonork ID 100.10002:MeanManOzI live in Bob's HungOut now
|
|
|
|
|
I am trying to create a 3-way static splitter window but have never done this before... What is the best base classes to use for the splitter window to hold a list of variables which can be clicked to change the output in the main CSrollView derived view class?
I am experimenting at present and am just trying to split one window simply by overriding CreateClient as follows
BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext)
{
return m_wndSplitter.Create (this, 2, 1, CSize (8, 8), pContext);
}
But I keep getting an ASSERT(pContext != NULL)
Why is this and how can I fix it?
|
|
|
|
|
You can't use Create for static splitters, you need to use CreateStatic
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 am writing an WYSISWYG HTML editor and was wondering were I should start, a RichEditView capturing the saving and convert it or does someone have a better idea?
- Matt Newman
- Matt Newman
-Sonork ID: 100.11179:BestSnowman
|
|
|
|
|
You could probably use the RichEdit however using the MSHTML editor would be easier and have more fetures by default. I think this is the same COM object that outlook express uses. I'm writting a editor as well, however i've recently decided to settle for non-wysiwyg. Notepad, but syntax highlighting. quick loads on a 266 are everything to me
Check out the following url for more details.
http://msdn.microsoft.com/workshop/browser/editing/activeeditor.asp?frame=true
hope i typed that right
ciao
"An expert is someone who has made all the mistakes in thier field" - Niels Bohr
|
|
|
|
|
|
James R. Twine wrote:
I am not sure what "WYSISWYG" means, but WYSIWYG is "What You See Is What You Get"
I meant WYSIWYG
- Matt Newman
- Matt Newman
-Sonork ID: 100.11179:BestSnowman
|
|
|
|
|
Matt Newman wrote:
I meant WYSIWYG
In that case, the DHTML Editing Component SDK is just what you are looking for: I have used it before to implement a few HTML editors.
Peace!
-=- James.
|
|
|
|
|
Thanks. This is a big help!
- Matt Newman
- Matt Newman
-Sonork ID: 100.11179:BestSnowman
|
|
|
|
|
I want to know how it works with multithreading. When I call AfxBeginThread or _beginthread and the function that I have putted as a parameter in one of them. Is one of those functions calling the function that is specified in AfxBeginThread or _beginthread called and then return to next code after calling AfxBeg.. or _beginth.. while the function parameter still in use? I can't explain but look here:
void Afunction()
{
AfxBeginThread(ThreadFunc, ...)
// Now try do something else
RasDial(); // Perhaps a bad example but..
}
Now what I tried to explain: When now AfxBeginthread is called and the ThreadFunc is called, imagine that it's a very big function that checking the harddrive for mp3 files and then rename all of them and then try to move them to another harddrive, is this procedure running at the same time that RasDial is called or whatever code anyway that comes after AfxBeginThread??
Where an I read about multithreading??
------------------------------
©0d3 ©®4©k3® - That's me!
------------------------------
|
|
|
|
|
Well, a thread is like a microprogram that runs separately from the main thread (though accessing the same global variables). From the point of view of Afunction , AfxBeginThread(ThreadFunc, ...) starts another thread and returns immediately (i.e. whitout waiting for ThreadFunc to complete), going then to RasDial . So, from the user's (and the programmer's) perspective both routines (TreadFunc and RasDial ) are executed in parallel --that's the whole point of multithreading.
The issue of different threads accessing global variables simultaneously can cause a lot of problems that you must work hard in order to prevent. When programming in a single-threaded environment, you implicitly assume that your variables remain unchanged while you're not dealing whith them --now this is no longer true, and a rich theory about simultaneous access to shared resources has been devised to help you design error-free multithreaded programs. This theory includes concepts as synchronization (waiting for completion of another thread's piece of code), exclusive access (methods to reclaim and grant access to some resource to one thread at a time) and more.
You can find several tutorials about multithreading on the net, just spend some minutes with your search engine to locate lots of them. The concepts underlying multithreading are rather platform-independent, so a good tutorial on multithreading in, say, Java will be worth reading tough you're targeting MFC. As a starting point, here's MSDN article Multithreading Tasks.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|