|
Where do I find out if it's a unicode build? Actually, I think non-unicode would make my life easier...
------- sig starts
"I've heard some drivers saying, 'We're going too fast here...'. If you're not here to race, go the hell home - don't come here and grumble about going too fast. Why don't you tie a kerosene rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
John Simmons / outlaw programmer wrote: Where do I find out if it's a unicode build? Actually, I think non-unicode would make my life easier...
Sorry John, the issue with explicit constructors I mentioned does not apply to your case.
And anyway, your code is not a Unicode build, since the CString accepted the non-Unicode string (in a Unicode build you'd have been forced to specify an L"..." or use the _T macro)
Also I tested out the following code on my VC++ 2005 and got the correct results.
void MyFunction(CString sVal)
{
if (sVal.IsEmpty())
{
AfxMessageBox("Empty String");
}
else
{
AfxMessageBox(sVal);
}
}
void ThisFunction()
{
CString myString = "test";
MyFunction(myString);
}
That code snippet message boxed "test" as expected. So, my best guess is that something happens before the CString gets to MyFunction.
Regards,
Nish
|
|
|
|
|
I have written some code to change the screen resolution and depth then return them to their original settings. All works fine, but the Windows taskbar moves occasionally to about midscreen. Is there a function which automatically refreshes the taskbar to the bottom of any reresed window? Or a windows function I can use to move the taskbar to the required bottom edge of the visible screen?
Many thanks
u6ik
-- modified at 7:43 Monday 16th January, 2006
|
|
|
|
|
Well, after a bit of digging I found the answer myself.
SHChangeNotify(SHCNE_ASSOCCHANGED, SHCNF_IDLIST, NULL, NULL);
You need to notify the shell of a change and force a refresh. No need to move the taskbar around yourself, Windows realises there has been a change and corrects the taskbar positioning.
All good
u6ik
|
|
|
|
|
how can we calculate the length of sent data, from client side ,at server side.
i am sending data from client side but i am not able to know the accurate length of this data at server side.
Thanks N Regards
Bankey Khandelwal
Mobile : 98504-32990
Office : 020 25521888
Solversa Technologies
15, Yeshwant Ghadge Nagar,
Range Hill Road,
Pune - 03,Maharashtra,India.
|
|
|
|
|
If I understand the question properly, you can send a header that contains the length of the packet that is arriving. So when you recieve a packet, you always read a fixed length structure that contain the length of the data arriving, then you can allocate space for the incoming data.
Does that address you question?
|
|
|
|
|
how can send haeder i am sending and receiving as follows
rVal=send(sock, text, strlen(text), 0);
rVal=recv(sock,data,strlen(data),0);
but i am sending text but i can not receive accurate length of text. please send me if you have any example code.
and also a another problem is i have to send to multiple cleint so which method i should apply.please reply me ASAP.
thanks
|
|
|
|
|
Sorry I do not have example code to send - this is something that I did long ago on a DSP processor.
What you can do is send and recieve twice, something like this:
typedef struct{
int packetId; // if this is appropriate for you needs
int len;
}packet_S;
sendHdr.len = strlen(text);
rVal=send(sock,sendHdr,strlen(packet_S),0);
rVal=send(sock,text,sendHdr.len ,0);
rVal=recv(sock,recvHdr,strlen(packet_S),0);
dataLen = recvHdr.len;
rVal=recv(sock,data,dataLen,0);
As far as the best way to send to multiple clients, I do not know. You might do well to post a separate question in the forum again.
I hope this helps.
|
|
|
|
|
Hi all,
I am new to C++ and I want to get the value from a text box merge it with another string and then re-populate the text box. I am using the text box in a windows form.
Here is the code I have tried but doesn't work
string S1;
S1 = this->textBox1->Text;
textBox1->Text = S1 + "Test1";
Thanks
Ben
|
|
|
|
|
You would be having some control for the text box.
If not go to class wizard and create it. Let us name it as tb.Now you can access the text box text by calling GetWindowText. Modify the string and use SetWindowText to set the text back to the text box
Regards
Anshuman
|
|
|
|
|
|
prefer the GetWindowText() and SetWindowText() that handles CString s :
CString strMsg = <font color=gray>" World"</font>;
CString strEditContent; <font color=green>
<font color=green>
CEdit* pEdit = (CEdit*)GetDlgItem(IDC_MY_EDIT</font>);
<font color=green>
pEdit->GetWindowText(strEditContent);
<font color=green>
strEditContent += strMsg;
<font color=green>
pEdit->SetWindowText(strEditContent);
TOXCCT >>> GEII power [toxcct][VisualCalc 2.20][VisualCalc 3.0]
-- modified at 7:18 Monday 16th January, 2006
|
|
|
|
|
|
Gktony wrote: string S1;
S1 = this->textBox1->Text;
textBox1->Text = S1 + "Test1";
this is certainly a VB++!!
0x0400:
"But your mind is very complex, very tricky. It makes simple things complicated. -- that's its work. And for centuries it has been trained for only one thing: to make things so complicated that your life becomes impossible."- Osho
<marquee scrollamount="1" scrolldelay="1" direction="up" height="10" step="1">--[V]--
|
|
|
|
|
Thank you all for your replies. I see you are using SetWindowText() and GetWindowText(). In the meantime I have tried the following and it worked.
String* S1 = textBox1->Text;
textBox1->Text = String::Concat(S1, S"Test");
Am I not suppose to code like that in C++ as there are better way of doing it?
Thanks
Ben
|
|
|
|
|
it seems that there had a misunderstood.
you are coding for .NET framework (so your question should be asked in the C++/CLI forum).
our answer were in fact for Win32 / MFC...
so don't take them in account.
TOXCCT >>> GEII power [toxcct][VisualCalc 2.20][VisualCalc 3.0]
|
|
|
|
|
I have initialized all the namespace declaration in a certain .h file. Then include the .h file in a CView class, it turned OK,
But when i used the same namespace and include the .h file in a CDialog class. An error occurred: "Already defined in CView.obj file".
HOw can I access a namespace in 2 separate classes or files?
|
|
|
|
|
|
hi ,
i made an application that can receive a file as unicast and multicast it in dialog based application , but it works only once ,mean to send another file i have to restart the application , so i think using thread i will not require to restart the application , it will receive data as unicast and send it as multicast ,
plz help me to do it ,if possibe give me an example of code.
my id is tosachingupta@gmail.com
thanks
sachin
|
|
|
|
|
cancerion wrote: but it works only once ,mean to send another file i have to restart the application
What has threads got to do with it. There must be something wrong with your application design.
Well as far as threads are concerned you can use
AfxBeginThread(...) //for starting off a thread
AfxEndThread() //to clean up a thread.
And take a look at the CWinThread class too.
cancerion wrote: if possibe give me an example of code.
my id is tosachingupta@gmail.com
Run
Jesus Loves <marquee direction="up" height="40" scrolldelay="1" step="1" scrollamount="1" style="background:#aabbcc;border-bottom:thin solid 1px #6699cc">
--Owner Drawn
--Nothing special
--Defeat is temporary but surrender is permanent
--Never say quits
--Jesus is Lord
|
|
|
|
|
Its simple as that.. (this is a worker for you!)
in the header, declare as
UINT Threader(LPVOID p);
void realThread();
in the implementation,
UINT YourDialog::Threader(LPVOID p)
{
YourDialog* me = (YourDialog*)p;
me->realThread();
return 0;
}
void realThread()
{
do
{
}while(1);
}
then as said by drawn, you can use AfxBeginThread to start the thread
ie,
CWinThread *cwt=AfxBeginThread(realThread,this);
cwt->suspend();,cwt->resume(); ..ect then the thread is under your control
0x0400:
"But your mind is very complex, very tricky. It makes simple things complicated. -- that's its work. And for centuries it has been trained for only one thing: to make things so complicated that your life becomes impossible."- Osho
<marquee scrollamount="1" scrolldelay="1" direction="up" height="10" step="1">--[V]--
|
|
|
|
|
|
Can someone please write me a procedure which rescale a video image in UYVY format, from size 352*288 to 117*96 (scale factor of 3)? Please help. Thanks in advanced.
|
|
|
|
|
Hi,
How can i change the caption of the columns headers using the MS DataGrid 6 ?
Is there any way to find out which record is selected using the mouse click event ?
Best Regards,
sdancer75
|
|
|
|
|
There is one thing I can't figure out with VC 6.0 & ADO. How can I change the 'Background Fetch Size' (DBPROP_ASYNCFETCHSIZE) property of the recordset running asynchron? It's the number of records retrieved between two fetchprogress events. It's default is 15.
It's easy to do it in VB, but in VC++ before opening the recordset, I don't have any dynamic properties available, after executing the SQL the property is read only. I suppose if it's possible in VB it must be possible in VC++ 6.00 as well. I've hard times finding any docs about it even in SDK. As far as I know this OLEDB property is supported by the Cursor Service, which is initilaized when changing cursor to adUseClient.
Any idea?
|
|
|
|