|
There's a really good book called "Network Programming with Windows Sockets" that taught me everything. Also with the help from tutorials on codeproject.
Tom Wright
tawright915@yahoo.com
|
|
|
|
|
Do u have a link to it?
_________<br />
I'm made in C++... and I'm proud of it!
|
|
|
|
|
Look on Amazon. Also take a look at Win32 Network Programming. Very good book. Can find this on Amazon.com too.
Tom Wright
tawright915@yahoo.com
|
|
|
|
|
http://Sockets.com[^]
Watch out! I'm a CPian on the edge!
I have a new Gold rating and I'm not afraid to use it! -pete
|
|
|
|
|
halo...
do anyone know wat does the it return U when U wan to use the read sms AT COMMAND?
I have no idea wat to send so I send this... to the mobile phone..
p->Send("AT+CMGL=4");
wat will I have in return.....?
wat Command should I send if I wan to know the amount of read and unread msg I have?
|
|
|
|
|
What is p?
What is the mobile type?
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
p is an object.... which have a method to send AT COMMAND TO my mobile phone...
Now wat I wan most is to know how to read a Message and how many message are there in the phone... so I was able to read the message...
I Found the AT COMMAND in the from the NokiaForum... but how do i do it? do U have any sample? or any web have print screen to show me how to do it?
|
|
|
|
|
Check the Nokia SDK, it has sample to do that and more, ull have full control over the phone.
Search for Nokia PC Connectivity SDK
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
so U tink is it possible I can read my msg in my pda? via IrDA port?
|
|
|
|
|
I try all the AT-COMMAND but my mobile phone only return me "OK"...
y is it so?
my phone do have message in it...
wat result should it show?
anyone know how to solve this problem?
my application is connecting my mobile phone wit my PDA via IrDA.... to see sms in my inbox... do U all know wat Command is able to work or any web tat do the help?
|
|
|
|
|
Just found the following on a mailing list:
extern "C" long_type __cdecl _InterlockedIncrement(long volatile *);
#pragma intrinsic(_InterlockedIncrement)
which gives you an intrinsic increment function (expanding to lock xadd )
(same goes for decrement, of course)
Now this is documented in the current MSDN, and it does work with VC6 but isn't documented in the old MSDN.
Any implications of using it?
we are here to help each other get through this thing, whatever it is Vonnegut jr.
sighist || Agile Programming | doxygen
|
|
|
|
|
In fact this is what the InterlockedIncrement expands into.
InterlockedIncrement
:77E737D1 8B4C2404 mov ecx, dword ptr [esp+04]
:77E737D5 B801000000 mov eax, 00000001
:77E737DA 90 nop
:77E737DB 0FC101 lock xadd dword ptr [ecx], eax
:77E737DE 40 inc eax
:77E737DF C20400 ret 0004
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
Well, the core will be lock xadd [ptr to long value], [register containing 1] , the rest depending on the context and usrrounding optimizations.
(I'm talking about _InterlockedIncrement, not InterlockedIncrement, as for the latter there seems no intrinsic version)
Question, remains: Is the intrinsic version _InterlockedIncrement "documented" or at least "known to be safe" for use with VC6?
we are here to help each other get through this thing, whatever it is Vonnegut jr.
sighist || Agile Programming | doxygen
|
|
|
|
|
Maybe you didnt get me right, but my aim was to tell you that the InterlockedIncrement in kernel32.dll if you decompile it, or follow it through a debugger, will have the assembly in my previous post. Which is "the same" as the intrinsic version.
Whether or not this is safe, or stable has nothing to do with it. If intel and microsoft decided to change the way the LOCK on the memory system bus happen your application would suffer. But that is highly unprobable.
What i would like to understand, is, what gain you get if you use the intrinsic form?
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
My question was just this:
the intrinsic form is documented for VC7, but not for VC6, however, it seems to work on VC6. Are there any known reasons why it wasn't documented? Or any known problems using it with VC6? (might be the optimizer barfing in some cases, or whatever)
Papa wrote:
What i would like to understand, is, what gain you get if you use the intrinsic form?
possible optimizations, since the function can be inlined:
- no function call, stack frame etc.
- this pointer likely in register
- unused return value optimization (the inc eax)
- reuse of a register known to hold the value 1
- better pairing ofthe staements (esp. the lock xadd)
Assuming the this pointer is already in eax , and we are not interested in the return value, the emitted code for InterlockedIncrement(&m_count) falls down to two instructions:
<br />
mov ecx, 1<br />
lock xadd [eax + offset m_count], ecx<br />
Now admittedly the "lock" is pretty much a showstopper and will amount the biggest performance hit. I guess I just pefer a few inlined instructions over a call into kernel32.dll
we are here to help each other get through this thing, whatever it is Vonnegut jr.
sighist || Agile Programming | doxygen
|
|
|
|
|
Is there a way that I can change the actual bytes in the file without reading them into memory? If I have a CFile object, I would like to be able to change every other byte, which would not be as slow as reading all the bytes into memory, then changing them then writing them back, which is VERY slow. Any help would be appreciated.
[insert witty comment here]
bdiamond
|
|
|
|
|
Check Seek and Write
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
What you describe/desire would be painfully slow, as you are operating on a byte-by-byte basis. Read the entire file into a buffer using a single call to Read() . Change the bytes are necessary. Write the entire file from the buffer using a single call to Write() .
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
The way you just described is what I tried at first (although with a CFile object, which may or may not have made it slower). The file was about 300 MB and it was taking so long that I had to terminate the process. I found and modified an algorithm that (after I modified it) reads chunks of no more than 1024 bytes at a time. In a FOR loop for every KB, I increment the counter by two for each iteration and switch the array[i] and array[i + 1] elements and write that to the second file. I do this until all the way through the file. I tested and timed it on a file of over 400 MB and it was done in 1 minute 25 seconds! So that turned out to be what I wanted. You just take the desired file and drop it on the exe, and it goes to work. The only problem I'm still having is that the console window shows up during that whole minute if it's a big file, and I would like to find a way to suppress that. I thank you for answering my question and feel bad if I wasted your time. Maybe I'll start posting replies to my own message with something like 'SOLVED' in the subject so people will know.
[insert witty comment here]
bdiamond
|
|
|
|
|
Since you are reading the file in chunks, you'd be well served by using CMemFile . It'll take that 85 seconds down a few notches.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Hi,
I am populating my list ctrl using the InsertItem method and it works fine because I see everything I want there. The only problem is that the scroll bars will not show up.
the only way to make them appear is to select an item and scroll down the list with the arrow keys. As soon as I scroll down to the border, the scroll bars appear.
Any way to force them to be them from the beginning ?
When I populated the list ctrl using SetItemText, it was working fine.
thanks,
Shay
|
|
|
|
|
Shay Harel wrote:
...the scroll bars will not show up.
Which one, the horizontal or the vertical?
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Vertical.
Here is the code I use to inser the items.
<br />
LV_ITEM lvi;<br />
lvi.mask = LVIF_TEXT | LVIF_IMAGE | LVIF_PARAM; <br />
lvi.iItem = index; <br />
lvi.iSubItem = 0; <br />
lvi.iImage = image;<br />
lvi.pszText = LPSTR_TEXTCALLBACK; <br />
lvi.lParam = (LPARAM) pItem;
<br />
if (m_ctl_files_list.InsertItem (&lvi) == -1)<br />
return 0;
Any way to force the scroll bar to show up ?
|
|
|
|
|
I've not ever seen this type of behavior before. By default, a list control's scroll bar will show up as soon as an item is added that is at or near the bottom of the control. Using Spy++, can you tell me what styles that control has?
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Can anybody tell me how to determine which colour scheme is currently being used (blue, olive or silver)?
Systems AXIS Ltd - Software for Business ...
|
|
|
|