|
Hi
iam using a picture control for showing bitmaps and gif files .but if the picture is big then i wanna show it in scolling manner without resizing my control.
is there any other way(or any other controls) which i can show bmp/gif with scrolling enabled
thanx in advance
buddie
Software Engineer
|
|
|
|
|
What type of app are you bulding? Is it dialog based or SDI/MDI, or don't you use MFC at all?
(2b || !2b)
|
|
|
|
|
Have a look at Microsoft article Q218972. The IPicture interface works fine for me. You would also be able to support JPEG files if you used it.
Hope this helps.
Steve.
|
|
|
|
|
I have an SDI app with static SplitterWnd with two panes. If I load a CFormView in both of them everything works fine. But if I load a CFrameWnd into one of the panes I get an Assertion Error (I think it's either CMainFrame::AssertValid() or CFrameWnd::AssertValid() ) when exiting the app. What am I doing wrong? Do I have to add any member functions to my CFrameWnd class? I've been trying to solve that problem for two days and I'm desperate. Please help me!
btw: In Release mode everything works alright.
Semlo
|
|
|
|
|
Doesn't anyone have a hint for me?
Do you need more detailed information?
please someone help me!
Semlo
|
|
|
|
|
Where do you get the assert? The call stack should show after the break.
Basically, I don't think you can put a CFrameWnd inside a splitter - I think CSplitterWnd expect its children to be CView derivatives. Don't ask me why! If you want to make a convoluted UI with views and splitters inside other views and splitters I suggest you use Zoran Todorovic's Visual Framework (http://www.codeguru.com/advancedui/VisualFx.shtml).
Cheers
Steen.
"To claim that computer games influence children is rediculous. If Pacman had influenced children born in the 80'ies we would see a lot of youngsters running around in dark rooms eating pills while listening to monotonous music"
|
|
|
|
|
Thanks a lot for your answer, Steen!
This really helps me a lot! You guessed right, I want to create a nested splitter. It should look like this:
------------------------------
|*CForm* |***************|
|*View** |***************|
|***1***|***************|
|---------|*****CView***** |
|*CForm* |***************|
|*View** |***************|
|***2***|***************|
-------------------------------
As i have been thinking about putting tabs in "CFormView 2" pane Zoran Todorovic's Visual Framework probably is the perfect solution for me. Thanks for the hint!
Anyway, if someone knows an easier (shorter) way of creating nested splitter please let me know!
Semlo
|
|
|
|
|
How can I do this. Does someone know of a class already created...
thanks
Ralph Krausse
|
|
|
|
|
You'll need to load a bitmap, draw text onto it and save it. The first and third can be done by a class that was added last week, and the middle is easy - CDC::TextOut
Christian
As I learn the innermost secrets of the around me, they reward me in many ways to keep quiet.
Men with pierced ears are better prepared for marriage. They've experienced pain and bought Jewellery.
|
|
|
|
|
Can you give me the name of those classes?
'
thanks
r-
|
|
|
|
|
CXImage. I didn't look it up the first time because it's just in the section on bitmaps, where you'd expect it to be.
Christian
As I learn the innermost secrets of the around me, they reward me in many ways to keep quiet.
Men with pierced ears are better prepared for marriage. They've experienced pain and bought Jewellery.
|
|
|
|
|
|
I'm an amateur programmer, and don't know that much about C++ and MFC. I was wonder just what exactly is MFC? What does it provide for or do for the programmer? What is it used for? Is it used for Win32 programming, or just in general? If it's used in Win32 programming, does it make the programmer's life easier? I would appreciate it if someone would try to answer all of my questions to the best of their knowledge. Thanks.
~dreadknought
|
|
|
|
|
The Microsoft Foundation Classes are a set of classes that encapsulate and extend Win32, which has the net effect of making development more object oriented. For example, in Win32, you called functions to create a device context, stored the handle and then deleted it. MFC wraps those calls into a class called CDC. This is especially helpful if you have Visual Assist, because you create an object, add a dot operator and get a list of available methods, which sure beats looking through MSDN for a function you know exists but can't remember the syntax for. It is also safer because destructors can ensure an item is cleaned up, which is not the case in Win32 unless you write your own class. There are all sorts of additional classes such as CArray ( rubbish, you should use vector ) and CString ( much more useful than std::string ), right through to more complex classes that manage all sorts of things.
Your copy of VC should have come with a wall chart that maps the relationships between all the MFC classes. You'll find the majority of the code on this site uses MFC. VC wizards build all the boiler plate MFC code for you, so for example to create a window or dialog takes more work in Win32, not least because the compiler isn't writing the basic stuff for you.
That's a simplistic explanation but I hope it gives an overview.
Christian
As I learn the innermost secrets of the around me, they reward me in many ways to keep quiet.
Men with pierced ears are better prepared for marriage. They've experienced pain and bought Jewellery.
|
|
|
|
|
Hello, the codegurus around the world.
1) What exactly is MFC?
I used to read some comment of Bill Gates about MFC.
MFC is the creation which the genius programmers of Microsoft made.
MFC consists of the basic three classes like CObject, CWnd, and the other
class not derived from CObject and CWnd, and some classes are derived from
CObject and CWnd.
However, if we read the source code of these classes, we notice that MFC is wrapped by the Widnows API.
2) What does it provide for or do for the programmer?
If we made some GUI application, we at once understand that MFC makes us save the code lines and maintain the code easily.
Basically, Window 32 programming and MFC relation are almost same as C and C++. However, if we make some advanced programming like Network, Window hook,
and the other, we need both MFC and Windows API.
MFC is a powerful class for GUI application, but we also need the knowledge
of Windows API.
Good luck.
Have a nice day!
-Masaaki Onishi-
|
|
|
|
|
MFC consists of the basic three classes like CObject, CWnd, and the other
class not derived from CObject and CWnd, and some classes are derived from
CObject and CWnd.
However, if we read the source code of these classes, we notice that MFC is wrapped by the Widnows API.
Actually CWnd is derived from CCmdTarget, which is derived from CObject. So the majority of MFC classes derive from CObject, but there is a reasonable size group that does not. Serialisation is one reason to derive your own classes from CObject.
2) What does it provide for or do for the programmer?
If we made some GUI application, we at once understand that MFC makes us save the code lines and maintain the code easily.
Agreed - couldn't have said it better ;0)
Basically, Window 32 programming and MFC relation are almost same as C and C++. However, if we make some advanced programming like Network, Window hook,
and the other, we need both MFC and Windows API.
My main reason for replying - I'm afraid this is incorrect. If you look up Window hook in the MSDN, the top two matches are for Windows hooks in Win32. I'd also be amazed if you couldn't write network code without MFC. Given that we're given the MFC source the worst case for someone unable to use MFC for whatever reason is a trip to the source to see how they do it.
MFC is a powerful class for GUI application, but we also need the knowledge
of Windows API.
Again, could't agree more. I don't use MFC anymore, and I'm enjoying learning life without it.
Christian
As I learn the innermost secrets of the around me, they reward me in many ways to keep quiet.
Men with pierced ears are better prepared for marriage. They've experienced pain and bought Jewellery.
|
|
|
|
|
I'm writing an MFC app and I want to access, check out, check in, stuff from a SourceSafe database. Could someone give me pointers or links to a description of how this is done? Even better would be sample code
Everything I've ever found about SourceSafe is how to use it in Visual Studio and not actually how to implement interface to it in a program.
Thanks
===================
Eric "ArchV" Fowler
Ritual Entertainment
|
|
|
|
|
Look on the Microsoft website for something called Repository.
|
|
|
|
|
|
Hello,
I am creating a COM DLL which is like the Outlook Object Model. I have an Application Interface/Coclass etc etc. My question is...how can I have two functions that do the same thing but have different calling methods depending on if you are using VB or VC++? Here's an example... if you look at the _Namespace interface in MSOUTL9.olb type library there is a function:
HRESULT GetDefaultFolder([in] OlDefaultFolders FolderType,
[out, retval] MAPIFolder** Folder);
if you then look at the coclass Namespace it has a function:
MAPIFolder* GetDefaultFolder([in] OlDefaultFolders FolderType);
they both have the same id and helpstring but if you use VC++ you have to call the first one, and in VB the second (due to VB not using Interfaces and using coclasses instead) but how can I create a function like that? I can only create one function with that id or else VC++ complains. Any help is GREATLY appreciated.
Bret Faller
Odyssey Computing, Inc.
|
|
|
|
|
I think you are a little confused there is only one method here.
As you said it is defined in the IDL as
<br />
HRESULT GetDefaultFolder([in] OlDefaultFolders FolderType, [out, retval] MAPIFolder** Folder);
However in the coclass it is
MAPIFolder* GetDefaultFolder([in] OlDefaultFolders FolderType);
VB uses it somthing like this
Dim MFolder as MAPIFolder<br />
Set MFolder = GetDefaultFolder(...)
On the other hand in C++ it is used such as
<br />
MAPIFolder* pMFolder;<br />
HRESULT hr = GetDefaultFolder(... ,&pMFolder);<br />
The trick is the [out,retval] in the IDL definition. VB does not return HRESULT like C++ so this says that this parameter will be returned instead. The out part tells C++ that this parameter will be outgoing.
Clear it up for you?
|
|
|
|
|
Very nice clarification. Thank you very much for your response.
Bret Faller
Odyssey Computing, Inc.
|
|
|
|
|
Hey!
In my program, I'm enumerating the processes in Windows and
I want to be able to call DebugActiveProcess on one of them so
I can capture it's OutputDebugStrings(). But calling
DebugActiveProcess() doesn't seem to work, even if I have
the right process ID. I'm working in both Win98 and 2k. If
I call GetLastError(), in 98 I get an "invalid parameter" (#87)
error message. In 2K, I get an "access denied" error message.
What am I missing?
Steve The Plant
|
|
|
|
|
I just figured out what I did wrong. I was trying to attach a
debugger to a process that already had a debugger attached to
it. I was trying to attach it to a program that was run in
debug mode in VC (ie hitting F5 to run it). Of course, since
it already had a debugger I couldn't attach mine.
So now I know.
Steve The Plant
|
|
|
|
|
I have created a Dialog-based app.
In the header-file I defined a variable CStringArray m_filearray;
If I now open a new dialog using DoModal() I want the dialog to be able to access the CStringArray defined in the "main" dialog.
How can I do this?
|
|
|
|