|
Already tried something making such a macro, but I'm having a problem with 16 bit cards that hold an extra bit for green. Seems like the green bit is misrepresented when I re-assign it.
Isaac Sasson,
Small time programmer - complainer at large!
Sonork ID 100.13704
|
|
|
|
|
Oh - I think sometimes red gets 6, so it's 6, 5, 5. The green would be off because it lost it's most significant bit.
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002
|
|
|
|
|
Excuse me Sir,
Does anybody have seen the movie Snatch? I would like to find the site for the fanclub! Thanks, and I also write program, but not very well yet (JUST STARETED!)
Heralo
|
|
|
|
|
SUPER_PROG wrote:
ForumVisual C++
Subject:Re: PLZ Help me
Sender:SUPER_PROG
Date:1:02 7 Nov '02
Excuse me Sir,
Does anybody have seen the movie Snatch? I would like to find the site for the fanclub! Thanks, and I also write program, but not very well yet (JUST STARETED!)
This is great - very funny indeed.
I suppose I should tell you this is not the place to ask, but I must admit I love that movie too. I doubt it has a fan club.
If you're learning to program, you'll find CP a very useful resource. Just don't annoy everyone by asking questions that are off-topic, OK ?
Is this the first time someone posted to the programming forum when it should have been the lounge, instead of vice-versa ?
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002
|
|
|
|
|
Christian, the usual traffic cop[^].
Back to real work : D-23.
|
|
|
|
|
Hey - I don't look like that !!!
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002
|
|
|
|
|
Yes, but you get the idea.
Back to real work : D-23.
|
|
|
|
|
Hmm, that's the first time I've seen a non-programming question here instead of the lounge.
I wonder if a big red "Please don't ask non-programming questions here, go to the lounge!" message would confuse people too much
--
Help me! I'm turning into a grapefruit!
|
|
|
|
|
I suspect that anyone who reads the forums a bit before posting anything learns that there is a greater risk of being flamed if you ask ANYTHING in the lounge.....
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002
|
|
|
|
|
*looks about innocently*
--
Help me! I'm turning into a grapefruit!
|
|
|
|
|
Why is it that off-topic threads always get more replys than valid threads?
Is it just the vultures replying?
*flap* *flap* *flap*
*Scwalk*
Roger Allen
Sonork 100.10016
I have a terminal disease. Its called life!
|
|
|
|
|
Hi.
I am working under an MFC environment. I would like to know, What is the performance difference, if any, resulting from the use of _beginthreadex and MFC's AfxBeginThread for an IOCP Winsock model client and server? I understand that for an MFC project, we should use MFC's AfxBeginThread to generate the threads. Nonetheless, does an IOCP client or server require or performs better via _beginthreadex?
The reason I am wondering about this is that I saw some really good examples IOCP servers where the developers used _beginthreadex with MFC instead of AfxBeginThread(). Here is one example.
http://www.codeproject.com/internet/winsockiocp.asp
-----
A second question related to IOCP, _beginthreadex, and MFC's AfxBeginThread is the callback function.
Under MFC's AfxBeginThread, you basically send/post messages from the worker thread the IOCP GetQueuedCompletionStatus() function returns. One the other hand, with _beginthreadex, you have the option of passing in a pointer to the class object itself (this). Thus, you can call a function to process incoming data directly without relying on send/post message.
I would like to know, Is the analysis above true. In other words, does the use of send/post message via IOCP worker threads negatively affect performance?
Thanks,
Kuphryn
|
|
|
|
|
Look into MFC sources, Afx... internally uses _begin.... i'd say, so performance will be the same
rrrado
|
|
|
|
|
AfxBeginThread() is just a small wrapper around _beginthreadex and does some extra MFC structure initialisations on thread creation and some cleanup on thread termination. If you are using the DLL version of MFC you don't have to care that much about it, because the same job is done in MFC42.dll's DllMain().
From the performance point of view both should be pretty the same. I usually prefer _beginthreadex() - just because you may decide one day to throw MFC away from your server app (which is not that unlikely, believe me )
--
Daniel Lohmann
http://www.losoft.de
(Hey, this page is worth looking! You can find some free and handy NT tools there )
|
|
|
|
|
Okay. Thanks.
Excellent point on portability.
Kuphryn
|
|
|
|
|
I have a class ParticleExplosion which has a member function void update() :
class ParticleExplosion {
public:
void update();
};
...and a vector of pointers to ParticleExplosion objects
vector< ParticleExplosion * > explosions;
Here, I the iterator I need, set it equal to the first item in the vector, then step through the vector, calling ParticleExplosion::update() every time...
std::vector< ParticleExplosion * >::iterator vItr;
vItr = explosions.begin();
while( vItr != explosions.end() )
{
vItr->update();
++vItr;
}
But, I get this error:
left of '->update' must point to class/struct/union
I've also tried this with:
*vItr->update();
**vItr->update();
*vItr.update();
**vItr.update();
...just in case *something* would work.
So, my question is: what is the correct to dereferencing the vector iterator correctly, so that I can access the object member functions?
|
|
|
|
|
(*iter)->method()
Some STL implementations allow you to write iter->method() but Microsoft's is not one of them, IIRC.
|
|
|
|
|
This is a common enough gotcha that I thought this was what you were asking about when I saw the header. You need to do this:
(*vItr)->update();
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002
|
|
|
|
|
|
Hi,
I posted a message to a thread in another class and found that paramters wrapped in wParam turned out to be an empty data struct.
the precondition is: I had used "new" to create parameters wrapped in wParam before posting.
Any Example to illustrate ur opinion is appreciated.
Thanks in advance
Extreme programming. Do the No.1
|
|
|
|
|
from inside a dialog box in an MDI app
void CDlgbtnChart::OnOK() <br />
{ <br />
UpdateData();<br />
UpdateData ( FALSE );<br />
m_SingleSpan;<br />
<br />
Chart(m_DFile, m_LFile, m_PathName", m_SS, true, true );<br />
<br />
// Is this the correct way to open the file into the editor?<br />
CMultiDocTemplate* pDoc;<br />
pDoc = new CMultiDocTemplate(IDR_PLUTOTYPE,<br />
RUNTIME_CLASS(CPlutoDoc),<br />
RUNTIME_CLASS(CChildFrame),<br />
RUNTIME_CLASS(CPlutoView));<br />
pDoc->OpenDocumentFile(m_sPathName);<br />
<br />
CDialog::OnOK();<br />
}
"Democracy is two wolves and a lamb voting on what to have for lunch.
Liberty is a well-armed lamb contesting the vote."
Ben Franklin - 1759
|
|
|
|
|
kjessee wrote:
UpdateData ( FALSE );
This does nothing - you did not change the variables, so why shove them back up into controls you're about to destroy ?
kjessee wrote:
m_SingleSpan;
Is there some code inside <> missing here ?
kjessee wrote:
// Is this the correct way to open the file into the editor?
It's the wrong spot - the dialog should not be responsible for opening a document, I'd be doing it when the dialog closes, if the return value is IDOK. I believe that the mainframe also has methods for opening a new file, which do all this for you, but I could be wrong.
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002
|
|
|
|
|
I took out some code to make it easier to read.
|
|
|
|
|
article referece: (http://www.codeproject.com/asp/cookie.asp)
Two Questions:
QUESTION 1: method, input/output parameters and return
method prototype: STDMETHODIMP CCookiesCtrl::GetCookie(BSTR *bVal)
Note that it takes ONE input parameter between the bracket - bVal.
QUOTE from article "Type GetCookie for Method Name and [out,retval] BSTR *bVal for parameter."
ASP call:
str=obj.GetCookie()
What da..? shouldnt GetCookie take one parameter, and what's the return type anyway? what's STDMETHODIMP? Can u pass variable by reference/by value? And what about custom data type/struct/class?
QUESTION 2:
is there anywhere i can check "progID" besides "ATL Object Wizard Properties>Name"??
Thanks!
norm
|
|
|
|
|
OK. First of all, when you define your COM function, your IDL ( which defines the interface ) can specifify a parameter as IN or OUT. An OUT is a returned value and must be a pointer. The last parameter can also be OUT, RETVAL, which means in script, because the HRESULT is not returned, the parameter is instead.
Secondly, Javascript typically does not require you to specify the return type - that is why a JScript function always has 'function' next to the name, not a return type. The return type is whatever type you put next to the word 'return'.
STDMETHODIMP is a macro that basically just makes the return type a HRESULT, as they are for all COM calls. You are also limited in what you can pass in, basically I think anything you can shove into a VARIANT can be passed into a function. No custom structs or classes, you can pass an enum value though. ( that's just a number anyhow ).
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002
|
|
|
|
|