Christian Graus wrote: Nope, that's rubbish. That scopes all of namespace std unnecessarily, if std::string is all that is wanted. Sorry, I didn't know that there was something like "using Declaration". MSDN: "The using declaration introduces a name into the declarative region in which the using declaration appears." :-O Christian Graus wrote: That is, by definition, a macro, just a parameterless one. Tell that the people who claim they are called "symbolic identifiers". :rolleyes:
DaFrawg
Posts
-
How do I... -
C++ HelpI'm not making his homework. I just give him a sample skeleton, not the solution. Sure I know a way to find out if it is a prime or not, I've done that before. But if you can't think of one by yourself, you just have to take math classes.
-
Writing Ogg Vorbis CommentsTake a look at XIPH - Vorbis Ogg Documentation[^]. Always ask Google first.
-
How do I...I guess it's better to replace
using std::string;
byusing namespace std;
or else the class 'string' will not be available (it's 'std::string', not 'std::string::string'). LPCTSTR is not really a macro:#define LPCTSTR const char*
(or something like that, I probably forgot the As and Ws for ANSI and Unicode) -
C++ Help#include <iostream>
bool IsPrime (unsigned int); // I don't know how you are going to check that, there are several ways to do that.
int main(int argc, char* argv[])
{
unsigned int max;
cout << "Give an integer number: "; cout.flush;
cin >> max;
cout << endl;for (unsigned int n = 1; n <= max; n++) if (IsPrime(n)) { cout << n << ", "; cout.flush; } cout << endl; return 0;
}
-
Algorithm for generating Alphanumeric characters:wtf: That doesn't make sense... Give an example of what you want. Do you want a random alphanumeric character? Or does this have to do with Keyboard Input?
-
about floating keyboardTake a look at MSDN - Keyboard Input[^]. There you can find messages you can pass to the window that must think that someone pressed that specific key on the keyboard. You can send WM_KEYDOWN or WM_SYSKEYDOWN when the button is pressed, and WM_KEYUP or WM_SYSKEYUP when the button is released. For instance, you could do
void MyDialog::OnButton49()
{
GetParent()->SendMessage(WM_CAPTURECHANGED,49,1);
GetParent()->SendMessage(WM_KEYDOWN, VK_A, NULL);
GetParent()->SendMessage(WM_KEYUP, VK_A, NULL);
}I'm not sure about those VK_A (I'm at school now and I don't know the Virtual Key list by heart). You can also replace those NULLs by control codes that indicate if CTRL or AltGrp is pressed in addition. By the way, don't include too much commented lines. It looks nasty and it makes it unreadable. There is also a way to use one single function for all buttons (with a custom WindowProc), so that you don't have to make a function for each button on your virtual keyboard.
-
DDKThat would cost you about $200. I don't think the DDK itself is downloadable without a MSDN subscription. The DDK reference however is available for everyone, like the content of the MSDN CDs. I was also looking for the DDK to make a device driver for a virtual webcam, but I don't have any tools either to make device drivers.
-
Gain SuperCapture of the mouse?I'm writing a program which needs to get the mouse capture in order to be able to select a part of the screen. I've tried this using GetCapture, but that doesn't work, because at the moment I start dragging at a point that is not in the my app's window, the capture is lost and the window at that point is activated. Is there some way to prevent this loss of capture AND focus?
-
Can't have a child window in the non-client area painting itselfIf I create a window in another window in the non-client area then send the WM_PAINT message to the child window if the parent receives a WM_NCPAINT message, the client window doesn't redraw (the non-client area it is on is still garbled with the old pixels that were in those rect). How can I solve this?
-
Indentation+word wrapping in Edit windowsDoes someone know how I can indent the second part of a line in an edit control if it is wrapped?
-
How do I refuse to resize if a window is getting too big/small?I guess the title says it all: If I have a resizable window, how can I make it refuse to resize (that is, the cursor can move but it doesn't change the window size) if a window woulde become too small? I know how to detect the last thing, but not how to stop resizing.
-
Sharing violation error when loading a DLLAnother perfect example of my stupid moves: First I load the DLL with the CFile object, and then with LoadLibraryEx. What did I do wrong? I forgot to tell CFile to CFile::shareDenyNone. Tnx.
-
CListCtrl and CImageList questionGot it. Allways use all frigging flags. This time, I had to use the flag IL_MASK (or something).
-
autorunIf you search @ msdn.microsoft.com for "autorun usb", you'll see that it is possible to associate apps to removable drives for autorun if you're using Autoplay V2 (embedded in WinXP). I guess (!) that PenDrive Autorun associate itself with removable USB drives and if an USB drive is added to the system and XP is polling what application likes to autorun, PenDrive Autorun says 'yes' if autorun.inf is found. So WinXP gives the control to PenDrive Autorun and PenDrive Autorun executes the file specified in autorun.inf. But that is only a guess. If it's true, than it's not possible to trigger an autorun from the USB, so only if PenDrive Autorun (or something like it) is installed on the computer, the trick will work.
-
CListCtrl and CImageList questionIf I fill an imagelist with partially transparent icons and bitmaps, set it as imagelist for the listctrl and create items with those icons, the transparent parts of the images will turn black. Why? Thanks in advance.
-
problem about tray icon- Did you also add a 16x16 version of the icon to the icon group? 2) Uhm... wasn't there a parameter in the OnMouseWheel function that tells you how many notches were scrolled? Multiply it with the UINT nLinesPerScroll after you called
SystemParameterInfo(SPI_GETWHEELSCROLLLINES, NULL, (LPVOID(&nLinesPerScroll)), NULL);
Wlx P.S. If the SystemParameterInfo doesn't work, I probably casted the third parameter the wrong way.
- Did you also add a 16x16 version of the icon to the icon group? 2) Uhm... wasn't there a parameter in the OnMouseWheel function that tells you how many notches were scrolled? Multiply it with the UINT nLinesPerScroll after you called
-
Sharing violation error when loading a DLLWhen I try to load any DLL with LoadLibraryEx, it gives a NULL-handle and the last error (GetLastError) is ERROR_SHARING_VOILATION. I'm using LoadLibraryEx, because I want to load a DLL that I found using CFileFind (or however it's called). Does someone know how to solve that? Even looping (+::Sleep(50)) until the last error is not ERROR_SHARING_VIOLATION won't help (it will hang the application).
-
Mouse direction settings?I don't know if this is only ofr Logitech, but I want to GET/SET the mouse direction settings, which can be calibrated using Windows's Mouse Config Panel (well, if you have WinXP, I guess you need Logitech's MouseWare). Is that possible?
-
Mouse direction settings?I was wondering how to GET/SET the mouse direction settings... There is a tab in Windows's Config Panel > Mouse where you can click on a red-white balloon. If you do, you'll have to move the mouse upwards. This option is for calibration. But where are these parameters stored and how to edit them?