|
well if your a beginner as you say you are then you should study one of the following topics and maybe read a book of them : OpenGL or DirectX(You need the sdk for this, find it @ MSDN website).
[It is possible to represent everything in this universe by using 0 and 1]
I'm going to live forever or die trying.
|
|
|
|
|
It might help to look at an existing clone, I beleive there is one a sourcesforge.net.
There are also lots of sights devoted to game programing that provide: totorials, algorithms, and much more. For a first game I would recommend the book "Action Arcade Adventure Set" By Diana Gruber, if it is still in print. I do not have the www sight handy, do a search for "Fastgraph" on the net, and look for "Ted Gruber Software".
Have fun!
INTP
|
|
|
|
|
|
hi,
I have a client/server app using CSocket and CArchive. There are data transfer in both the directions.
It works well for sometime. Then the client is not getting OnReceive triggered. But using a network monitoring tool, I found that the server is sending the data properly.
How do I found the problem/Debug?
Thanks,
Praba
|
|
|
|
|
It will probably involve setting up the kernal debugger since it is most likely a driver function.
Be warned that it will consume consierable time. You have to wait for it to fail, then break into the program to "see" the conditions present at the time on the loss of communications. Next see if it is repeatable. It will be easier if the problem is repeatable, look through the data being transferred and fin the data that will be transferred just prior to the "bad" condition. set a breakpoint for that condition and single step through the next series untl you find the problem (its not a lot of fun).
It it isn't repeatable, you have to look for similarities in the conditions that exist at the occurrance of each "bad" condition. the identification of the similarity may lead you to a solution, but most likely you will have to devise some sort of break condition that fortells the "bad" condidition, allowing you to step through. this could literally take days.
What I have found is a "race" condition that exists between the time the data is reported as being reay for the receive buffer and the actual data being ready, so when you go to read the buffer you actually get one or two bytes less thean what was reported as being ready, leaving the reporting mechanism in some sort of unknow condition. It thinks it has reported the condition to you and you haven't responded and won't notify again until you have correctly responded to the prior message. It could be caused by some anomoly in the actual data or some mishap in the driver, but it is annoying.
|
|
|
|
|
Hi Dears
I want to develop a MS Word Addin. The main functionality of this addin is:
--> I have to convert MS Word file (.doc) into (.pdf) file format.
What should I take as first step to implement this functionality.
Kindly guide/help me in the form of some code/link.
I'll be grateful to you.
Kind Regards
Atif
Watch Your Thoughts for they will become your actions.
Watch Your Actions for they will become your habits.
Watch Your Habits for they will become your beliefs.
Watch Your Beliefs for they will determine your destiny.
|
|
|
|
|
I would start by getting familar with Microsoft's Interop capabilities, then I would goto http://www.wotsit.org/ and get the format of a ".PDF" file and finally, I would write the code. It would be a tedious process but not shouldn't take too long.
Microsoft's Interop cabilities allow various Microsoft technologies to cooperate together. Depending on your format, the capabilities may help.
However I believe the ".PDF" format is controlled by Adobe and you might need their permission for whatever you are trying.
|
|
|
|
|
Hi,
I'm just starting Visual C++, and in my book--Ivor Horton's Beginning Visual C++ 6--there is an initial section talking about how "data" is stored in a document, and the view displays all or part of the data in a document.
Then it goes into how to draw in a window with functions like LineTo() and Arc(), but what confuses me is those functions are in the OnDraw() function in the view class.
The first line of the OnDraw() function is this:
<br />
void CSketcherView::OnDraw(CDC* pDC)<br />
{ <br />
CSketcher* pDoc = GetDocument();<br />
which seems to make sense--my thought was we would be using pDoc to store the data in the document object and then display it with the view object, but the next lines are:
<br />
void CSketcherView::OnDraw(CDC* pDC)<br />
{ <br />
CSketcher* pDoc = GetDocument();<br />
<br />
pDC->MoveTo(50,50);<br />
pDC->LineTo(50,200);<br />
}
And, when I compile that, it draws a line in the application window. Well, as you can see pDoc was never used to access the document object, and yet the view class displayed data in the application window--I thought the view displays all or part of the data in a document. It seems to me the document got left out of the equation. What's the explanation for that?
|
|
|
|
|
7stud wrote:
CSketcher* pDoc = GetDocument();
I think that should be
CSketcherDoc* pDoc = GetDocument();
Unless you have gone to the trouble of renaming the class.
Check you have a CSketcherDoc class
Yes Doc/View is confusing.
1. Remember you never see the document with it but a view of it inside a frame.
2. You can change the View of the data but the data does not actually change.
Regardz
Colin J Davies
* WARNING * This could be addictive The minion's version of "Catch "
It's a real shame that people as stupid as you can work out how to use a computer. said by Christian Graus in the Soapbox
|
|
|
|
|
7stud wrote:
It seems to me the document got left out of the equation.
You're right - that's a terrible example and speaks volumes about the author and his/her editing crew. Also, as Colin pointed out, it should be CSketcherDoc* pDoc = GetDocument(); , not CSketcher* ... .
A better example would have obtained the coordinates used in the MoveTo() and LineTo() calls from the document. This would reinforce the notion that the document stores the data which is simply rendered by the view. A different view class might simply list the coordinates in a tabular form (perhaps in CListCtrl ) instead of drawing within the view.
Hope this helps.
/ravi
Let's put "civil" back in "civilization"
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
<quote>Also, as Colin pointed out, it should be CSketcherDoc* pDoc = GetDocument();, not CSketcher*
That was a result of my typo.
Thanks for the reply.
|
|
|
|
|
Simple, it is just a bad example. What I mean by that is it is incomplete. Your conclusions of how it works is correct. The information/data is stored in the document and is displayed in the view. What information and how it is displayed is up to the veiw that is displaying it.
One example would be a program that displays numaric data in various forms in different views (using the same data): a spread sheet showing the actual numeric data, a view showing a bar chart or some other type of chart of the same data. When the data is changed in the spread sheet the document is updated with the new data and a message is sent informing all views that the document has changed (been modified) and they need to update their views to reflect the change.
There are some interesting examples in the MSDN Library, if you can find them.
INTP
|
|
|
|
|
|
Hello,
Since you're a beginner whos learing, not everything gets pointed out in detail! I'm almost sure that when you read and learn more that the document will be used inside the OnDraw() and other functions!
(I'm missing 1 line in the code! the 2nd line should be:
ASSERT_VALID(pDoc); )
Good luck...
A student knows little about a lot.
A professor knows a lot about little.
I know everything about nothing.
|
|
|
|
|
The hooking appl is working in GUI mode, but it does not work when I changed it to console mode, that is I call the sethook function by loadlibrary in console exe instead of GUI exe
Has anyone got the reason?
Thanks.
|
|
|
|
|
which hooking app are u talking about?
Don't try it, just do it!
|
|
|
|
|
Actually, I tried to modify keyboard hooks app posted in this site, and the modified version is as follows:
#include "stdafx.h"
#include <windows.h>
typedef BOOL (WINAPI *inshook)();
int main(int argc, char* argv[])
{
static HINSTANCE hinstDLL;
inshook instkbhook;
hinstDLL = LoadLibrary((LPCTSTR) "hodll.dll");
instkbhook = (inshook)GetProcAddress(hinstDLL, "installhook");
instkbhook();
while(1) {
Sleep(100000);
}
return 0;
}
As you can see the console app only load the sethook function to capture the keystroke and then save it to a file, but it does not work.
Do you know is there any difference % console app and GUI app?
|
|
|
|
|
There is this vector of string that has duplicates in it. I am trying to build a second vector of string to hold the non-duplicates.
The program crashes with the following code.
('iterB' and 'iterE' are already defined as iterators of the first vector.)
iterB = Sym.begin();
iterE = Sym.end();
vector<string>::iterator iterNonDup_B;
vector<string>::iterator iterNonDup_E;
for(; iterB!=iterE; ++iterB)
{
if(nonDupSym.empty())
{
nonDupSym.push_back(*iterB);
nonDupCnt++;
}
else
for(; iterNonDup_B!=iterNonDup_E; ++iterNonDup_B)
{
if(*iterB==*iterNonDup_B)
dupCnt++;
else
{
nonDupSym.push_back(*iterB);
nonDupCnt++;
}
}
iterNonDup_B = nonDupSym.begin();
iterNonDup_E = nonDupSym.end();
}
Any help in pointing out flaw(s) would be greatly appreciated.
Thanks!
William
Fortes in fide et opere!
|
|
|
|
|
If nonDupSym isn't empty at the start then iterNonDup_E / B aren't initialized yet which would likely do something bad, like raise an exception.
Neville Franks, Author of ED for Windows. Free Trial at www.getsoft.com
|
|
|
|
|
You should sort (std::sort) on your vector. After it is just a matter of iterating through your vector and looking if the next element is equal.
|
|
|
|
|
When the vector is sorted, you can simply use the std::unique() or std::unique_copy() standard algorithms.
|
|
|
|
|
You can use the STL functions std::sort and std::unique to do this efficiently. Example:
std::vector<std::string> v;<br />
<br />
v.push_back("1");<br />
v.push_back("2");<br />
v.push_back("3");<br />
v.push_back("4");<br />
v.push_back("5");<br />
v.push_back("3");<br />
v.push_back("3");<br />
v.push_back("4");<br />
<br />
std::sort(v.begin(),v.end());<br />
v.erase(std::unique(v.begin(),v.end()),v.end());
- Mike
|
|
|
|
|
Thanks for replying, and thanks for the solution.
There were some things I had to give up (like where the duplicates were entering the vector [for code tweaking at those places]), but I had no problem accepting the trade-off with the solution you offered.
Thanks again.
William
Fortes in fide et opere!
|
|
|
|
|
Hi all,
I am developing a Dialog based application in VC 6.0 and having 2 problems. Below is the code I am writing:
CChildWnd *cwnd ;
cwnd = new CChildWnd() ;
cwnd->Create(IDD_CHILD_WND, this) ;
cwnd->ShowWindow(SW_SHOWNORMAL)
First problem is that, when I am going to MINIMIZE the child MODELESS dialog, instead of going down to the TASK BAR, it minimizes on top of it (above start menu).
Second problem is that, when I am trying to MINIMIZE the parent main dialog window, all the child MODELESS dialogs are also getting MINIMIZE with it.
What i want is that the minimization of parent dialog should not enforce the minimization of child modeless dialogs.
Please can anybody help me in this regard to solve these problems.
Thanks.
The Phantom.
|
|
|
|
|