|
Brisingr Aerowing wrote: static MOZ_CONSTEXPR_VAR Register CallTempNonArgRegs[] = { edi, eax, ebx, ecx, esi, edx }; What about:
static MOZ_CONSTEXPR_VAR Register CallTempNonArgRegs[6] = { edi, eax, ebx, ecx, esi, edx };
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|
Same error. I even tried larger numbers with the same result.
What do you get when you cross a joke with a rhetorical question?
The metaphorical solid rear-end expulsions have impacted the metaphorical motorized bladed rotating air movement mechanism.
Do questions with multiple question marks annoy you???
|
|
|
|
|
|
I found this bug report[^], and it turns out that this is a VS2015u1 compiler bug.
What do you get when you cross a joke with a rhetorical question?
The metaphorical solid rear-end expulsions have impacted the metaphorical motorized bladed rotating air movement mechanism.
Do questions with multiple question marks annoy you???
|
|
|
|
|
Just ran into something I thought was odd today, if you had the following
namespace A
{
enum Things
{
Apple,
Orange,
HamSandwich,
RocketPoweredElephant
};
void Function(Things thing)
{
}
}
namespace B
{
void Function(A::Things thing)
{
}
void Ambiguous()
{
Function(A::Orange); }
}
void main()
{
Function(A::Orange); }
Because one of the parameters is type contained within namespace A, A::Function is being brought into scope, causing an error for the function Ambiguous .
Is this part of the spec or is it some compiler (VS2012) jiggery pokery?
|
|
|
|
|
I assume it's part of the spec, based on the following error messages:
AConsole.cpp
1>c:\users\richard\documents\visual studio 2010\projects.c++\aconsole\aconsole\aconsole.cpp(98): error C2668: 'B::Function' : ambiguous call to overloaded function
1> c:\users\richard\documents\visual studio 2010\projects.c++\aconsole\aconsole\aconsole.cpp(91): could be 'void B::Function(A::Things)'
1> c:\users\richard\documents\visual studio 2010\projects.c++\aconsole\aconsole\aconsole.cpp(83): or 'void A::Function(A::Things)' [found using argument-dependent lookup]
1> while trying to match the argument list '(A::Things)'
|
|
|
|
|
It's Argument Dependent Lookup (ADL) also known as Koenig lookup. It's invaluable when you're trying to define operations on a type in a namespace using functions in that namespace. Say you have:
namespace N
{
class A
{};
friend A operator+( const A &, const A& );
}
A a, b;
auto c = a + b;
if the compiler didn't know to look for the operator in the namespace A was declared in you wouldn't be able to use operator functions in namespaces that easily. It would be a particular headache for <, << and >> which are required by chunks of the standard library.
|
|
|
|
|
Super. I've probably got operator functions around that work because of this, I've just never noticed or thought about it before.
|
|
|
|
|
Hi, I have two processes running on a system. One process is of socket based connection type and another process is of a serial based connection type. Here the requirement is the information provided by one process should be sent across to another process based on which it will perform some action.
Could anyone please let me know a suitable solution for this in vc++ and if any example project for the same. Thanks in advance.
|
|
|
|
|
Examples of IPC include:
Sockets
Clipboard
COM
Pipes
Data Copy
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|
I've had to do this many times, and have found the easiest way is to use (global) named pipes. The process that does the word opens the pipe server, and just waits for a message to come through. Any processes that need an action to be preformed then open a client pipe, and sends all the data through. This system even allows for duplex messaging, so the server can send a response and/or the results of the processing back to the caller if required.
The Microsoft Devcenter explains it all pretty well, with examples, here[^].
|
|
|
|
|
Hi
I have been getting an internal compiler for a "for(;;) statement I simplified it as much as possible till it looks like this
for (; i >= 0; i--, j--)
and I still get the error the code compiles in debug mode
thanks
|
|
|
|
|
Please show a few lines of code either side, plus the exact code that produces the error, and the exact and complete message.
|
|
|
|
|
Jochen was right on qeue I put a pragma for optimize off
Around the code and it was able to build
|
|
|
|
|
When it compiles in debug builds, the compiler gets stuck during optimisation.
See also the MSDN Fatal Error C1001[^]. It suggests to disable optimisation for the function or rewrite the code.
With older VS versions I had such errors a few times and solved them always by re-ordering some code lines. As you already noticed, reducing (simplifying) the code may not help. Instead it might help to add code lines.
|
|
|
|
|
Thanks so much that did it I put pragma for optimize off
|
|
|
|
|
TCHAR userName[100];//user input buffer
hwndedit=GetDlgItem(hwnd,IDC_UNICALPTUME_SUBJECT_TBOX);//gets edit control's handle
userName[100]=(TCHAR) SendMessage(hwndedit,WM_GETTEXT,(WPARAM)sizeof(userName)/sizeof(userName[0]),(LPARAM)userName);//Sent message
return (INT_PTR)TRUE;
case IDOK://checks if buffer is empty or not when the user clicks OK on the dialog
if(userName!=NULL)
EndDialog(hwnd,TRUE);
return (INT_PTR)TRUE;
l also tried GetWindowText(hwnd,userName,sizeof(userName)/sizeof(userName[0]))
still it doesn't work. Please can someone me guide me on getting user input and checking if the buffer is empty or not.
Thanks everyone.
modified 18-Jan-16 17:11pm.
|
|
|
|
|
userName[100]=(TCHAR) SendMessage(hwndedit,WM_GETTEXT,(WPARAM)sizeof(userName)/sizeof(userName[0]),(LPARAM)userName);
You are casting your return value to a single character and storing it in one character position beyond the end of your buffer. You should just use GetWindowText like this:
int nSize = GetWindowText(hwndedit, userName, _countof(userName));
See GetWindowText function (Windows)[^] and _countof Macro[^].
|
|
|
|
|
|
The default context menu (in explorer and open file dialogs) looks like the image below:
The selected menu item has a dark gray background, and I don't like it. It can't be replaced by the theme.
I want to restore its style to Windows 8/8.1 style, like this(Windows 10 earlier insider builds):
I have programmed a COM dll and attach it to the explorer, it's able to retrieve the handle of the context menu, but I discovered that none of those menu items have the "MF_OWNERDRAWN" flag, they just have "MF_STRING" flag.
So things start to getting wired, perhaps they are not normal owner drawn menus?
My question is how does the explorer render its context menu? And are there anyway to customize its style? eg using hook?
|
|
|
|
|
I've been recently asked in an interview to write down a function that takes a char and returns void, and using this char the function would call between 5 different functions,
Beside I have to write this function in three different ways.
I figured out two, but failed to come with the third.
My two functions were : 1- using switch on the coming argument
2 - using if else statements
,, can some 1 deduce the third , this is bugging me.
|
|
|
|
|
Here's an idea:
Use the char as an array index for an array of function pointers.
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
alright I like this one 
|
|
|
|
|
Hi,
I need to check from a dll that If a particular driver is already installed or not. Also i need to un-install it.
I have INF file of the driver.
Please let me know how can i do this using C/C++.
Thanks
Prasanth
|
|
|
|
|