 |
|
 |
Apologies for the shouting but this is important.
When answering a question please:
- Read the question carefully
- Understand that English isn't everyone's first language so be lenient of bad spelling and grammar
- If a question is poorly phrased then either ask for clarification, ignore it, or mark it down. Insults are not welcome
- If the question is inappropriate then click the 'vote to remove message' button
Insults, slap-downs and sarcasm aren't welcome. Let's work to help developers, not make them feel stupid.
cheers,
Chris Maunder
The Code Project Co-founder
Microsoft C++ MVP
|
|
|
|
 |
|
 |
For those new to message boards please try to follow a few simple rules when posting your question.- Choose the correct forum for your message. Posting a VB.NET question in the C++ forum will end in tears.
- Be specific! Don't ask "can someone send me the code to create an application that does 'X'. Pinpoint exactly what it is you need help with.
- Keep the subject line brief, but descriptive. eg "File Serialization problem"
- Keep the question as brief as possible. If you have to include code, include the smallest snippet of code you can.
- Be careful when including code that you haven't made a typo. Typing mistakes can become the focal point instead of the actual question you asked.
- Do not remove or empty a message if others have replied. Keep the thread intact and available for others to search and read. If your problem was answered then edit your message and add "[Solved]" to the subject line of the original post, and cast an approval vote to the one or several answers that really helped you.
- If you are posting source code with your question, place it inside <pre></pre> tags. We advise you also check the "Encode HTML tags when pasting" checkbox before pasting anything inside the PRE block, and make sure "Ignore HTML tags in this message" check box is unchecked.
- Be courteous and DON'T SHOUT. Everyone here helps because they enjoy helping others, not because it's their job.
- Please do not post links to your question in one forum from another, unrelated forum (such as the lounge). It will be deleted.
- Do not be abusive, offensive, inappropriate or harass anyone on the boards. Doing so will get you kicked off and banned. Play nice.
- If you have a school or university assignment, assume that your teacher or lecturer is also reading these forums.
- No advertising or soliciting.
- We reserve the right to move your posts to a more appropriate forum or to delete anything deemed inappropriate or illegal.
cheers,
Chris Maunder
The Code Project Co-founder
Microsoft C++ MVP
|
|
|
|
 |
|
 |
