|
I've already coded something on Palm OS. Using java (j2ee) seemed the best solution. It had wrappers for your color problem
[VISUAL STUDIO 6.0] [MFC] [WIN98/2]
|
|
|
|
|
Thanks for your answer, but it is no problem for me... I only want to know something about the programming (mfc) on a pocket pc with 256 colors...
--> I have to use eVC++ because I can not programming in Java!
--
Nice greets, Daniel.
|
|
|
|
|
I developed a Microsoft Tree Control in Win32 SDK.After adding certain number of nodes i am getting Memory Problem, how can i solve this problem ?
Any help...
Thank you
|
|
|
|
|
Hi,
I've been using a CBitmap obj in my proggy to load images from within the resource file. This is making the .exe's size grow at an alarming rate !
Is there a simple way to load from a file using a CBitmap.
(I've looked through MSDN but can so far only find info regarding resources)
Many thanks
Mike
|
|
|
|
|
I do not know how to load bitmaps from a file, but another alternative pops into my mind.
You can create a separate resource dll (a dll with just a winmain and resources) then load your bitmap resources from there. This will keep your EXE size down which keeping all BMPs in the one file.
AfxSetResourceHandle might prove useful if you are using MFC.
--James Pullicino
Drinking In The Sun
Forgot Password?
|
|
|
|
|
|
How to get the previosly selected index?
|
|
|
|
|
One way is to handle the ON_CBN_SELCHANGE and then call CComboBox::GetCurSel() to get the current selection. Use a member variable inside your dialog/view class to store this value. The next time that ON_CBN_SELCHANGE is triggered you will have the last selection inside your member variable.
--James Pullicino
Drinking In The Sun
Forgot Password?
|
|
|
|
|
I have built up some classes defining my program, they work perfectly in DOS. I am moving in Windows with VC++ 6.0, I am trying to output the messages of my program in a Edit box.
The problem is the intergration part, I have port my program into VC++ environment. I just get mainfrm.cpp to inherit all my functions, and got the program running linking to a menu item.
How do I actually output the messages into a Edit box? I know of using some MessageBox will be able to do that, but the messages are supposed to update the user on the progress of the program, so pressing the "OK" button for the user is quite tedious everytime there is a message!
Any one who has some suggestions on integration into Windows?
|
|
|
|
|
You can use SetWindowText to put text into an Edit Control. Have a look at MSDN for syntax.
Michael
Programming is great. First they pay you to introduce bugs into software. Then they pay you to remove them again.
|
|
|
|
|
All right thanks for info.
|
|
|
|
|
It seems that I could create handlers in these files, that I could used. They are quite similiar in nature, seems to me most of functions are visible to all CView/CDoc/Mainfrm? Anyone care to share what's the different between these files?
|
|
|
|
|
Document hold document data
Main Frame is the main applications window
Views are windows which display the documents data and are children of the Main Frame.
I am assuming that by 'handlers' you are reffering to message handlers.
You have two options: either put your handlers in your Main Frame, or put your handlers in your View. Very rarely will you need to add handlers to your Document since it does not make too much sense.
In reality you will be putting handlers in both your mainframe and your views. Do you want your handler to work in every view or in only one type of view (this is only applicable when you have multiple views, i.e. MDI application). If you want a 'global' handler then add it to your main frame, if you want a 'local' handler (local to a view type), then add the handler to your view.
Also consider the type of access you need in your handler. If you need access to the Document data for example, it will be easier to put your handler inside your view since access to the document from a view is easier than from the main frame. This applies mostly to MDI applications. (SDI applications are much simpler since you can assume only one document, thus making it easier to locate from the mainframe)
In summery, treat every handler differently. Think about what the handler will be used for (logically) so that you can decide whether it should be a 'global' or 'local' handler. Think about the access requirements (do you need access to the document? Do you need access to the MainFrame?). One final tip: Observe and learn the code which ClassWizard generates so that you can modify it and move it around if neccessary.
James Pullicino
Drinking In The Sun
Forgot Password?
|
|
|
|
|
If you talk about ON_COMMAND handlers and such, as I guess, you are free to place them where they are the most "natural". CDoc is great if you need access to the Data your application is working on, in CView you handle a button like "Redraw", which is only interesting for the View.
Generally, if you need ugly casts, you should look for a better site of the handler (but sometimes you just HAVE TO cast).
|
|
|
|
|
Thanks for your replies guys! Just want to make sure we are talking the same thing here. Basically I am confused about where to place my menuitem handler, ie, OnMyMenuItem. They could exist in all the DOC/VIEW/MainFrm, and the functions are accessible in all of them also. Just don't know the different between them. I am working in with a SDI program. So probably, I will be working either with CView/CDoc or Mainfrm/CDoc , right? There isn't much different with CView and Mainfrm since they are the same?
|
|
|
|
|
For me, the CMainFrame(-derived) class is something technical, which tends to be almost empty.
It is not concerned with the data of my application, rather with window-drawing issues.
My application data is stored in the CDoc, and most manipulation routines are there.
My CView get the data (or rather references to it) and put it on the screen in a ordered fashion (like vector of numbers to line plot).
So - my menu handlers are almost always in CView/CDoc, and CMainFrame is empty and boring.
|
|
|
|
|
I want to add tree control in the left view of my SDI application in MFC, also i want to add events regarding each Child node of the tree..
Any Help ??
ThankU
|
|
|
|
|
Since you are working in an SDI environment, I am assuming that you have a splitter pane, and that yout left view is the left pane.
A splitter pane is contained and created in your MainFrame class, probably in OnCreateClient(). Locate the code and find the section which creates the views. With some work you can replace the current left view (which is probably a CView) with a class derived from CTreeView.
An easier approach is to use ClassWizard to generate an 'Explorer Style' application. You can also do this to study the code which class wizard generates and then modify your current application.
--James Pullicino
Drinking In The Sun
Forgot Password?
|
|
|
|
|
Hi All,
I need to assign a simple string say "Administrator" to the LPCWSTR variable within the program.How do I do it.Is there some type casting available to do this.
Thanks
Abhishek.
Learning is a never ending process of Life.
|
|
|
|
|
u mean how to assign a char buffer to a wide-char (short char) buffer, do it as:
char*psz=new char[100];
psz[99]=0;
WORD*pwsz=new WORD[100];
while(*psz!=0)
{
*pwsz=(WORD)*psz;
psz++;
pwsz++;
}
*pwsz=0;
includeh10
|
|
|
|
|
LPCWSTR var = L"Administrator";
MS quote (http://www.microsoft.com/ddk) : As of September 30, 2002, the Microsoft® Windows® 2000 DDK, the Microsoft Windows 98 DDK, and the Microsoft Windows NT® 4.0 DDK will no longer be available for purchase or download on this site.
|
|
|
|
|
Thanks a Lot
Regards
Abhishek.
|
|
|
|