|
Ed K wrote: I'm not sure those numbers would tell anything about using C++ vs C# vs C++/CLI in a real world
Ed K wrote: I'm sold on C++
I'm in total agreement with you. It seemed like you were in a benchmarking mood so I was just putting a road sign up to his article. I'm guessing most people are not as critical of the data they are fed and are willing to accept the results and the choice of the test parameters chosen by the authors. I prefer to be critical of everything I'm fed anymore but I lack the time and the talent to challenge his numbers as he seems to be the most knowledgeable person here concerning the CLI. I believe a little healthy debate or the possibility of a challenge helps keeps everything honest in the end and everyone benefits.
Take care.
|
|
|
|
|
i have a progressbar in my dialog and i have a manifest so it will use xp themes how do i get my progressbar to be smooth? and a different color would be good.
|
|
|
|
|
locoone wrote: i have a progressbar in my dialog and i have a manifest so it will use xp themes how do i get my progressbar to be smooth? and a different color would be good.
PBS_SMOOTH , PBM_SETBARCOLOR and PBM_SETBKCOLOR .
Resource editor has an option for changing from blocks to smooth. Check the styles tab.
PBM_SETBARCOLOR and PBM_SETBKCOLOR are the messages that you use to set the bar color and background color of a progress bar. Use SendMessage .
Nibu thomas
A Developer
Programming tips[^] My site[^]
|
|
|
|
|
i tryed them but my manifest is not letting them change.
|
|
|
|
|
See Here[^]
maybe it is some helpful to you
whitesky
|
|
|
|
|
look at the bottom of that link in the messages there is someone having the same trouble as me.
|
|
|
|
|
Hi,
I've dynamically created some CEditViews in a CScrollView. They look fine on the screen, but I'm not able to print them. According to the docs, CEditView is supposed to support printing. Is that only when it is the View in the Doc Template?
I've tried everything I can think of, short of drawing the strings myself, and can't make it work. I'd greatly appreciate any help.
Thanks!
Richard
|
|
|
|
|
When your view class is derived directly from CEditView, the Print feature works right out of the box. However, you dynamically created those views inside the client area of another view which means the turn-key print feature just ain't happening without, as you said, drawing the strings yourself in the parent view.
I can think of some ways to achieve this but it's way more trouble than it's worth. Coordinating the metrics between controls and windows is one of those things that looks simple but there are quite a few "gotcha's" like this. I spent years trying this and trying that but in the end, if your gonna use views and want controls on them, it's best to go windowless with the controls. This simplifies the things your going to want along the way, scaling, scrolling, printing, double buffering, etc...
|
|
|
|
|
If the client sent 10 bytes.
Then the server recv(socket,buf,20,0).
Is it possible that the client recv recveived less than 10 bytes?
|
|
|
|
|
Most definitely.
It's not a one send call, one receive call situation in networking. It's easy to test network code on a local network and have something that makes that assumption work but the minute you pass that through a router and such, your likely to realize that it gets all broken up and requires you keep posting recv commands until you account for every last byte.
Assume nothing in network programming
-- modified at 23:04 Tuesday 23rd May, 2006
|
|
|
|
|
hi I have posted this yesterday but nobody answered I have searched and added some stuff..maybe somebody know something about it..
Im writing a multithreaded program in borland c++ builder 6 that communicate with serial port..readFile function is on a seperate thread and its called ( the thread) by void __fastcall read_thrd::Execute() (which replace the thread function..)..so how can I write a function that reads the serial port automatically when there is something??..(how to get the serial port status(or whatever) and react to it?)
there are some functions like WaitForSingleObject ,SetCommMask and WaitCommEvent, but I dont know how to use them properly(where to use them? in the reading thread or the main thread?and which flag to use?)
Execute() could be controled by Resume() - will resume its execution- and Suspend() - will pause and suspend its execution- and those two functions are the way to communicate with the thread from the main thread -in addition to Terminate() - , so I can write my code in execute() or in other function and then call it.
now my code it as simple as this: (Im using a butten to call resume)
void __fastcall read_thrd::Execute()<br />
{<br />
FreeOnTerminate = true;<br />
while(!Terminated)<br />
{<br />
ReadFile(Form1->m_hCom, &(Form1->sBuffer), 128, &(Form1->iBytesWritten), &osReader) ;<br />
Suspend();<br />
}<br />
<br />
if(Terminated)<br />
{<br />
void __endthread(void);<br />
}<br />
}
I need to replace it ..so I dont have to click the butten to read the comm port..can you help??please?
|
|
|
|
|
I don't have a specific answer to your question, but there are several articles on CP that you might be able to adapt or learn from, such as:
http://www.codeproject.com/system/serial.asp[^]
Search for "serial" or "com port" in the search bar at the top of CP.
- S
50 cups of coffee and you know it's on!
|
|
|
|
|
The ReadFile call will attempt to read in as many bytes as you say you have room for. If that is 128, and you haven't received 128 bytes, it will continue to wait. If you want to receive a message anytime there is something in the recv buffer, use 1 byte or set the com mask to look for a certain character (e.g. one that you use for the end of a message). The COM port/Serial Port articles on here should be enough to get you started with that.
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week
Zac
|
|
|
|
|
the problem is that: Im using the serial port to operate GSM modem so I need my reading thread to notify me when I recieve SMS for example....and the articals here are using there own libreries..I need something standerd..
|
|
|
|
|
Hello everybody,I have just purchased Visual Studio 2005 and I have problem with the MessageBox funtion!!!
when I write for example MessageBoc("Hello") an error occurs:
cannot convert parameter 1 from 'const char [6]' to 'LPCTSTR'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
There is no problem with other functions like MessageBeep
why????
In Visual Studio 6 there is no such problem
please help
-- modified at 20:27 Tuesday 23rd May, 2006
|
|
|
|
|
I am sorry for the inconvenience but I figured out that the cause was the unicode libraries...
|
|
|
|
|
VC2005 defaults to UNICODE builds. Either turn off the UNICODE option, or use the TCHAR functions and macros
MessageBox(_T("Hello"));
You may be right
I may be crazy
-- Billy Joel --
Within you lies the power for good - Use it!
|
|
|
|
|
MessageBox(_T("Hello"))
hi
|
|
|
|
|
|
Hello. I recently converted a VC6 project to 2005, and am getting the following error:
c:\myApp.cpp(1036) : error C2065: 'm_msgCur' : undeclared identifier
This error is occuring in my CWinApp derived class' Run (). In the previous version m_msgCur was a member of CWinThread, but in 2005 I can only find it in "class _AFX_THREAD_STATE : public CNoTrackObject" in afxstat.h
Can anyone shed some light on where I can get the current message under 2005? Or how this has changed?
Thanks for any thoughts.
|
|
|
|
|
How about this:
_AFX_THREAD_STATE* pState = AfxGetThreadState();
MSG msg = pState->m_msgCur;
?
gmileka
|
|
|
|
|
I need to access the cached user credentials on a Windows XP Pro machine. Specifically I need the logged in User's ID, and the Groups he/she belongs to.
On the PC the user has previously logged in to the DC and accessed it's info in AD.
Now, I need this information when the user is not logged onto the network.
I be doing alot of searches, so far with no luck.
THX
Scott
|
|
|
|
|
I migrated from VC++.Net 2002 to 2003 recently. I see that they have standardized a lot of headers .
My question is regarding this particular prolem I am not able to solve.
In 2002 , I had created a derived class from a filebuf , and had written a function called dump which will write contents of file into the console.
In my application I connect this class to cout , using the following syntax
cout = &buffer ,
buffer is instantiated as static with file desc as 1 .
THis particular setting works in 2002 but in 2003 it gives me an error as operator = not defined.
Why was this change implemented? and Is there a workaround for this ?
I have run out of ideas . I tried to use rdbuf() but it doesnt work either
|
|
|
|
|
cout (and cin, cerr) is generally defined to be a constant. Using operator= on this would be incorrect for several reasons that I won't even get into.
What exactly are you trying to do?
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week
Zac
|
|
|
|
|
Hey there . I want someway to connect a derived filebuf class to connect to the cout.
I try the following code
ostream file(&filebuf class)
cout.rdbuf(file.rdbuf())
These 2 lines shld connect to the cout buffer , isnt it? or am I wrong somewher?
Thanx
Darshan
|
|
|
|