|
I once had a similiar problem so I used the strcmp function. Check out digitalmars.com for the details on dealing with strings, its a great site. Got to the runtime library part.
ALL YOUR BASE ARE BELONG TO MICROSOFT!
Demonware Studios Leader
|
|
|
|
|
I downloaded ISQLMFC_src.zip source code from topic "Interactive SQL Tool (using ODBC)". I used Microsoft Visual Studio .Net 2003 to build it, but I got the following error message: "error C2065: 'm_pchData' : undeclared identifier". What did I miss? Please help me out?
Thank you.
Blakiston
|
|
|
|
|
Hi,
I wanted to learn CommBasic language.... or any language...
where i can write macros....
I decided to learn C, C++... will this be help to me to write
macro on VB flatform.....
SKK
|
|
|
|
|
There ia an arror in the code below , but i am unable to fine some has provided me to find , Please mention it , Thanks
MS_PACKET DataPacket;
memset(&DataPacket,0,sizeof(MS_PACKET));
DataPacket.msHeader.dPacketType = ACM_MSG_SEND_PAIR_ORDER;
strcpy( DataPacket.acmSendPairOrder.m_szAccount ,
szCurrentLogin );
strcpy( DataPacket.acmSendPairOrder.m_szSymbolBuySide ,
pPair->BaseSymbol.szSymbol );
strcpy( DataPacket.acmSendPairOrder.m_szSymbolSellSide ,
pPair->DependentSymbol.szSymbol );
DataPacket.acmSendPairOrder.m_nSharesBuySide =
pPair->BaseSymbol.iNeededShares;
DataPacket.acmSendPairOrder.m_nSharesSellSide =
pPair->DependentSymbol.iNeededShares;
DataPacket.acmSendPairOrder.m_cSideBuySide = 'B';
DataPacket.acmSendPairOrder.m_cSideSellSide = 'S';
DataPacket.acmSendPairOrder.m_nPairID = pPair->nACMPairID;
static int nOrderCounter = 0;
DataPacket.acmSendPairOrder.m_nMPairOrderID = nOrderCounter++;
m_pMTLinkSocket->Send((BYTE*)&DataPacket,sizeof(MS_PACKET));
Regards.
|
|
|
|
|
zahid_ash wrote:
There ia an arror in the code below
Good luck in finding it, especially since you did not indicate whether it was a compiler, linker, or runtime error.
You seem to have narrowed it down to a small section of code. Why can't you single-step through it to find which statement is in error?
"The greatest good you can do for another is not just to share your riches but to reveal to him his own." - Benjamin Disraeli
|
|
|
|
|
I am looking for some solid, unencumbered, source for a C+Tree or, preferably, C*Tree.
Note the words "unecumbered"--at most it must have a zlib type license, it cannot have any requirement to distribute the source; my client will simply not allow it.
Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke
|
|
|
|
|
You mean a tree container class, something that's compatible with STL? Or a tree view control?
I was looking for tree container class myself, but didn't find much that I liked. There's one here on CP that looks quite nice, but it's LGPL so that's a no go, for me.
¡El diablo está en mis pantalones! ¡Mire, mire!
Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)!
SELECT * FROM User WHERE Clue > 0
0 rows returned
Save an Orange - Use the VCF!
|
|
|
|
|
Just a C+Tree with no STL (if someone has put STL on top, that's fine.) I will have to use disk (both to persist the tree and because of memory issues) so a plain C-Tree is out as is STL or MFC classes.
Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke
|
|
|
|
|
How about looking for it in here[^]?
But I wonder whether there is a non-license component that you want.
Enjoy
|
|
|
|
|
Uh, not to be too sarcastic, but I'm looking for C+Tree or C*Tree source code not a tree control. If you don't know the difference, don't respond.
Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke
|
|
|
|
|
I just suggested category collection. but I didn't look for it there. Sorry, it'm my mistake.
But I think it's not good to say like you by reason that you couldn't found it in my reference.
My will was giving help to you although it was not help to you.
|
|
|
|
|
If you do find a free such implementation, which is not an integrated part of a complex system such as a DBMS, please let me know. This is the kind of stuff you normally pay big bucks for.
|
|
|
|
|
Hello everyone,
I am a beginner in socket programming and would like anyone to suggest some basic code-one for the client and another for the server,written in VC++ using MFC's and using the CSocket class,not CAsyncSocket.,or if anyone could suggest a link where i could find some place to start off from,i'd be grateful.Thanks
|
|
|
|
|
Refer here.[^]
You'd better to search in google.
I found it with keyword of "CSocket MFC example".
Enjoy
|
|
|
|
|
try this
CSocket[^]
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
All the articles I have read state that all threads must be terminated before the main thread exits or the program will still be resident in memory.
The question then becomes, how to properly terminate all worker threads?
I have the following:
void CClient::StopThread()<br />
{<br />
m_bRunning = false;<br />
WaitForSingleObject(m_pThread->m_hThread, INFINITE);<br />
<br />
delete m_pThread;<br />
}
And the worker thread is defined as:
UINT CClient::WorkerThread() <br />
{<br />
<br />
while(m_bRunning)<br />
{<br />
}<br />
<br />
AfxEndThread(0,0);<br />
<br />
return 0;<br />
}
The problem is that the program hangs after I call the StopThread function. I am sure I need to signal the function that my thread has terminated but, since I am new to the MFC and multithreaded programming, I am not sure where to do that.
Any help is appreciated. Thanks.
|
|
|
|
|
Never call AfxEndThread, or any similar function. It's bound create problems.
1.
What happens here is that the compiler optimizes away the m_bRunning in your thread since the value is not changed inside the while statement.
Fix this by declaring the m_bRunning variable as 'volatile'.
2.
I assume you start your thread with a call to AfxBeginThread.
If so, you should create it suspended and set the CWinThread::m_bAutoDelete to false to be able to wait for the thread to finish. Delete the CWinThread pointer that you got from AfxBeginThread in your StopThread function.
If you don't do this, a race condition will occur that may result in the thread handle you are waiting for is invalid.
Hope this helps
--
Roger
It's supposed to be hard, otherwise anybody could do it!
|
|
|
|
|
|
masnu wrote: all threads must be terminated before the main thread exits or the program will still be resident in memory
This isn't true - In fact if the "main" thread exits the process exits and any other threads that may be executing are killed on the spot. This is why when exiting the main thread typically waits for any worker threads to finish (using WaitForsingleObject or friends) before bailing: this gives the wokers a chance to clean up after themselves (for example, delete temp files).
Steve
PS: As for how to properly terminate a thread, the correct answer is ask the thread to exit and then wait for it to do so.
|
|
|
|
|
Where can I get a complete list of Win32 error codes. In VC++5.0, am getting a Win32 error 3, the authors say its because of the path specified not found, searched the whole net, but still can't make out what exactly is causing this error...
Would be of great help...
Adnan
|
|
|
|
|
|
True, the System Error codes provide a description, but its the same generic description. Could you tell me what might be causing this runtime error? am specifying all the paths of the DLL,exe,LIB. Am i missing any other environment settings...any help on that?
|
|
|
|
|
Spykraft wrote: Could you tell me what might be causing this runtime error?
Not without seeing the line of code in question.
Spykraft wrote: ...am specifying all the paths of the DLL,exe,LIB.
But are they the correct paths? Are they absolute or relative?
"The greatest good you can do for another is not just to share your riches but to reveal to him his own." - Benjamin Disraeli
|
|
|
|
|
DavidCrow wrote: But are they the correct paths? Are they absolute or relative?
AM giving absolute paths of the DLL and the .exe of my project in the Tools-options-directories and also filling up the System PATH vairable with the same paths, though am still getting that error.
do you have an idea, what are the general locations the loader looks for while executing an .exe ?
Imagine am working on a weekend!
|
|
|
|
|
I usually try to set the error code to display errors when this happens.
SetErrorMode(0) so that all errors are displayed. When all errors are displayed, Windows will tell you which DLL is missing or exported function is not found that your application is trying to load or find. Usually, an application has the error mode set to something other than 0 because it is 'handling' the errors.
Try that and see if you get more information from your program.
People that start writing code immediately are programmers (or hackers), people that ask questions first are Software Engineers - Graham Shanks
|
|
|
|