|
would anyone know what code starts excuting when the Cwinthread::Create creates a thread ???
|
|
|
|
|
There isn't a CWinThread::Create method.
As about CWinThread::CreateThread method, it is defined in thrdcore.cpp (MFC sources) you may have a look at it.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
sorry still there isn't a thread start function
|
|
|
|
|
The below link will help you.
http://www.codeproject.com/KB/threads/extended_thread.aspx
akt
|
|
|
|
|
Thankx this seems to be what I have been looking for a way to
point to Cwinthread to my own threadproc
|
|
|
|
|
in the example the derived thread CthreaEx sets m_pThreadParms which is a private member of the Base Class Cwinthread ??
|
|
|
|
|
I would like to suggest that you should do a sample application and start debug. Then you can "step into" the code and see yourself what code is being executed.
- ns ami -
|
|
|
|
|
|
I think you've been searching to pass a thread function to CWinThread ?
By any chance you aren't aware an AfxBeginThread(YourThreadFunc) call returns you a CWinThread ?
He never answers anyone who replies to him. I've taken to calling him a retard, which is not fair to retards everywhere.-Christian Graus
|
|
|
|
|
Yes I know but its a plain CwinThread
I would like it to return My own Object Derived from CwinThread e.g.
e.g. as in the MSDN example
so that thread can have acess to my data members function as well as that of CWinThread
// ...
class CSockThread : public CWinThread
{
// ... Other function and member declarations
protected:
CSocket m_sConnected;
};
SOCKET hConnected;
BOOL CSockThread::InitInstance()
{
// Attach the socket object to the socket handle
// in the context of this thread.
m_sConnected.Attach(hConnected);
return TRUE;
}
// This listening socket has been constructed
// in the primary thread.
void CListeningSocket::OnAccept(int nErrorCode)
{
// This CSocket object is used just temporarily
// to accept the incoming connection.
CSocket sConnected;
Accept(sConnected);
// Detach the newly accepted socket and save
// the SOCKET handle.
hConnected = sConnected.Detach();
// After detaching it, it should no longer be
// used in the context of this thread.
// Start the other thread.
AfxBeginThread(RUNTIME_CLASS(CSockThread));
}
|
|
|
|
|
I am not major in Computer science or software!But I am interested in Programming.And I am study it by myself!I have already read a lot of book!But i am still feel that it not enough.In this term,I will try to make some 2D Games To test my level.
But any body can help me.What courses should i learn to become a good Programmer!for example "C++" or "C"!
Thanks in advance!
|
|
|
|
|
learn C++ man.That is most important.
|
|
|
|
|
Whats your favorite?
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
Welcome!
BTW: Do you know there are a lot of punctuation marks other than '!' ?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Archy_Yu wrote: I will try to make some 2D Games To test my level.
I don't think you need to test your self, but...
Archy_Yu wrote: What courses should i learn to become a good Programmer!
... just start programming...
- ns ami -
|
|
|
|
|
Indeed as others say, programming is like driving, you should read the books about it, but you won't learn it unless you do it and do it again and keep doing it for a long long time...
Welcome to the programmer community.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|
|
When you start thinking about building a career in computer science, don't put in a specific language in your mind. You should be strong in concepts. How an OS runs a process? How memory is used by a process (stack,heap), and some data strucures like linked lists, stack, queues, etc. Then I'd suggest you could start with C++ or C#. And it'd be time you would start understanding how a program is compiled,linked,executed. And before you try to make a 3D volume analysis algorithm,Or even a 2D game, I suggest you concentrate on the paraigms. Like OOAD. All the best know languages have adopted OOAD. So you need to be strong with the OO concepts. It doesnt make sense if you write a 2000 line C++ code without knowing OO. What students do is to write C code inside C++ and call it C++. After you become confortable with OOPS you may choose to work with C# or C++. In C# you can easily bring up colorful apps. In C++ little work around would be required. Then you'll have to learn the OS specific APIs to implement them in any language. Because if only you understand the APIs , you'll understand the frameworks around it. Like MFC on top of Win32.
So the road map is clear.
Round1.
HOW-STUFF-WORKS(BASIX)->OOAD(NOVICE)->C#,C++(HelloWorld)->WIN32APIs->MFC/Donet
Round2
HOW-STUFF-WORKS->OOAD->C#,C++(May be your 2D game)->WIN32APIs->MFC/Dotnet
Also when you learn to build programs using frameworks, you should also start learning Databases.
You might notice there's no much difference between Round1 & 2. But it will be totally different when you again take up the books and read. It won't stop with that. Everytime you read it again, you will get better meaning & understanding.
Finally, As you see, there's nothing called "VB" in the road map.
Also an important notice. I'm no expert. I'm someone swiming so hard in between round 2 & 3.
He never answers anyone who replies to him. I've taken to calling him a retard, which is not fair to retards everywhere.-Christian Graus
|
|
|
|
|
anyone know where i can find lessons for webbrowser control - send post data with Navigate2 or Navigate methods?
|
|
|
|
|
see here[^], here[^]. By the way secret search tool[^] you can do some research here.
You need to google first, if you have "It's urgent please" mentioned in your question.
_AnShUmAn_
|
|
|
|
|
Hi,
I am using one own function "XmlFileWriter".In that I want to create one
XML file.
I added following code to stdafx.h
#import <msxml.dll> named_guids
using namespace MSXML;</msxml.dll>
And I have declared following smartpointers in XmlFileWriter.h file.
IXMLDOMDocumentPtr m_plDomDocument;
IXMLDOMElementPtr m_pDocRoot;
In my function I have written Initialization code
::CoInitialize(NULL);
HRESULT hr = m_plDomDocument.CreateInstance(CLSID_DOMDocument);
if (FAILED(hr))
{
_com_error er(hr);
AfxMessageBox(er.ErrorMessage());
EndDialog(1);
}
It is giving Syntax errors 'IXMLDOMDocumentPtr' : ambiguous symbol
'IXMLDOMElementPtr' : ambiguous symbol
Can anyone suggest me how to do it.
|
|
|
|
|
Is it[^] helpful?
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
try with MSXML2......and if not works then mention the line where you are getting the error
Thanks A Ton
Ash_VCPP
|
|
|
|
|
I have used MSXML2 then also I am getting same errors.
I am using Visual Studio 2006.
|
|
|
|
|
Actually this code works under .net platform but its doubtful with one you are using.....i worked for quite a while with xml parsing but did not get this.....if i find anything i will let you know....just do googling....
Thanks A Ton
Ash_VCPP
|
|
|
|
|
You should prefix
IXMLDOMDocumentPtr with your defined namespace MSXML
like :
MSXML::IXMLDOMDocumentPtr
He never answers anyone who replies to him. I've taken to calling him a retard, which is not fair to retards everywhere.-Christian Graus
|
|
|
|