|
Not quite, but thanks for the advice. Actually, I am trying to use raw winsock functions with the MFC socket classes, but the includes are messing me up.
Anyone else done something like this? I had originally started out writing my own wrapper class for the socket functions, but thought it would be better to use MFC's classes if possible.
|
|
|
|
|
The function CAsyncSocket::OnRecieve will be called by the framework when CSocket has data to be read. Just derive your own class from CSocket and overload this function. Whenever it's called there is data to be read, and you can do whatever you want, like call another function to take care of the reading. Use the CAsyncSocket::Recieve function to read the data.
Sprudling ![Big Grin | :-D](https://www.codeproject.com/script/Forums/Images/smiley_biggrin.gif)
|
|
|
|
|
I want to read CD_Rom's Label in my CD drive when windows start and if it is the right CD I want to execute an .exe file. How can I do this? Thanks right now
Kemal ÖZLÜ
|
|
|
|
|
When "windows start", or when a user logs in?
Anyway, add your exe to HKLM/.../RunOnce. Make your exe enumerate the CD-ROM devices on your system (if you only want drive-letter-mapped devices use GetLogicalDrives(), if not you need to use FindFirstVolume() & co. - it depends on the target OS). CheckDriveType() and then GetVolumeInformation() to get the label. There are then a few different ways to start the target exe: CreateProcess(), ShellExecute() and system() comes to mind.
|
|
|
|
|
Hello
I was wondering if there is a kind soul out there who would be willing to help me out ?
I am currently undertaking C++ market research and need to find out statistics on the most commonly used libraries.
Does anyone have any such data or know where I might find it ?
Look forward to hearing from kind souls soon ![Smile | :)](https://www.codeproject.com/script/Forums/Images/smiley_smile.gif)
|
|
|
|
|
The most commonly used type of C++ library is the standard C++ library provided with any C++ implementation (even that there still are no such implementation available - a few comes close though).
Out of those I'd say there is no dubt that the most widely commercially distributed (and possibly also used) are different versions of the Dinkumware library, since Dinkumware is the vendor of the libraries shipped with the different versions of MSVC.
For free libraries I'd expect STLport to be the #1 C++ library both used and distributed. You should probably also consider counting the GNU C++ library.
|
|
|
|
|
Mike
Thank you for getting back to me. I most appreciative of the information.
![Big Grin | :-D](https://www.codeproject.com/script/Forums/Images/smiley_biggrin.gif)
|
|
|
|
|
I salute you all,
How can i make MS Paint's Curve EXACTLY?
|
|
|
|
|
Since it is a Bezier curve, I'd suspect PolyBezier would do it.
|
|
|
|
|
MSPaint draws cubic Bézier curves with two end points and two control points. See <a href="http://msdn.microsoft.com/library/en-us/gdi/linecurv_2d2q.asp?frame=true">PolyBezier</a> for details.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
I want to develop an application about memory in VC++6.0, but I have no idea on how to get files name in memory, anyone can help me for that? Many thanks
|
|
|
|
|
What do you mean by "get the file name in memory"? Could you please ellaborate?
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
I want to display top 5 files memory use in my win2k system. Do you know how can I get the file name in memory directory through VC function or windows API? Thanks again.![Smile | :)](https://www.codeproject.com/script/Forums/Images/smiley_smile.gif)
|
|
|
|
|
Excuse my poor understanding, but what does "top 5 files memory use" mean? Remember it can make a lot of sense to you but makes little as an out-of-context question.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
well....that is my definition for my application. That means the largest 5 files which are used in the memory.
|
|
|
|
|
I think he means he wants to determine the top 5 currently running .exes that are using the most memory. Looks like time for toolhelp.dll.
/ravi
"There is always one more bug..."
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Do you have any idea with that?
|
|
|
|
|
Hi there!
How do I force my Slider's OnCustomdraw() to be called from an OnMouseMove()?
I've added a second thumb to the default slider control. When moving the mouse the second thumb isn't draw/erased until the mouse button is erased.
Also tried from within OnMouseMove() the following:
GetClientRect( &rc );InvalidateRect( rc );UpdateWindow();
Doesn't work...
Thanks!
Martin.
|
|
|
|
|
I am trying to write my own class CDisplayPrintTemplate which is derived from CFormView. This FormView works fine on its own, but the following lines cause problems when i try to create a new class based on my CDisplayPrint Template:
// CDisplayPrintTemplate.h
public:
enum { IDD = IDD_DISPLAY };
it compiles and works unless i include the file and try to use it as a base for another class.. i tried getting rid of this completely, but then i error on the constructor because there is no blank constructor:
// CDisplayPrintTemplate.cpp
CDisplayPrintTemplate::CDisplayPrintTemplate()
: CFormView(CDisplayPrintTemplate::IDD) // < here
{
is there a way to use my CFormView based class as a base for other classes?
thanks in advance!
-dz
|
|
|
|
|
i guess i should mention that the error i get when it is included is:
"'IDD_DISPLAY': undeclared identifier"
again, i don't get this error when i use the class on its own, only when i try to base a class off of it and the file is included.. IDD_DISPLAY is the form from the dialog editor
-dz
|
|
|
|
|
Most likely CDisplayPrintTemplate.cpp is including resource.h prior to CDisplayPrintTemplate.h , which provides for the missing identifier. If you don't do the same when including CDisplayPrintTemplate.h somewhere else the compiler won't find IDD_DISPLAY .
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
there was no include of resource.h in either one.. there aren't in almost all of my files.. i guess maybe it inherently includes it or something.. i added the includes to both files as the first include and that fixed it.. then i figured out how to call the CFormView constructor when my class was constructed.. thanks so much for your help it worked !
-dz
|
|
|
|
|
hi there,
how do you convert a standard template string to an ATL LPCWSTR?
thanks
|
|
|
|
|
If you use the c_str function, it will return a LPCxSTR. Depending on if you are using MBCS or UNICODE std strings, it will return LPCSTR or LPCWSTR. If you are using std::string, then you can use the A2CW macro.
LPCWSTR psz = A2CW (str .c_str ());
BUT, there are some gotcha's.
A2CW uses stack space. So you can't invoke it 100000 times in a for loop. Also, you can't use it to convert large string.
Tim Smith
I know what you're thinking punk, you're thinking did he spell check this document? Well, to tell you the truth I kinda forgot myself in all this excitement. But being this here's CodeProject, the most powerful forums in the world and would blow your head clean off, you've got to ask yourself one question, Do I feel lucky? Well do ya punk?
|
|
|
|
|
A2CW uses stack space. So you can't invoke it 100000 times in a for loop.
Yep, that's a pity. Things would be easier if space allocated by _alloca would follow normal scope rules for stack-based objects (that is, if automatic freeing happened on block exit). In connection with this, C99 allows for variably sized stack arrays:
void f(const char *str)
{
char array[strlen(str)+1];
...
} I think this feature is being considered for inclusion in the next C++ release, which could be a boon to implementations of superfast containers (like std::vector s without the heap allocation overhead). While this day comes, I think the effect could be reproduced in VC++ with a little assembly and some wrapper class:
class variable_array
{
public:
variable_array(variable_array& r):p(r.p),n(r.n)
{
r.p=0;
}
~variable_array()
{
if(p){
}
}
void *p;
size_t n;
private:
variable_array(void* p,size_t n):p(p),n(n){}
friend variable_array make_variable_array(size_t n);
}
variable_array make_variable_array(size_t n)
{
return variable_array(stack pointer,n);
}
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|