|
|
You could use the line function as suggested by Priyank or you could
simply use GetPixel() on the cursor coordinates and test the RGB value
returned to see if it matches the color you used to draw the line.
Steve T
|
|
|
|
|
Well I’m trying to create this small app that notifies me how long I have played a game. Now I want it to draw a short message or picture telling me that I have played game for N minutes.
Is it possible and how to display something over a fullscreen directx or opengl game, without interrupting it?
I have already tried with simple dialogs in MFC with Topmost attributes set but it doesn't seem to work on fullscreen games.
I would appreciate suggestions and samples on how to do that.
I'm not so experienced direcx programmer.
~dzenan~
|
|
|
|
|
Hi All,
I have a dialog in DLL, I wish to call this dialog of DLL from an EXE and get some data of this dialog in the EXE.
Can anyone help me.
If I use MFC Extension DLL then I am able to call the dialog but can not read the data.
If I use MFC regular DLL then I can send or read data but not been able to call the dialog of DLL.
An immediate help will be appreciated.
Please mail me at,
lipiraj@yahoo.com
Thanks in advance,
Rajesh
Rajesh
|
|
|
|
|
In an MFC regular DLL export a function that does DoModal on the dialog.
The first line of that exported function must be
AFX_MANAGE_STATE(AfxGetStaticModuleState( ));
« Superman »
|
|
|
|
|
I have a header file x.h as follows
#ifndef _x_h
#define x_h
#pragma once
#include "vv.h" //this gives a set of warning
.............
#endif
I am including this x.h in many .cpp file.
When I compile it gives warning for all the .cpp files. how do I avoid this?
|
|
|
|
|
I think you got the #define wrong
It should be
#ifndef _x_h
#define _x_h
« Superman »
|
|
|
|
|
not only the #define is wrong, but you might write longer macro to ensure that it won't be defined by another module.
i used to define mine like this (let's say, for a file named MyFile.h ) :
#if !defined(__MYFILE_HEADER_INCLUDED__)
#define __MYFILE_HEADER_INCLUDED__
#endif // __MYFILE_HEADER_INCLUDED__
in some cases, copy/paste become a very bad feature to use, but for this, i advise you highly to use it to be certain that you macros are the same everywhere in you header file
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
Hmm. Isn't that "#pragma once" does? Why do you have both preprocessor guards and #pragma once?
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
S. Senthil Kumar wrote:
Why do you have both preprocessor guards and #pragma once?
If one get fail other will do the Work .
But here both of them are failing .
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
ThatsAlok wrote:
But here both of them are failing .
sure, look at his code :
#ifndef <font color=red>_x_h</font>
#define <font color=red>x_h</font>
are these the same ?
moreover, #pragma once were not supported on previous versions of VStudio, and might be not too on another compilers...
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
toxcct wrote:
are these the same ?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
Hello Group
Can anybody in the group Try to Explain,What are Smart pointers and what are the advantages over the pointers and exactly where are they used frequently???
VC++
|
|
|
|
|
Smart pointers can be used wherever you use raw pointers. They basically make sure that every new is paired with a matching delete and that you delete allocated memory only once. Typically, they do this by reference counting.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
First of all very thanks to S.Senthil Kumar for taking time to describe this concept.
But it is bit theoretical can i have some more information on this regarding how to use this concept
VC++
|
|
|
|
|
Take a look at CComPtr class in MSDN. This is an example of smart pointers.
"I would luv to change the world, but they wont give me the source code"
My Articles
|
|
|
|
|
...or search for std::autoPtr for C++ standard
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
Is there any open source codes which can convert OpenGL rendering to HPGL format file?
|
|
|
|
|
Hi all,
I am registering a clipboard format as follows
UINT format = Registerclipboardformat(_T("FileName"));
then using the same format for setting the clipboard data
Setclipboarddata(format,hclipboarddata);
Now when i pass the file name to the handle, i could see in the memory location the path name is correct but after the execution of setclipboarddata command and after closing the clipboard when i see on the clipbook viewer, only drive letter is pasted.
Pl. answer to me ?
Thanks..
Vineet
|
|
|
|
|
In VC++ 5.0 through 7.0 creating a static library is no big deal. Any projects created can find the libraries quite easily. Now I need to use a specific library in a VC++.Net environment and am a loss as to how to.
I am a teacher at a community college and basically teach c++ console applications and the texts that I use currently contain a copy of VC++ 6.0 but our classrooms are fixed with VC++.Net
Any help would be helpful.
I am a new member and hope to submit this particular library that provides a sequre method for fetching keyboard data for all primitive types, strings and dates for console applications which obviate the not-so-secure cin.
DOC
|
|
|
|
|
|
I have an include fiel enums.h that houses off enums used
enum WordDirection
{
Right = 0,
Down,
Diag_Down,
Diag_Up
};
I have a class 'A'
private:
int _iRow;
int _iCol;
bool _bHighlight;
std::vector<cletter> _arrLetters;
WordDirection _enumDirection;
TCHAR _sWord[16];
now adding the include into the cpp seems fine. but the compile flips in the enum line of the include file and says "error C2011: 'WordDirection' : 'enum' type redefinition"
nick
I'm not an expert yet, but I play one at work. Yeah and here too.
|
|
|
|
|
your file is being included more than once, so it's trying to create the enum more than once ( I reckon ). If you're using precompiled headers ( stdafx.h ), try including it in there and nowhere else in your project. The other thing is to put an inclusion guard block around your code so it will only include once. I think #pragma once is all you need to do this, at the top of the file.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I need to close IE after starting IE with Createprocess. I am using ::PostMessage to try to close IE, but it is not working. I want to use Createprocess to start IE.
LPSTR szAPP = "c:\\progra~1\\intern~1\\iexplore.exe";
(CreateProcess(NULL,szAPP, NULL,NULL,FALSE,0,NULL,NULL,&StartupInfo,&ProcessInfo));
Sleep(10000);
hWnd=FindWindow(_T("IEFrame"), NULL);
::PostMessage(hWnd, WM_CLOSE, NULL, NULL);
|
|
|
|
|
Why dont u use ExitProcess API to close it.
"I would luv to change the world, but they wont give me the source code"
My Articles
|
|
|
|