|
Be sure to use:
using namespace std;
or use:
std::list<double>
Perl combines all the worst aspects of C and Lisp: a billion different sublanguages in one monolithic executable. It combines the power of C with the readability of PostScript. -- Jamie Zawinski
|
|
|
|
|
Good deal, it worked. Thx.
|
|
|
|
|
In order to type angle brackets in a message, use < for < and > for >. These are the 'character entities' in HTML for those respective characters.
Software Zen: delete this;
|
|
|
|
|
Hi all,
I'm using a list<double> variable in my code. Even though I added the #include <list> to the beginning of the file, I keep getting a 'undeclared identifier' message. What's missing? Best,
Ralf.
ralf.riedel@usm.edu
|
|
|
|
|
after the include put this line.
using namespace std;
MSN Messenger.
prakashnadar@msn.com
|
|
|
|
|
I use an owner draw combobox to show a bitmap in front of each item in the listbox.
This works as long as the combobox is a list box. (the drawitem() func is called for each item in the list)
But I want to use a drop down combo (with an edit box)
So I also want to draw a bitmap in front of the value typed in the edit box.
Just like internet explorer does.
How should I do this? Any ideas / code samples?
|
|
|
|
|
I'd be surprised if you don't find an article on this here at CP. Have you searched the site? The edit control would be the only real difference to what you already have and would need specific code.
Neville Franks, Author of ED for Windows www.getsoft.com and coming soon: Surfulater www.surfulater.com
|
|
|
|
|
Hello,
I'm coding two apps that swap data (client / server) over TCP/IP, SOCK_STREAM, using my derived classes from CSocket and CAsyncSocket. Data is stored in a custom struct (size 3k) known to both apps.
Code snippet:
---- sending data using CSocket
tagDATA data; // data to send, its a struct
// use my derived CSocket to send:
m_Socket.Send (&data, sizeof (tagDATA));
----- receiving data using CAsyncSocket
void CMyAsyncSocket::OnReceive(int nErrorCode)
{
tagDATA data;
CAsyncSocket::OnReceive(nErrorCode);
int iRcvd = Receive (&data, sizeof(tagDATA));
// process data here...
}
It all works fine when both programs are running on the same machine, however when transmitting data over the network each 3k data block is chopped into chunks of size (1460 * i) bytes. 1460 seems to be the ethernet frame size.
The problem is of course that I wont receive correct tagDATA objects (I dont get all data with the first call to Receive() ), but instead several chunks for each one send. Is this normal socket behaviour? Will I have to reassemble the received chunks "by hand"? SO_RCVBUF is set to 8k by default. I cannot find any hint about max buffer size in MFC's CAsyncSocket::Receive documentation.
I tested this behaviour with MS MFCSocs example - it seems to behave similar: When sending approx 8k the data gets chopped into two bits (3k and 5k).
Any help is greatly appreciated,
Steve
|
|
|
|
|
Welcome to the wild world of socket programming! This is the normal behaviour. What you need to do is copy the data in chunks to your buffer, keeping a running offset.
onwards and upwards...
|
|
|
|
|
Yes, thanks for your reply. I just completed coding this and it seems to work.
However I'm afraid this will mess up my communication sooner or later: For instance isnt't it possible that one chunk of data might get lost? Afterwards my offset will be invalid and I will interpret all following chunks incorrectly (putting them into the wrong offset into the buffer).
Of course I can reset the offset after a certain time (for instance I notice I only receive "crap") however I think this is more of a workaround than a solution, and all the data chunks from inbetween will be lost too.
Regards,
Steve
|
|
|
|
|
The job of the TCP part of the TCP/IP stack is to resequence the packets in the correct order for you. So, unless you are using very low level socket calls (which I would doubt), you don't have to worry about that.
onwards and upwards...
|
|
|
|
|
|
stevedoulg900 wrote:
For instance isnt't it possible that one chunk of data might get lost?
Yes, if you are using UDP. TCP, however, uses a retransmission strategy to insure that data will not be lost in transmission.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
Using Visual C++ 6.0...
Can someone point me to a sample of putting a splitter into a CView-derived class.
I'm working on a SDI app that supports multiple views, and one of these views needs to contain a splitter.
I've tried a couple of things but can't get the split views to show up in the splitterwnd in the view.
------- sig starts
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
"You won't like me when I'm angry..." - Dr. Bruce Banner
Please review the Legal Disclaimer in my bio.
------- sig ends
|
|
|
|
|
Put a CSplitterWnd member variable in the parent frame, usually CMainFrm . Override the parent frame’s CFrameWnd::OnCreateClient() member function. From within the overridden OnCreateClient() , call the Create() or CreateStatic() member function of CSplitterWnd . There are several examples of this on both CP and MSDN.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
Rather than creating the CView, create a CSplitterWnd.
onwards and upwards...
|
|
|
|
|
Nevermind - I got it.
I had neglected to override OnSize in the parent view.
------- sig starts
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
"You won't like me when I'm angry..." - Dr. Bruce Banner
Please review the Legal Disclaimer in my bio.
------- sig ends
|
|
|
|
|
Hi all,
im getting the following warning message on the below code,
now it seems to work ok, apart from this warning message i get when
i compile
does anyone have any idea's how i can get rid of it
Thanks
Si
warning C4267: '+=' : conversion from 'size_t' to 'int', possible loss of data
void MyFunc::Concat(LPTSTR strDest, LPCTSTR strSrc, int* pnInt)
{
memcpy(strDest+*pnInt, strSrc, _tcslen(strSrc)+1);
*pnInt += _tcslen(strSrc)+1;
}
|
|
|
|
|
_tcslen returns a size_t which I think is an unsigned int. All you need to do is change pnInt to a size_t* or an unsigned int*.
Mike
|
|
|
|
|
Hi
I am doing large application So i want to devlope my Resources like Dialog,Icons,Bitmap in .Dll and call from .exe .
So can anyone give me good example link ?
|
|
|
|
|
no need for the link do the following.
Put all the dll, menu, icons etc in the resrouce only dll,
in the initinstance of your mfc application Load the resource dll using
hRes = LoadLibrary(....);
if(hRes)
AfxSetResourceHandle(hRes);
This will make your dll resource same as ur exe resource. You can use
loadicon, loadmenu etc without passing the resouce handle.
When you want to get the resource handle
AfxGetResourceHandle();
MSN Messenger.
prakashnadar@msn.com
|
|
|
|
|
hi friend ,
i see ur response but when i have try to load modeless dialog from dll it was just get onece blink and then disapper so what should i do for that .. and plz can u send me any example of this sort of dll which loads the dialog and bmp from dll.. if u send me than it's very easy for me..
and can u tell me what should i do for learning more and more abt dll.. because currently my project becomes very big.. so i wanna convert it into dll so that i can get speed..
thanks ..
once again..
and plz give me respose as soon as possible along with example.....
|
|
|
|
|
Was, by any chance, your modeless dialog done like this?
SomeFunctionOrOther()
{
CMyModeless dialog;
dialog.Create(...);
}
If so, then it's nothing to do with DLLs or anything as complicated, it's more to do with the fact that modeless dialogs cannot be done that way.
You'd need
CMyModeless* dialog;
dialog = new CMyModeless();
dialog->Create(...);
since you want the object to exist beyond the lifetime of a frame-based object.
Of course, this doesn't even come close to covering the fact you'd need to either track the dialog object's lifetime, or make it suicidal.
Steve S
|
|
|
|
|
hello friends!
i am wanted write a program that plays wav's continuously.
i am preparing header for each and playing.due to that
in between the wav files i am getting break.for that is it
possible to prepareheader at first and then passing data
to the buffer(streaming like).If possible pls help me ASAP.
Thanks in advance
|
|
|
|
|
Hi friends,
i have developed a ActiveX Control in VC++ and placed in the browser and i am trying to drag a file into that activex control but Internet explorer opening it........it should not like that...it should display the path of that file....of course i am capturing the file path in actievX control.........
is there any script to disable the opening a file when i dragged into activex control..
please help me its very urgent............client is sit on my head....plz
Thanks
Ramakrishna.J
SoftProSys.ltd.
|
|
|
|