|
mrby123 wrote: I tried to set-up a breaking point inside "Next", but the program did not go that far
Does the "Next" button have an ON_BN_CLICKED() handler? What does the message map for CData_vib_procDlg look like?
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
here is the message-map:
BEGIN_MESSAGE_MAP(CData_vib_procDlg, CDialog)
//{{AFX_MSG_MAP(CData_vib_procDlg)
ON_WM_SYSCOMMAND()
ON_WM_PAINT()
ON_WM_QUERYDRAGICON()
ON_BN_CLICKED(IDNext, Next)
ON_BN_CLICKED(IDExit, OnExit)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
|
|
|
|
|
Hmmmm, if you've set a breakpoint in the Next() method and it is not being hit, I do not know what the problem is.
You mentioned something about an array. Does your program have them? Are they on the stack or the heap?
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
Now I found the array size is too big (global array - stack ?)
I get into the Next subroutine. I put a few breaking point and I checked the reading
all right.
However, I got:
"Debudg assertion failed."
what is the problem and how to fix it ?
Thanks
|
|
|
|
|
mrby123 wrote: Now I found the array size is too big (global array - stack ?)
How is it declared? How large is it?
mrby123 wrote: I get into the Next subroutine.
What statement?
mrby123 wrote: However, I got:
"Debudg assertion failed."
what is the problem and how to fix it ?
That's hard to say without knowing what line of what file asserted.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
Are there any necessary apis that I should know?
I think my question was too short to understand. I want to disable internet using(such Web browsing,Chat or anything using internet) by press a button and can use internet again by press another button.
I want to know how to stop internet in windows 98.
I'm not good at English sorry.
-- modified at 3:18 Tuesday 11th April, 2006
|
|
|
|
|
What is an "apis?" What are you wanting to know?
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
T532 wrote: Are there any necessary apis that I should know?
actually what you want ot do.. close internet connection or something else, if internet connection hook InternetDial api
|
|
|
|
|
DEF Files seem to have gone out of fashion. Where do I find an Authorative account for Syntax and Options.
Immediate Needs: Shared Data Sections in a DLL
A Forwarder DLL:
'MyApi=ANOTHERDLL.?PrivateMyApi@@YAKKKKK@Z'
LateNightsInNewry
|
|
|
|
|
LateNightsInNewry wrote: DEF Files seem to have gone out of fashion.
See here.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
I have seen your See Here, and read all that, What it does not explain is the Syntax of Forwarding a Function. DEF Files seem to have gone out of fashion to the extent that the only help the IDE gives, is, (in my version anyways), that All you can do in a DEFFile, can be done better by using command line options for the Linker/ Compiler. I know that not to be the case, but hence my question.
LateNightsInNewry
|
|
|
|
|
I want to draw a bitmap,(droughts for example)on dialog,
at mouse's coordinate when it's pressed !
Could you help me !
Lgx
|
|
|
|
|
This is Not a simple Problem, and a Full solution for your own custom application will resort to a long list of API's
The Outline would be as follows:-
-Create a Dialog with a Bitmap Resource in it.
-Assign a Bitmap
-In the Dialog, implement the OnPaint Method to paint the Bitmat,taking account of where you want it painted.
-Use the WM_MOUSEBUTTON messages to capture the mouse when it is clicked over the immage
-Use the WM_MOUSEMOVE messages to track the mouse, and to issue WM_PAINT messages to keep the image following the mouse.
(The Latter is not as simple as it seems)as you will discover.
You will also see that the easier UpdateWindow Call does not work for this in a dialog, it only sends a WM_PAINT after you finally release the mouse button.
As I said, Not a simple task, there is not a single API available that does the lot, Also, not a task for beginners(Choose something simpler, i.e. Move the Image to where the mouse was released, without dragging), at the same time, we all have to start somewhere. The prize is, that when you master this, you have learned a lot about the Windows API.
Let me know how you get on
Regards
LateNightsInNewry
|
|
|
|
|
thank you !
i am studying to build a program that play chess(or gomoku) over LAN !
i will build it step by step !
there are very much so program !
when you click mouse on coordinate(x,y) on the board,
drought (stone) will paint !
i want also do that !
have you ever done that ?
Lgx
|
|
|
|
|
No, I have never build a program that play chess(or gomoku) over LAN !.
However, I see that you are taking on a very complex task. If I where you, I would break the task up into a number of DLL's
Seeing that you want to play some sort of game over a network, you will need somewhere where the score is kept, i.e. a server for the purpose of the game.(This need not be the Network Server). The way I would write this would be, Game server Software, which keps track of the various games being played, and which would need no other interface than something to keep track of players and scores, and Client software, which monitors the Game moves, and communicates same with the Game server. The game Server in this case would be the final arbitor on the legality, or otherwise, of any moves.In this scheme of things, you need to think first of exchange protocols for this type of information, implementation of game rules, etc, etc.
I would be inclined at the development stage at least, to implement the clients as a console program, i.e. a Chess Move is implemented by a client by typing something like "E2->E4!, and getting back an error message like: "Err 4087: Sorry, The Piece on Field E2 is a Knight, For a Knight the move E2->E4 is Illegal". After you have this Up,Going and Debugged, you can write some beautiful graphics to simulate the game, using essentially the same messaging service to the server.
Hope this is Usefull,
LateNightsInNewry
|
|
|
|
|
http://www.codeproject.com/internet/renju.asp[^]
thank you for sincere advice !
sorry for my bad English !
the game that i want buid that don't need game server !
for example, game :HalfLife,age of empire,...
all is only a program !
when a person run game program, that person can establish
that is server program, other persons who want join in will click "show all game" and see a game that they want play with and therefore this program is client !
score and other information is stored temporality, when game over, that information is lost.
the game that i want buid is don't need in real time mode
it's turn move by move !
especial, i want that : when game is being played, everybody can see all game is playing, opening(that game is created but nobody join in)
the this game have many characteristic similar to multiuser chat program !
the link i wrote upper is renju game program over LAN
i hope that you will for me many your advice !
see you !
|
|
|
|
|
I think you are doing this the wrong way.
First you don't really to handle the WM_MOUSEMOVE message unless you are drawing to a particualr size or dragging a bitmap across the screen.
Second, you don't need to draw the bitmap to the exact position of the mouse for the game you have mentioned.
Consider this. you have a checkerboard, each square being 20x20 pixels, you have a checker piece 15 pixels in diameter. now, if the user clicks the board at say 5,5 of a square (upper left corner), and you draw the piece (from the center) at these coordinates, the piece will overlap into the neighbouring squares.
Here's your solution. create a map of your board (an array holding position of each square). Check for user mouse clicks, when user clicks, check the position against those in your array to find the square. Then draw the bitmap to the center of that square.
This type of game is called a "tile based game", a search on google will yield many results. Also if you are keen to start coding games, I would recomend a library called Allegro, which enables you to handle bitmaps and user input very easily.
|
|
|
|
|
of course as you say about overlap
the thing that i want say is how to paint a bitmap when mouse click event happened and location that bitmap is drawed is belong to coordinate of mouse !
i tryed many code but if i minimize the dialog of program,
then nothing to see!
void CGomokuDlg::OnMouseMove(UINT nFlags, CPoint point)
{
// TODO: Add your message handler code here and/or call default
if((nFlags & MK_LBUTTON)== MK_LBUTTON)
{
//get Device context:
CClientDC dcc(this);
//draw pixel:
dcc.SetPixel(point.x,point.y,RGB(0,0,0));
}
CDialog::OnMouseMove(nFlags, point);
}
void CGomokuDlg::OnLButtonDown(UINT nFlags, CPoint point)
{
// TODO: Add your message handler code here and/or call default
CClientDC dc(this); // device context for painting
CBitmap bitmap;
bitmap.LoadBitmap (IDB_BITMAP1);
CDC dcMem;
dcMem.CreateCompatibleDC(&dc);
CBitmap* pOldBitmap = dcMem.SelectObject(&bitmap);
CPen pen1(PS_SOLID,16, RGB(255,100,0));
dc.SelectObject(&pen1);
//dc.StretchBlt(100, 130, 20, 20, &dcMem,
// 0, 0, 20, 20, SRCCOPY);
dc.MoveTo(0,0);
dc.LineTo(30,400);
CDialog::OnLButtonDown(nFlags, point);
}
-- modified at 22:14 Sunday 9th April, 2006
|
|
|
|
|
See the following link
<a href="http://www.codeproject.com/buttonctrl/hoverbutton.asp" rel="nofollow">http:
Knock out "T" from CAN'T
You 'CAN' if you think you 'CAN'
|
|
|
|
|
I have a spoiled problem with OpenFileDialog in .net 2003, if the number of files inside a folder was too much, I can't see anything to select. Does anybody have any experience with this problem?
Let's come together to know more!
|
|
|
|
|
LRESULT CALLBACK KeyboardHookProc( int code,WPARAM key, LPARAM lParam)
{
(1) if (((DWORD)lParam & 0x40000000) &&(HC_ACTION==code))
{
...
(2) GetKeyboardState(ks);
...
(3) ToAscii(key,scan,ks,&w,0);
}
...
}
Please, could somebody explain in simple terms what the meaning of lines 1..3 is. I've been doing my nut trying to figure it out, and good Net explanations are thin on the ground. Your help is deeply appreciated.
EvScott
|
|
|
|
|
Have you looked up those functions in MSDN? MSDN has a pretty plain explanation that I can parrot here but it is easier for you to look it up yourself. If you need any clarification then post a more specific question.
You may be right
I may be crazy
-- Billy Joel --
Within you lies the power for good - Use it!
|
|
|
|
|
Could you post the Complete Code, rather than the bits you seem to consider important. It is actually quite simple, and all well documented. Just, the snippet you show leaves out the reasons for calling the API's
LateNightsInNewry
|
|
|
|
|
Hi,
I am using Visual Studio .NET 2003. I'd like to know if there is some way to run a memory leak checker (like CodeGuard in Borland C++).
Thank you,
Rafael Fernández López.
|
|
|
|
|
install Bounds Checker
never say die
|
|
|
|
|