|
What have you done so far and what did it give you?
|
|
|
|
|
i got it to output stars but only in the top half of the triangle. Cause i couldnt get it to output the numbers
|
|
|
|
|
I've written a program that interfaces to a web page (basically a POST followed by reading the response).
I would have thought that if the web page sends a cookie, and then requests it back later, this would all be handled automatically. But it doesn't seem to work.
Can someone point me in the direction of some code that might do what I want?
Neil
|
|
|
|
|
Is MSDN article Q168864 of any help?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
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;
}
|
|
|
|