|
I was missing this little gem LPRECT lpRect = ( LPRECT )lParam;
Thanks alot,
It seems that the rect which GetWindowRect sets doesn't actually get used after my WM_MOVING hanlder is complete.
|
|
|
|
|
beeejay wrote: It seems that the rect which GetWindowRect sets doesn't actually get used after my WM_MOVING hanlder is complete.
Read what MSDN says about lParam as on WM_MOVING event...
<code>lParam: </code>
Pointer to a <code>RECT </code>structure with the current position of the window, in screen coordinates.
<code>To change the position of the drag rectangle, an application must change the members of this structure.</code>
|
|
|
|
|
I need to learn fast about the creation of ATL Composite Control Projects.
Where could I find abundant information about this??.
Maybe a tutorial in the WEB.
Maybe a book.
I have read a lot about ATL projects but I need something specific about Composite Controls. Something that teach me how should I move inside this kind of project.
I have some good skills with MFC and I'm learning general ATL stuff.
Thank you very much.
Demian.
"I have always wished that my computer would be as easy to use as my
telephone. My wish has come true. I no longer know how to use my telephone."
-Bjarne Stroustrup, computer science professor, designer of C++
programming language (1950- )
|
|
|
|
|
|
Did you see C++ Libraries On codeproject
|
|
|
|
|
hi good day to everyone. why do i have this kind of warning to my functions?
warning C4100: 'nFaceRecNo' : unreferenced formal parameter
what does it mean? thanks for your reply
positive vibes
|
|
|
|
|
It means that the parameter "nFaceRecNo " isn't used in the function. The best way to get rid of this warning is as follows:
void Foo(int n)
{
}
void Foo(int)
{
}
Note that in the code without the warning I've removed any parameters which I don't use in the function from the function definition. It can still be present in the declaration. There are other ways of resolving this problem but this is how I normally deal with it.
Steve
|
|
|
|
|
thanks so much steve... problem solved here
positive vibes
|
|
|
|
|
We have several VC7 MFC and ATL applications and are wondering whether to port them over to VC8. The main reason is so that we don't have a mix of development environments - some projects using vs2003 and some using vs2005.
But are there any advantages as far as the libraries go - STL/ATL/MFC? I understand the main change is in the C runtime string functions to reduce buffer overflow problems. Any other changes for better or worse?
|
|
|
|
|
Yes, basically if you use C string functions, you'll get a warning. Beyond that, I see no compelling reason to change, there are some breaking changes for standards, but all reasonably obscure.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Sir,
I want to learn how to make a web application in vc++.net.
Please send any link .
Thanks.
|
|
|
|
|
I don't believe you can use C++ for ASP.NET. Your profile says you know ASP.NET, why do you want to write a web app in c++ ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Hi..
Is there a way to prevent a file from being opened in windows ....
The System is not a part of any network..
There is No other users except Administrator is available in the system.
Thanks
Luck is Opportunity with hardwork
|
|
|
|
|
Asking the question again will not change the answer....
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Luck is Opportunity with hardwork
|
|
|
|
|
Sir,
I want to connect the database(Sql Server) to vc++.net 1.1 programically.I also want to use insert delete update queries in the form .Please help me or please send any link for the problem.
Thanks.
|
|
|
|
|
Did you search on codeproject?
|
|
|
|
|
it is the classic "hello,world" example, I am using VC++6.0,when I create a project and include the .h and .cpp file into it and compile, it pops out these errors:
--------------------Configuration: chapter 1_0 - Win32 Debug--------------------
Compiling...
hello.cpp
Linking...
nafxcwd.lib(thrdcore.obj) : error LNK2001: unresolved external symbol __endthreadex
nafxcwd.lib(thrdcore.obj) : error LNK2001: unresolved external symbol __beginthreadex
Debug/chapter 1_0.exe : fatal error LNK1120: 2 unresolved externals
Error executing link.exe.
chapter 1_0.exe - 3 error(s), 0 warning(s)
[code]
//Hello.h
class CMyApp : public CWinApp
{
public:
virtual BOOL InitInstance ();
};
class CMainWindow : public CFrameWnd
{
public:
CMainWindow ();
protected:
afx_msg void OnPaint ();
DECLARE_MESSAGE_MAP ()
};
//Hello.cpp
#include <afxwin.h>
#include "Hello.h"
CMyApp myApp;
/////////////////////////////////////////////////////////////////////////
// CMyApp member functions
BOOL CMyApp::InitInstance ()
{
m_pMainWnd = new CMainWindow;
m_pMainWnd->ShowWindow (m_nCmdShow);
m_pMainWnd->UpdateWindow ();
return TRUE;
}
/////////////////////////////////////////////////////////////////////////
// CMainWindow message map and member functions
BEGIN_MESSAGE_MAP (CMainWindow, CFrameWnd)
ON_WM_PAINT ()
END_MESSAGE_MAP ()
CMainWindow::CMainWindow ()
{
Create (NULL, _T ("The Hello Application"));
}
void CMainWindow::OnPaint ()
{
CPaintDC dc (this);
CRect rect;
GetClientRect (&rect);
dc.DrawText (_T ("Hello, MFC"), -1, &rect,
DT_SINGLELINE ¦ DT_CENTER ¦ DT_VCENTER);
}
|
|
|
|
|
See MSDN article Q126646.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Oh, I forgot the project setting: "using MFC in a shared DLL"
|
|
|
|
|
|
Hello everyone!
OK, I've been making posts about this specific mother-freaking hair-greener problem, but now I got it just where I want it: I got it down to a 34-line file, no references to it in the rest of the program, just included once in my Includes.h file... Here it is:
<br />
#ifndef _MAPHANDLING_H_<br />
#define _MAPHANDLING_H_<br />
<br />
namespace MapHandling<br />
{<br />
struct TileFile<br />
{<br />
SDL_Surface *layers[4];<br />
<br />
int s, w, h;<br />
<br />
TileFile() : s(0), w(0), h(0) {}<br />
<br />
TileFile(int size, int w, int h, const std::string& filename) :<br />
s(s), w(w), h(h)<br />
{<br />
layers[1] = IMG_Load(filename.c_str());<br />
<br />
if (!layers[1])<br />
exit(0);<br />
}<br />
} Tilesets[1];<br />
<br />
void LoadTiles()<br />
{<br />
Tilesets[0] = TileFile(24, 3, 2, "./Graphics/Tiles.png");<br />
}<br />
};<br />
<br />
#endif // _MAPHANDLING_H_
Note that the exact same thing happens on both VC++ 2005 and Code::Blocks. (Different error messages, of course, but same idea)
These are the VC++ errors:
1>------ Build started: Project: War Game, Configuration: Release Win32 ------<br />
1>Compiling...<br />
1>Player.cpp<br />
1>Main.cpp<br />
1>HelperFuncs.cpp<br />
1>Game.cpp<br />
1>Generating Code...<br />
1>Linking...<br />
1>HelperFuncs.obj : error LNK2005: "void __cdecl MapHandling::LoadTiles(void)" (?LoadTiles@MapHandling@@YAXXZ) already defined in Game.obj<br />
1>HelperFuncs.obj : error LNK2005: "struct MapHandling::TileFile * MapHandling::Tilesets" (?Tilesets@MapHandling@@3PAUTileFile@1@A) already defined in Game.obj<br />
1>Main.obj : error LNK2005: "void __cdecl MapHandling::LoadTiles(void)" (?LoadTiles@MapHandling@@YAXXZ) already defined in Game.obj<br />
1>Main.obj : error LNK2005: "struct MapHandling::TileFile * MapHandling::Tilesets" (?Tilesets@MapHandling@@3PAUTileFile@1@A) already defined in Game.obj<br />
1>Player.obj : error LNK2005: "void __cdecl MapHandling::LoadTiles(void)" (?LoadTiles@MapHandling@@YAXXZ) already defined in Game.obj<br />
1>Player.obj : error LNK2005: "struct MapHandling::TileFile * MapHandling::Tilesets" (?Tilesets@MapHandling@@3PAUTileFile@1@A) already defined in Game.obj<br />
1>..\Release/War Game.exe : fatal error LNK1169: one or more multiply defined symbols found<br />
1>Build log was saved at "file://c:\Incoming\War Game\Visual Studio 2005\Release\BuildLog.htm"<br />
1>War Game - 7 error(s), 0 warning(s)<br />
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
If I remove the #include to this file, it compiles zezw. (Zero Errors, Zero Warnings).
Can anyone tell me what's the problem? I have another file that does the same thing, so I'll post it if needed... Thanks!
Windows Calculator told me I will die at 28.
|
|
|
|
|
Aha! The problem is with variable and function declaration... Look:
<br />
#ifndef _MAPHANDLING_H_<br />
#define _MAPHANDLING_H_<br />
<br />
namespace MapHandling<br />
{<br />
struct TileFile<br />
{<br />
SDL_Surface *layers[4];<br />
<br />
int s, w, h;<br />
<br />
TileFile() : s(0), w(0), h(0) {}<br />
<br />
TileFile(int size, int w, int h, const std::string& filename) :<br />
s(s), w(w), h(h)<br />
{<br />
layers[1] = IMG_Load(filename.c_str());<br />
<br />
if (!layers[1])<br />
exit(0);
}<br />
} TF;
<br />
void func() {};
};<br />
<br />
#endif // _MAPHANDLING_H_<br />
Look at the lines with the HERE on them... Those two cause trouble (a few redefinition errors). So, anyone guess what's wrong? Thanks!
(PS: I doubleposted because the first post would look too long... )
Windows Calculator told me I will die at 28.
|
|
|
|
|
Hello all,
I've downloaded Visual C++ Express Edition for the first time and I enjoy programming with it. I have a question that I can't seem to figure out. Everytime I start a new C++ project, I have to constantly write the preprocessor directive "#include <iostream>" in my programs. How do I go about starting new projects with this directive already included in my programs? Thanks!
|
|
|
|
|
You can't. Having to put that through your files is part of C++. You may be able to create an appwizard that has the includes you tend to use in your main cpp file, but that's about it.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|