|
Call Invalidate().
Kuphryn
|
|
|
|
|
Call for View 1) Invalidate() 2) UpdateWindow()
===========================
My home is www.brigsoft.com
|
|
|
|
|
I want to create an aplication which will be checking wheater a porno dialer wants to make a connection.
I use RasEnumConnections for checkin the active connections and investigate its phone number. But it seems that the p dialers are smarter than I am, because the localphonebook is 0
is there anyone who knows how they work and what is the best to catch them.
|
|
|
|
|
sorry not localphonebook but szLocalPhoneNumber is alway 0 but the connector calls 0 700 ......
|
|
|
|
|
I have a block of code that is used by multiple threads and need to provide mutual exclusion .
I am doing the following
1. Declaring class member : CCriticalSection cs ;
2. before I spawn these threads I am Initializing the critical Section as
InitializeCriticalSection((_RTL_CRITICAL_SECTION*)&cs);
3. In the thread i do the following :
EnterCriticalSection((_RTL_CRITICAL_SECTION*)&cs);<br />
*<br />
*<br />
LeaveCriticalSection((_RTL_CRITICAL_SECTION*)&cs);
4. I spawn 10 threads as of now and I am getting memory errors left and right . The code works when the calls to enter and leave critical section are commented !
Please help
|
|
|
|
|
Try this:
class MySynchronizedObject {
public:
static CCriticalSection m_cs;
void synchronizedMethod() {
m_cs.Lock();
something();
m_cs.Unlock();
}
}
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Use CRITICALSECTION instead of CCriticalsections , other functions (Enter, Leave) are the same. You can even drop the RTL_CRITICAL_SECTION* .
~RaGE();
|
|
|
|
|
CCriticalSection is a MFC-wrapper around the Critical Section from Win32.
You should call cs.Lock() and cs.Unlock() instead of using Enter and LeaveCriticalSection.
To use Enter and Leave... use a CriticalSection instead, and drop your _RTL_CRITICAL_SECTION* cast.
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
Hi!
How can i use Delete() from CDaoRecordset class to delete records in an Access DB???
|
|
|
|
|
I think it works something like this.
CDaoRecordset rs(&m_DB);
CString cstrSql = "##########";
try{
rs.Open(dbOpenDynaset, szSql);
}
catch{CDaoException* e)
{
AfxMessageBox(e->m_pErrorInfo->m_strDescription);
return;
}
if(!rs.IsEOF())
{
rs.Delete();
}
rs.Close();
Donovan
|
|
|
|
|
Hi, I have a TCP/IP socket, which is created and set up already. I also established the connection between the client and the server.
Now my question is: is there any function to flush the socket? I want to do this because sometimes there is some timing issue between the server and the client, and the client will miss some data. If I do a shutdown(), closesocket(), then connect() on the client side, everything will be back to okay. Is there any easier way to replace the three function calls?
Thanks for any hint!
|
|
|
|
|
What I/O model does the program utilize? For example, one solution is memset() to clear the data buffer linked you pass to WSARecv().
Kuphryn
|
|
|
|
|
I am using TCP/IP socket, and send() recv().
Is WSARecv() more better than recv()?
|
|
|
|
|
Correct.
WSARecv() is IPv6 and is used under non-blocking I/O models.
Kuphryn
|
|
|
|
|
Here's some of my code:
...
BtCard = socket(AF_BTH, SOCK_STREAM, BTHPROTO_RFCOMM);
if(WSAGetLastError() == 10047)
{
cout << "Address family not supported by protocol family!" << endl;
goto GetOut;
}
...
The socket function call above gives me the error message listed.
Checked the help documentation. Here's what "they" says on the use of the function:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/bluetooth/bluetooth/bluetooth_and_socket.asp[^]
Me, wrong!?! Nah, you just need to change your thinking to make me right.
|
|
|
|
|
That's kinda strange.
Do you need a bluetooth update maybe?
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
hi,my friends.
Ijust meet one problem,I hope here must be someone that can help me!
In one of my programs, I use the MFC Grid control 2.24 which is one popular Grid on Codeproject.com.Now I want to place a background Image under the grid.But the CGridCtrl don't have such a function.
and how can I do?
I hope to get your help!
thanks anyway!
|
|
|
|
|
Hello all:
How can I delete the corrupted file ? DeleteFile fails for this file with unknown error code.
Thanks in advance
|
|
|
|
|
What does GetLastError() return?
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
just 0, I am on Windows 98.
Thanks.
|
|
|
|
|
Are you sure you're calling GetLastError() immediately after calling DeleteFile() ?
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Hi all
Can a static function call a non-static function inside the same class?
or
Can a static function call a non-static function in different class?
Thanks
|
|
|
|
|
wow9999 wrote:
Can a static function call a non-static function inside the same class?
no
or
Can a static function call a non-static function in different class?
no
|
|
|
|
|
Yes, no problem. As long as you have the object you wish to invoke the function.
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
Dear Tim Smith
can you show me a example or hint to see a static or non-static funciton to call a static or non-static function.
Thanks
|
|
|
|