Hi coders,
IIT Roorkee is presenting an Algorithm Intensive Online Programming
Contest – INSOMNIA, during their annual Tech Fest COGNIZANCE '12.
INSOMNIA is known around the globe and some of the best coders
participate in this reputed competition. The event has a total prize
money of INR 50,000/-
INSOMNIA will be held for 12 hours from 9:00 PM IST (+5:30 GMT), 11th
February to 9:00 AM IST, 12th February 2012. There could be maximum 2
members in a team. Team member may be of different colleges /
professions.
To participate in the contest, first visit
(http://www.cognizance.org.in/) and register each team member
indivisually on it. Then register your team at INSOMNIA website
(http://www.insomnia.cognizance.org.in/). The contest will also be
held on the same site.
Looking forward to your participation.
Coordinators:
Aditya Gupta (adityagupta104@gmail.com) – (+91-7417015693)
Deshank Baranwal (deshank@gmail.com ) - ( +91-9557020929)
Dipit Grover – (+91-9557647167)
Kapil Agrawal – (+91-9568380650)
Important Note: For further queries refer to ‘Rules’ on the site or
email to any of the coordinator or write to Email ID-
insomnia.cogni@gmail.com.
|
|
|
|
 |
|
 |
Hello, I'm wondering how would you programmatically install your program in the Windows Action Center on the antivirus section, to where it says "COMODO antivirus is currently running and up to date." How would you do it to make your own program (e.g., "Windows Application-1 is currently running and up to date.")
Regards,
Brandon T. H.
|
|
|
|
 |
|
 |
I just want to get a check to see if my translation of the Mod Operator in VB to c++ is even close to right, or if there is a c++ equivalent to Mod, where I can just use Mod or something close to it.
edit:
I'm not sure if the null terminate char will produce a different result in the c++.
So I have these lines of code to translate.
strTextChar = Mid(strDomainName, (i Mod Len(strDomainName)) + 1, 1)
strKeyChar = Mid(ApplicationName, (i Mod Len(ApplicationName)) + 1, 1)
szTextChar = &szDomainName[ ( i - ( wcslen(szDomainName)) * (i / wcslen(szDomainName)) ) + 1 ];
szKeyChar = &pzApplicationName[ ( i - ( wcslen(szApplicationName)) * (i / wcslen(szApplicationName)) ) + 1 ];
I have this other line of code to translate, this one is more complex, just thought I would throw it out there. I took a peek at Xor, it's not quite sinking in yet.
strTextChar = Chr(Asc(strTextChar) Xor intTemp)
|
|
|
|
 |
|
 |
% is the modulo operator in C++ and C# and most similar languages.
Philippe Mori
|
|
|
|
 |
|
 |
Thanks Philippe!
I took off the +1 for the null terminator
szTextChar = szDomainName[ (i % wcslen(szDomainName)) ];
szKeyChar = pzApplicationName[ (i % wcslen(szDomainName)) ];
|
|
|
|
 |
|
 |
I'm missing the boat here on something. I have this constant, and I just want to count how many ampersands are in it. But I keep getting a character or type mismatch, I can't go though each character to check the value.
Overall, it's my idea of how to replace the mid function used in vb. mid(szFormat, 1,1)
const WCHAR LICENSEKEY_FORMAT [] = L"&&&&-&&&&-&&&&-&&&&";
for (int i = 0; i <= dwLength; ++i) {
if (wcsncmp(szFormat [i], L"&", 1) ==0) {
++dwCount;
}
}
The error I keep getting is
error C2664: 'wcsncmp' : cannot convert parameter 1 from 'WCHAR' to 'const wchar_t *'
If I szFormat[i] == L"&", I sort of get the same error.
Question:
Is it the const that I made is not stated correctly?, If not, what correction do I need?
|
|
|
|
 |
|
 |
try:
wcsncmp( &szFormat[i], L"&", 1 ) == 0
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
 |
|
 |
That did the trick,
Thanks Richard
|
|
|
|
 |
|
 |
Use this (note the single quotation marks):
if (szFormat [i] == L'&')
You may also have a look on the CString class which provides the Left(), Mid(), and Right() functions.
|
|
|
|
 |
|
 |
Hi everyone, I want to develop an application or whatever (driver), this will run before windows starts, and will ask for a password and if the password is correct system will continue to the windows. What can I do? Thanks.
|
|
|
|
 |
|
 |
The simplest thing would be to add a BIOS password[^].
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
 |
|
 |
I know that... But I want to write it myself.
|
|
|
|
 |
|
 |
Take a look at GINA[^], I think that is what you need to work with.
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
 |
|
 |
I want to launch a web address with ShellExecute in hidden way :
CString sLink = _T("http://www.codeproject.com/somepage/");
ShellExecute(NULL, NULL, sLink, NULL, NULL, SW_HIDE);
and goes well, but also, I want to close the launched application after execution ... how could I ?
|
|
|
|
 |
|
 |
If you want control over the spawned process, use CreateProcess()[^] instead.
"Real men drive manual transmission" - Rajesh.
|
|
|
|
 |
|
 |
Try using ShellExecuteEx() instead. It gives you back information that you can subsequently send to TerminateProcess().
"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
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|
 |
|
 |
Hello,
I have trouble with an OnSize handler.
In the OnSize Handler of a view I call a "Tab->MoveWindow(...)"
But in this Tab-Control (of kind CBCGPTabWnd) I never step into the OnSize Handler when I'm sizing the framewindow.
I tested it with breakpoints and OutputDebugStrings.
I even set a breakpoint into the WindowProc function to test if a WM_SIZE message occurs, but it never happens.
If I reproduce this strange effect on 2 computers, it works all fine on the first, but the second one has this effect.
It's the same Exe-File, both computers are using Windows 7 64bit (with Visual Studio 2010)
Does anyone knows a solution??
Thanks ahead
Best wishes, Jan
modified yesterday.
|
|
|
|
 |
|
 |
I am trying to get the resolution of all the monitors that are on connected to the system. Here is how I am trying to do
1) Read number of monitors in the system
2) For each monitor get the device info using EnumDisplayDevices().
3) In step2, I am getting all the info including DeviceName
4) Using the DeviceName from above I am calling EnumDisplaySettings(), but this function is always returning false except when I use NULL for the first parameter where it gives me details of primary monitor.
Any ideas why its returning false when using the DeviceName from step2.
thanks
PKNT
|
|
|
|
 |
|
 |
Quoting from MSDN:
Graphics mode indexes start at zero. To obtain information for all of a display device's graphics modes, make a series of calls to EnumDisplaySettings, as follows: Set iModeNum to zero for the first call, and increment iModeNum by one for each subsequent call. Continue calling the function until the return value is zero.
When you call EnumDisplaySettings with iModeNum set to zero, the operating system initializes and caches information about the display device. When you call EnumDisplaySettings with iModeNum set to a nonzero value, the function returns the information that was cached the last time the function was called with iModeNum set to zero.
Check if it helps
You talk about Being HUMAN. I have it in my name
AnsHUMAN
|
|
|
|
 |
|
 |
Thanks for the info. But I already tried this with the same result.
result = EnumDisplaySettings(lpdParams.DeviceName,0,&lpDMode);
where lpdParams is DISPLAY_DEVICE variable that has been populated with data returned from
EnumDisplayDevices(NULL, 1, &lpdParams, EDD_GET_DEVICE_INTERFACE_NAME);
Not sure where I am doing wrong.
thanks
PKNT
|
|
|
|
 |
|
 |
Do you have some sort of loop set up for this? Something like:
int result = -1;
for (int x = 0; result != 0; x++)
result = EnumDisplaySettings(lpdParams.DeviceName, x, &lpDMode);
"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
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|
 |
|
 |
I have no loops for this functions. This function is called the same way I noted earlier after EnumDisplayDevices() only once.
thanks
PKNT
|
|
|
|
 |
|
 |
Kiran Satish wrote: I have no loops for this functions.
My bad. I just assumed when _AnsHUMAN_ suggested the same thing, that your "But I already tried this..." reply meant you were using a loop of some sort.
"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
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|
 |