|
Thanks for the reply, but linking to a 176 page document is not helpful in answering my simple question. Also, if you would look at the syntax I used I do understand the name=value pairs quite well. If you look at the reply I posted to my own post, I added the correct HTTP/1.0 header and now receive a response, but not a good one. Also, using GET instead of post does not seem to make a difference.
Thanks,
Dustin
|
|
|
|
|
Dustin Henry wrote: I'm trying to duplicate the data in the following URL:
http://www.thewebsite.com/sub/database?action=authenticate&username=test&password=test
This would be a GET request not a POST, translated into HTTP 1.1:
GET /sub/database?action=authenticate&username=test&password=test HTTP/1.1\r\n
Host: www.thewebsite.com\r\n\r\n
Does this help?
/M
|
|
|
|
|
Thank you, this helps a lot. Along with the GET, adding the correct formatting you've shown at the end of my request makes it work.
Thanks for the help
Dustin
|
|
|
|
|
Hello, I getting worried over this input validation as follows:
int age(0);
while (true)
{
cout << "\nEnter your age: ";
cin >> age;
if (cin.fail())
{
cin.clear();
cout << "Please enter a digit (number) only.\n";
continue;
}
cin.get();
break;
}
I don't get any problems when I enter a digit. In a way to validate input, I intentionally entered a letter. The test for cin.fail() is executed and the loop starts again. But when the loop restarts and gets to cin >> age, it does not wait for me to enter anything. It continues as if something has been entered, then the cin.fail() condition statements are executed again and again... I would like to know what I should do so that when the loop restarts and gets to where the application expects input, it waits for user input rather than continuing. Thanks.
|
|
|
|
|
|
You need to remove any guff that's currently gumming up the stream. Have a look here[^] for a canned solution.
The bit you're missing is at the end of the second if in the while loop.
Cheers,
Ash
|
|
|
|
|
hi,
i would like to write a control that works the same as the IE8 address bar with the auto complete option , and implement the delete that appear on each address.
in .NET i have the option of auto complete - is it also in MFC?
and regarding the delete i have no idea how to start....
thanks!!
|
|
|
|
|
should it be list box or combo box?
|
|
|
|
|
Hi I want to write a device driver and I need to include ntddk.h, ndis.h, ipFirewall.h and windows.h too (for calling some APIs for example MessageBox). When I compile the source file I get some errors like redefinition structures or constant values. Why?
And tel me how I can use APIs like GetDriveType, MessageBeep, etc in drivers.
Look at these:
1>d:\winddk\7600.16385.1\inc\api\ntdef.h(1418) : error C2027: use of undefined t
ype 'LIST_ENTRY64'
1>d:\winddk\7600.16385.1\inc\api\ntdef.h(1418) : error C2227: left of '->Blink'
must point to class/struct/union/generic type
1>d:\winddk\7600.16385.1\inc\ddk\mce.h(137) : error C2079: '_MCA_EXCEPTION::Time
Stamp' uses undefined union '_LARGE_INTEGER'
1>d:\winddk\7600.16385.1\inc\ddk\wdm.h(408) : error C2011: '_M128A' : 'struct' t
ype redefinition
1>d:\winddk\7600.16385.1\inc\ddk\wdm.h(417) : error C2011: '_XSAVE_FORMAT' : 'st
ruct' type redefinition
1>d:\winddk\7600.16385.1\inc\ddk\wdm.h(456) : error C2011: '_XSAVE_AREA_HEADER'
: 'struct' type redefinition
Thanks a lot
|
|
|
|
|
Reza Mirabdolhagh wrote: how I can use APIs like GetDriveType, MessageBeep, etc in drivers
short answer - you can't. It's a driver - it executes in kernel mode not user mode hence no user-mode APIs
Judy
Be wary of strong drink. It can make you shoot at tax collectors - and miss.
Lazarus Long, "Time Enough For Love" by Robert A. Heinlein
|
|
|
|
|
I've created a derived class of CMFCRibbonCombobox. How to set the RibbonComboBox to Drop List type by code? the default type is Dropdown.
Thanks!
|
|
|
|
|
Just set the second parameter to FALSE in its constructor
virtual void BeHappy() = 0;
|
|
|
|
|
I've tried this way. the second parameter is meaning of hasEditBox? not the droplist type.I followed the code and founded that there is a member(m_bDropDownListMode) in the CMFCPopupMenuBar class, and its default value is FALSE.How can I use it? when we use the toolbox in VS2010, we can modify the property to droplist type directly, How can I do it by code?
|
|
|
|
|
// not the droplist type.
Why not ?.. It would be a combobox with a choice list only...
What do you desire exactly for, please ?
virtual void BeHappy() = 0;
|
|
|
|
|
In CMFCToolBarMenuButton::OnCalculateSize Funcation:
...
if (pParentMenu->IsDropDownListMode())
{
CMFCDropDownListBox* pList = DYNAMIC_DOWNCAST(CMFCDropDownListBox, pParentMenu->GetParent());
if (pList != NULL)
{
return pList->OnGetItemSize(pDC, this, size);
}
}
...
so I desire to set RibbonCombobox dowmlistmode to respand the OnGetItemSize message, to execute the overload fun (OnGetDropListItemSize) which adjust the dropdownlist's width.
|
|
|
|
|
Try it :
class CMenuBarProxy : public CMFCPopupMenuBar
{
public:
void SetDropDown(BOOL bOnOff) { m_bDropDownListMode = bOnOff; };
};
void CYourComboBox::Redraw()
{
CMFCDropDownListBox* pcList = DYNAMIC_DOWNCAST(CMFCDropDownListBox, m_pPopupMenu);
if (pcList) {
CMenuBarProxy* pcBar = (CMenuBarProxy*) pcList->GetMenuBar();
if (pcBar && !pcBar->IsDropDownListMode()) {
pcBar->SetDropDown(TRUE);
}
}
CMFCRibbonComboBox::Redraw();
}
virtual void BeHappy() = 0;
|
|
|
|
|
make it! your code works well.. thanks!
|
|
|
|
|
Hi,
I have an application built on VS2005 which uses a static library built using VS6.0.
I have noticed an issue of incorrect function getting called from a static library linked at compiled time. Note that this static library was built using Visual Studio 6.0. Whereas my application which is using the static library for linking at compile time is built using VS2005.
At run time, I see that incorrect/different functions are getting called rather than the ones which are supposed to get called.
To solve this issue:
I rebuilt the static library (.lib) using VS2005. Then this newly built static library was used for compilation along with my application on VS2005. Then the functions are getting called correctly.
I have 2 questions here:
1) This means that if there is any static library built with older version of VS6.0, then it will not work correctly with an application built with VS2005. We need to rebuild it with the same compiler as the application is built with. Is this true? why this happens in case of static libraries?
2) If above point-1 is true, then isn't it necessary to rebuild DDLs also with VS2005? If no, then why it is ok that a DLL built with older version of compiler works fine with application built with newer compiler version?
|
|
|
|
|
Many things have undergone changes from older versions of the compiler.
It is not a matter of a static library or dynamic library.
If you're using any of the components that have undergone a change it would become incompatible.
For example, in ATL there have been many changes from ATL version 3.0 to 7.0.
Many classes have been split up into many different classes.
In MFC, the CString class has been changed to a template class.
These are a few changes that can make older libraries incompatible with newer compilers.
So when ever code for the library is available it is always better to compile them with the latest compilers.
You will also be able to catch many unknown bugs this way since newer compilers do much better than older ones.
|
|
|
|
|
funwithdolphin wrote: We need to rebuild it with the same compiler as the application is built with. Is this true? why this happens in case of static libraries?
yes. static libraries are almost never compatible between different versions of MS compilers. things like STL and MFC change between versions, interfaces break, members move around, etc..
funwithdolphin wrote: If above point-1 is true, then isn't it necessary to rebuild DDLs also with VS2005?
that depends on what kinds of things your DLL uses in its exported interfaces.
|
|
|
|
|
As a really crass generalisation:
- if your library or DLL has a C interface and your programming language can use libraries or DLLs with a C interface then you can probably get away with mixing compiler versions. This is especially true for DLLs that you load manually.
- If your library or DLL are written in C++ make sure you compile your application with the same version of the compiler. Name mangling, object layout and loads of other things change from compiler version to compiler version. As well make sure you compile with as many identical compiler switches to avoid anything a bit weird sneaking in knackering your build.
So this means that I can use a VC 6 C library from a VC2010 C++ application (I had to generate a new import library from the DEF file) but there's no way I could use static libraries from even VC++2008.
Cheers,
Ash
|
|
|
|
|
Aescleal wrote: Name mangling, object layout
For DLLs, both have remained remarkably consistent since VC++ 6.0. (Had to use VC++ 6.0, VS 2005 and VS 2008 simultaneously for a while for legacy reasons.)
|
|
|
|
|
we build our imaging libraries for
VC6
VS03
VS05
VS08
VS10
debug and release for each. which would be 10 .LIBs, but...
static and dynamic CRT for each. which makes 20 .LIBs, also...
x64 for 05,08,10. which adds another 12 libs.
so 32 static libs. plus two DLLs.
for each product, each release.
|
|
|
|
|
I can't say I share your experience - as soon as you have DLLs that return something like an auto_ptr or even pass something as innocuous as std::string you find that the various runtime libraries you link with start interfering with each other.
|
|
|
|
|
With STL, yes, because it's changed without worrying about backward compatibility. I merely pointed out that name mangling and object layout has changed very little. To their credit, Microsoft made a real effort to keep name mangling the same from at least VC++ 6.0 to present day--there are some differences, but relatively few, and the object layout hasn't changed. Even the memory manager figures out how to cope with a VS 2008 application running a DLL compiled with VC++ 6.0 and running the CRT DLL.
STL, on the other hand, radically changed from VC++ 6.0 to VS 2005. If you had a third party STL that was entirely under your control, however, you'd be able to get away with it with only a few exceptions (assuming you followed the rules, such as ensuring virtual tables are in the DLL and you keep the optimize flags the same.)
And, when you get to static linking, all bets are off.
|
|
|
|