|
You could monitor the LBUTTONDOWN and LBUTTONUP combinations to determine if the user clicked the mouse. You would then determine the rectangle where the buttons are on your image, and you could check to see which button should be clicked (if a buttons should be clicked) by testing the point that was clicked in the function PtInRect.
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
fatal error RC1004: unexpected end of file found
File of interest is a header file as follows:
// define for the application icon
#define ICON_T3DX 100
// define for the application cursor
#define CURSOR_CROSSHAIR 200
// define for the application music
#define SOUND_ID_MUSIC 1
// defines for the top level menu OPTIONS
#define MENU_OPTIONS_ID_PRINT 1000
#define MENU_OPTIONS_ID_EXIT 1001
// defines for the top level menu HELP
#define MENU_HELP_ABOUT 2000
#define MENU_HELP_INSTRUCTIONS 2001
Tried including stdafx.h but it didn't fix it.
Help!
|
|
|
|
|
How does your CPP file look like. The oroblem may be because of header files included before or after. How do you know that this is the file that causes the error.
|
|
|
|
|
Message Closed
modified 21-May-21 21:01pm.
|
|
|
|
|
Suppose I have just installed VS .NET, and there were no earlier version of VC++ on my machine, would I be able to run pre-.NET applications on my machine? IOW, would I be able to run unmanaged C++ applications on my computer?
Thanks.
William
|
|
|
|
|
Of course! Do you think Microsoft would kill of such a huge amount of applications just because you installed VS.NET? Pretty much everything in the world is written in unmanaged code!
-Domenic Denicola- [CPUA 0x1337]
MadHamster Creations
"I was born human. But this was an accident of fate - a condition merely of time and place. I believe it's something we have the power to change..."
|
|
|
|
|
Do you think Microsoft would kill of such a huge amount of applications just because you installed VS.NET?
If only they could, they only would.
|
|
|
|
|
to get the device context of a dialog box we write the statement
CClientDC dc(this);
what if i have to get the device context of a picture box control.
God helps those who help others.
|
|
|
|
|
Just replace this with a (CWnd derived) control reference:
CClientDC dc(&m_myPictureBox);
- or -
CClientDC dc(GetDlgItem(IDC_MY_PICTURE_BOX));
/moliate
Two o'clock and walking through familiar London - Or what was familiar London before the cursor deleted certain certainties -
I watch a suit and tie man giving suck to the Psion Organizer lodged in his breast pocket
its serial interface like a cool mouth hunting his chest for sustenance, familiar feeling, and I'm watching my breath steam in the air.
Neil Gaiman - Cold Colours
|
|
|
|
|
I have opened a dialog with the CreateDialog function, and used ShowWindow etc. to show it. but when the user presses the X in the upper right corner, it closes my whole app, not just the dialog, what do i do?
Thanks
-Rune Svendsen
|
|
|
|
|
Possibly your dialog proc is posting a WM_QUIT message with PostQuitMessage as part of its handling of WM_DESTROY , which causes the main thread to stop pumping messages. Just omit it, or override the handling of WM_DESTROY and do not call PostQuitMessage .
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
|
Hi
Does anybody know how can i limit line lenght in multi line edit control?
for example: i want every line in the edit to be less than 10 chars.
thanks
|
|
|
|
|
If you handle EN_CHANGE and test if the current line that the user is writing contains 10 chars.
Understand?
Rickard Andersson@Suza Computing
C# and C++ programmer from SWEDEN!
UIN: 50302279
E-Mail: nikado@pc.nu
Speciality: I love C# and C++!
|
|
|
|
|
I get this error when trying to compile my project. I also get a similar error for 'stdafx.h'. I have put those file in my project workspace and also included them in my .cpp file (i.e. #include).
Any suggestions?
Thanks
|
|
|
|
|
The compiler needs to know where the library is, along with the header file. Go to project->settings and hit the link tab. You'll need to have winmm.lib in the object/library modules editbox somewhere.
Simon
I need your clothes, your boots, and your copy of VS.NET.
Sonork ID 100.10024
Current Addiction : Colin Mcrae Rally 2.0
|
|
|
|
|
Aren't you doing #include <winmm.lib> , are you? If you are, I think #include <winmm.h> will solve your problem.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Do you know which directory (and subdirectory) 'winmm.lib' is located? It's usually under Microsoft Visual Studio\VC98\Lib.
What you need to do, is to go to Tools->Options->Directories and right under the "Show directories for:" window you'll have to scroll down to "Library files" selection and make sure the directory path is shown for where "Microsoft Visual Studio\VC98\Lib" is located. That will tell the system where to find 'winmm.lib'.
Wish you success!
William
|
|
|
|
|
Niether of the above seem to work...
I'm really stuck
|
|
|
|
|
I have items in a file and each item has 50+ parameters. I have the item names in a tree control. I was wondering what the best way is to store all the parameters. I would like something that would be similar to:
itemName = GetSelectedItem();
then something like:
itemName.GetFirstParameter();
Any tutorials on how to do something like that?
-Raffi
|
|
|
|
|
do you know how linked lists work? well... if so, you could have a linked list of linked lists (that's confusing)... to start, just try an array of linked lists. after that, you can make it a linked list of linked lists.
lemmie know if you want a more specific answer
peace
omoshima
modified 21-May-21 21:01pm.
|
|
|
|
|
Sorry if you saw it 2nd time. But I need answer for this.
Can you give me some lines of code about:
-Get coordinates of the current character (in current line) in a rich edit control.
Ex:
CPoint pt;
pt=Get....(); //or something like that
Thanks.
Hung Son
A Vietnamese student
i-g.hypermart.net
dlhson2001@yahoo.com
|
|
|
|
|
Try GetCaretPos
Best regards,
Alexandru Savescu
|
|
|
|
|
Hi.
I have a question about software design pertaining in particular to MFC and Windows programming in general. Windows programs rely heavily on messages. Objects sends and receive messages. Is it conventional to keep classes independent one of one another and/or is it conventional to integrate all classes and objects into on system of classes?
For example, I have a simple doc/view (SDI) program. There is a function in doc called Divide(). This function performs a divide of two integers. Now, let say I have a dialog box that requires the use of division. The difference is that the dialog box is not meant to perform division. It requires division for another purpose. In the case above, is it conventional to send a message back to main frame and then redirect the message to doc to perfect the division? Is it conventional to just create a new function for that dialog box?
If it is conventional to create a new function for the dialog box, then how about if the similarity is a structure, or a class?
Messages in Windows open up new doors for programmers allowing programmers to try out more tools.
Thanks,
Kuphryn
|
|
|
|
|
Others' opinion may vary, but mine is you should avoid accessing funtcionality thru Windows messages whenever possible. This introduces very strong dependencies on the overall architecture of the app, and makes it harder to eventually reuse some of the components you've written in other programs. In the very simple case you describe, unless your dialog box is strongly coupled to the whole application, it is better to pass it a "divider" object it can use for their dividing needs. Something like this:
class Divider
{
public:
virtual int divide(int a,int b)=0;
virtual ~Divider()=0{}
};
...
class YourDialogBox
{
public:
YourDialogBox(Divider& divider,...)
...
}; When launching the dialog, just pass a Divider -derived class that access the Doc and performs the required operation. This way you have a reusable dialog box with no particular dependencies on the rest of the app.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|