|
Not really. It covers ISAPI, and I'm writing a client (in MFC).
WHenever I read from the server I only get the data, not the headers. I presume there is a way to also get the headers and I can do cookie management myself, but I would have thought it would be automatic (or at least optionally automatic).
|
|
|
|
|
I have the following code using GDI+. There is a weird error when I compiled it.
#include <gdiplus.h>
using namespace Gdiplus;
...
Bitmap* b = new Bitmap(100,200);
...
The compiler says:
...\TClientSimpleView.cpp(151) : error 2660: 'Gdiplus::GdiplusBase::operator new' : function does not take 3 arguments.
Do anyone know what happens? Is it a bug in GDI+?
Thanks.
Lei
|
|
|
|
|
It is the difference between new and DEBUG_NEW . A workaround is to always use the global ::new operator for GDI+ objects.
Bitmap* b = ::new Bitmap(100,200);
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04
Within you lies the power for good - Use it! Honoured as one of The Most Helpful Members of 2004
|
|
|
|
|
I am trying to figure out how to transfer text from one form to another using a textbox. I am using Visual Studio .Net. I am also using Windows Forms in Visual C++.
Bobby
|
|
|
|
|
Are you using WinForms here - in which case you're actually using Managed C++, or the old dialog editor - in whch case you're using Visual C++. The approach is very different!
In WinForms if you have a TextBox object, you can get and set it's text with the text property. E.g:
textBox.Text = "Hello";
textBox2.Text = textBox.Text;
In Visual C++ if you're using MFC, then you can write something like this:
CString string;
GetDlgItem(ID_EDIT1)->GetWindowText(string);
GetDlgItem(ID_EDIT2)->SetWindowText(string); Hope that helps you.
Joel Holdsworth
Wanna give me a job this summer?
Check out my online CV and project history[^]
|
|
|
|
|
|
The gdiplus.h file is included with the Platform SDK. Download it from Microsoft's site. I am not familar with the graphics.h file. It sounds like it might have been shipped with the Turbo C or Borland C compiler.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
graphics.h file. It sounds like it might have been shipped with the Turbo C or Borland C compiler.
Exactly. You may still be able to download a free version of Borland's c++ compiler here www.borland.com[^]
The file should be with the free compiler.
John
|
|
|
|
|
|
Hello,
I have a listbox in my dialog. I added a handler for the CBN_SELCHANGE notification. I need to do some processing on the previous selected item, but I cannot find a way to retreive the index of the previous selected item..
Do I need to implement this feature myself or did I overlook something?
I also got the blogging virus..[^]
|
|
|
|
|
Any currently selected item will become the previously selected item once a new selection is made. Say that five times fast!
Any time a selection is made in the listbox, simply make a note of it for future reference. Make sense?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Bob Stanneveld wrote:
Do I need to implement this feature myself or did I overlook something?
I say here that I understand your answer, but your answer says that you didn't understand my question. Let me restate my question for you: is there already a function call, message, notification or whatever that retreives the previous selected item for me or do I have to add this little simple feature myself?
Ofcouse I can implement this simple thing, but it would make my code more clean and elagent if I was using an existing feature (if there is one) than reinveting the wheel...
I also got the blogging virus..[^]
|
|
|
|
|
Bob Stanneveld wrote:
is there already a function call, message, notification or whatever that retreives the previous selected item for me or do I have to add this little simple feature myself?
Yes and yes.
Bob Stanneveld wrote:
Ofcouse I can implement this simple thing, but it would make my code more clean and elagent if I was using an existing feature (if there is one) than reinveting the wheel...
It's a simple matter of handling the LBN_SELCHANGE notification.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
DavidCrow wrote:
It's a simple matter of handling the LBN_SELCHANGE notification.
If it was that simple, why do I get the index of the newly selected item instead of the item that is deselected (the previous selection)?
My current solutions is as follows: I keep 2 variables: the first (nPrevSel) is the previous selection (or -1 if there is none) and the second (nCurSel) for the current selection. In the OnSelChange() handler, I set nPrevSel to nCurSel and nCurSel becomes equal to CListBox::GetCurSel() .
I do not find this and elegent solution, but I don't think that there is a solution like as elegant as CListBox::GetCurSel() .
I also got the blogging virus..[^]
|
|
|
|
|
Bob Stanneveld wrote:
My current solutions is as follows: I keep 2 variables: the first (nPrevSel) is the previous selection (or -1 if there is none) and the second (nCurSel) for the current selection. In the OnSelChange() handler, I set nPrevSel to nCurSel and nCurSel becomes equal to CListBox::GetCurSel().
This is exactly how it is done. I don't find it inelegant at all.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Bob Stanneveld wrote:
I have a listbox in my dialog. I added a handler for the CBN_SELCHANGE notification
Did you mean LBN_SELCHANGE ?
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
Hello,
I have a listbox control and I was catching the CBN_SELCHANGE notification (which actually worked ). No I catch the LBN_SELCHANGE, which also workes. This lets me believe that they are the same..
Now I'm using that notification.
I also got the blogging virus..[^]
|
|
|
|
|
I have used Visual Studio 6 for a long time and I like the multiple, non maximized windows. For one thing I can put one window next to another and compare them. Also I can use a dual monitor system and have different windows on different monitors.
Visual Studio 7.0 has nice Property pages etc, which fold away into the edge of the screen, but I can see only one window of source code which is maximized to fill all the rest of the space.
What I would REALLY like is the best of both worlds, with Property pages which fold away AND multiple source windows which don't fill the whole area.
If I can't get my wish list, I'd settle for the vs6.0 look, where I can at least see multiple windows.
Any suggestions?
Thanks,
Ilan
|
|
|
|
|
|
This one is really driving me nuts! I am creating a dialog using the following code:
<br />
if (!::IsWindow(pPS->pDlg->m_hWnd)){<br />
pPS->pDlg->Create(IDD_CFG_DLG, this); <br />
}<br />
HWND hwndParent = ::GetParent(pPS->pDlg->m_hWnd); <br />
The creation happens after the OnInitDialog() of the main application window (a dialog) and everything seems to return success except for the GetParent() call which I am expecting to return my main dialog's m_hWnd. The IDD_CFG_DLG does have the "CHILD" style set and no border if that matters (I don't think it does).
I have also tried forcing the parent by calling SetParent() but even though it returns no error, the result is the same - the parent of the created dialog is still NULL!
What am I doing wrong here?
Thanks,
Dave
|
|
|
|
|
Hi all !
I would like to protect a standard C struct with a CRC in order to check if the structure contains valid information.
A wrote a small demo program with a standard C structure as member. If I read any element of the structure the checksum should be checked for correctness. If I write any element of the structure the checksum has to be recalculated. I would like to do that by overloading the -> operator.
In the demo program the call of the -> operator function works fine. However I have the problem to check if there is a Read- or Writeaccess. How can I check if an expression like
x->deviceData.HW_Version is used within a write or a read context ?
sincerly
Manfred
#include "stdafx.h"
#include <stdio.h>
// --- standard C structure ------------------------------
typedef
struct
{
int SW_Version ;
int HW_Version ;
unsigned long SerialNumber ;
} DeviceData ;
// --- class with CRC functionality ------------------------
class CCrc
{
public:
unsigned short crc ;
} ;
class CrcClass : public CCrc
{
public:
DeviceData deviceData ;
void CheckCrc() ;
CrcClass * operator->() ;
};
CrcClass * CrcClass::operator->()
{
CheckCrc() ;
return this;
};
void CrcClass::CheckCrc()
{
if( 1 ) // throw Exception for test
{
throw "Invalid Checksum !!!!\r\n" ;
}
};
int main(int argc, char * argv[])
{
CrcClass x ;
try
{
x->deviceData.HW_Version = 111 ;
x->deviceData.SW_Version = 222 ;
x->deviceData.SerialNumber = 333 ;
printf("%d", x->deviceData.HW_Version );
printf("%d", x->deviceData.SW_Version );
printf("%d", x->deviceData.SerialNumber );
}
catch( char * exMessage )
{
printf("%s", exMessage ) ;
}
return 0;
}
|
|
|
|
|
You should really use Get/Set methods and put your member variables as private.
In each Getter and Setter you can check the CRC.
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
Honnestly I found that overriding the -> in this case is not really appropriate. It breaks the 'natural law' for objects and pointers. Here, you have an object (that is not a pointer !) and you will access it's member variable as if it was a pointer ! So that's really strange...
This operator is sometimes overriden in some very specific cases like for example when it must be 'seen' as a pointer (a class that wraps a pointer for example). The best example is the 'smart pointers'. It's a class that wraps a pointer and handle all the memory management for this pointer (ok, I won't describe the functionality of the smart pointers...). So there is here a purpose for overloading this operator: give the class the same 'feel' as it was a real pointer !
In your case, it has nothing to do with pointers at all so your code look like you access your member variable as if the object was a pointer...
Otherwise, I don't see why you want to use so complicated things: why don't you just write a function that will check this ?? And there is no way to know if the operator is read for reading or writing as far as I know (I might be wrong...).
|
|
|
|
|
i want to make program for start service or stop services from source code
|
|
|
|
|