|
Sorry, it *is* the one in resources. Make sure
- it's the first icon in the .exe (you may need to view the .rc file as text to verify this)
- you're editing both the 16x16 icon *and* the 32x32 icon (they're stored together, Windows loads the correct one) and
- you may need to restart Explorer if it's being obstinant about caching the old icon.
---
Shog9
Actually I use to find learning in bars when drinking really useful.
It sort of makes a language liquid. - Colin Davies, Thinking in English?
|
|
|
|
|
Like Shog said it is the resource one. From what you are describing you have other icons in the project resources. Just ad another copy of your app icon and name it something like 1 so it appears at the top of the list.
- Matt Newman / Windows XP Activist
-Sonork ID: 100.11179
"You can't seriously believe that you could get away with suing someone over quoting text from a message posted in a public forum, can you?" - John Simmons
|
|
|
|
|
When I mix 2 pin-enumerations, a fatal error appears saying that 5 objects are left referenced.
But all interfaces are released properly.
Somebody who knows what's going on here?
HRESULT hr=S_OK;
.
IEnumPins* pEnumFirst=NULL;
hr=(*ppFirst)->EnumPins(&pEnumFirst);
if(FAILED(hr))
return hr;
.
IEnumPins* pEnumSecond=NULL;
hr=(*ppSecond)->EnumPins(&pEnumSecond);
if(FAILED(hr))
return hr;
.
IPin* pPinFirst=NULL;
IPin* pPinSecond=NULL;
.
while(pEnumFirst->Next(1,&pPinFirst,NULL)==S_OK && pEnumSecond->Next(1,&pPinSecond,NULL)==S_OK)
{
pPinFirst->Release();
pPinSecond->Release();
}
.
pEnumFirst->Release();
pPinFirst=NULL;
pEnumFirst=NULL;
.
pEnumSecond->Release();
pPinSecond=NULL;
pEnumSecond=NULL;
...and the pins have to do nothing yet! Afterwards, I want to connect them manualy.
[VISUAL STUDIO 6.0] [MFC] [WIN98/2]
Bluute tette!
|
|
|
|
|
never mind...
should be:
while(pEnumFirst->next ...
{
while(pEnumSecond->next ...
{
...
}
}
[VISUAL STUDIO 6.0] [MFC] [WIN98/2]
Bluute tette!
|
|
|
|
|
The Task Manager allows you to get a real-time glimpse of the number of processes that are currently running.
Question: Is there an API that allows me to do this (PerfMon?), or do I have to enumerate all the processes after a specified interval?
Thanks,
Jon
Jon Sagara
Red Swingline Staplers
|
|
|
|
|
Hi.
Visual C++ .NET outputs this error when I try to declare a priority queue with reverse sorting.
-----
// Assuming program runs and before I added the following.
#include <queue>
#include <functional>
std::priority_queue<int, std::greater<int="">> m_nQueueList;
// I try this declaration, but receive the exact same
// error everytime.
std::priority_queue<int, std::vector<int="">, std::greater<int>> m_nQueueList;
-----
Here is the error from Visual C++ .NET
-----
C2065: 'm_nQueueList' : undeclared identifier
error C2143: syntax error : missing '>' before ';'
error C2146: syntax error : missing ',' before identifier 'm_nQueueList'
error C2208: '<unknown>' : no members defined using this type
error C2947: expecting '>' to terminate template-argument-list, found '>>'
error C2976: 'std::priority_queue' : too few template arguments
-----
Does anyone know what the problem is?
Thanks,
Kuphryn
|
|
|
|
|
The first problem that you have is that the < adn > are being destroyed by the HTML parser. When you display code it is a good idea to check the "Display this message as-is (no HTML)" check box when you send your message.
The problem in your code is the >> in this:
std::priority_queue<int, std::greater<int>>
The c++ compiler does not know how to parse the >> symbol if it relates to nested templates. Change your code to this and it should fix it:
std::priority_queue<int, std::greater<int> >
Good Luck
<hr><small>Build a man a fire, and he will be warm for a day<BR>Light a man on fire, and he will be warm for the rest of his life!</small>
|
|
|
|
|
Okay. Thanks.
Added a space in between ">>" fixed it.
Here is the working solution.
-----
std:priority_queue<int, std::vector<int>, std::greater<int> > m_nQueueList;
-----
I would have never guessed the problem had to do with a missing space. That space operator is tricky.
Kuphryn
|
|
|
|
|
If I add a list box item to a form... How can I get the list control to show a list from values in an access table?
Thanks for your help!
Manuel J. Perez
|
|
|
|
|
Hmmmm. This can be a lengthy answer so let me point you toi the right direction. I am assuming you are using VC++ 6.0 and by form you mean a dialog of some kind. Even if you are using .Net my answer will not change much.
There is no direct way of populating a list box or any windows control for that matter with information in a database. There are few controls that you can get out there which will accept a recordset as an input. But thats a different story.
To populate a windows control with information in a database, you need to connect to the database, get the data, and provide it to the control. CodeProject is full of examples on how to connect to databases. You should read one of the turorials on ADO and then move on from there.
Hope this helps.
|
|
|
|
|
Below is the delcaration of C++ exception class. I cannot understand what a line like this mean:
exception() throw();
Why there are two functions there (constructor and throw)???
Thanks,
Michael
++++++++++++++++++++++++++++++++++++++++++++++++++++++
exception
class exception {
public:
exception() throw();
exception(const exception& rhs) throw();
exception& operator=(const exception& rhs) throw();
virtual ~exception() throw();
virtual const char *what() const throw();
};
|
|
|
|
|
'throw()' isn't a function. It's a 'exception specification' specifiying which exceptions function is allowed to throw. If function throws exception which is not on the list, C++ calls unexpected exception handler using function called 'unexpected'.
Empty list - 'throw()' means that function isn't allowed to throw anything.
Tomasz Sowinski -- http://www.shooltz.com
"Yields falsehood when preceded by its quotation" yields falsehood when preceded by its quotation.
|
|
|
|
|
Hello,
I am getting an error during a call to CryptAquireContext.
Here is the code:
if(!CryptAcquireContext(&hCryptProv, NULL, MS_ENHANCED_PROV, PROV_RSA_FULL, 0))<br />
{<br />
HandleError("Error during CryptAcquireContext.");<br />
return -4;<br />
}
This routine works fine on my Win2000 machine as well as another Win98 machine in the office, but our Beta users all get the same error. Is it something I am not registering/not including in the install???
If anybody has any experience with this your input would be appreciated!
Thanks
Football season starts this weekend!
|
|
|
|
|
What about calling GetLastError() ?
also, It be because the beta machines don't have the high encryption pack installed.
Michel
It is a lovely language, but it takes a very long time to say anything in it, because we do not say anything in it, unless it is worth taking a very long time to say, and to listen to.
- TreeBeard
|
|
|
|
|
I am calling GetLastError() like this:
<br />
void CFPCommonFunctions::HandleError(CString strFunction) <br />
{ <br />
CString strMsg;<br />
strMsg.Format("CFPCommonFunctions::EncryptTransFile() - %s: %u.", strFunction, GetLastError());<br />
AfxMessageBox(strMsg, MB_OK | MB_ICONEXCLAMATION);<br />
}<br />
This returns 80090019, but there is no corresponding code in the Windows error table. I think I am not formating this message correctly.
Also, what do you mean by "don't have the high encryption pack installed"? The documentation on MSDN says that it is compatible with Win95 OSR2 and up. It relies on advapi32.dll, which these users have installed and registered...
Is there something I am missing???
9 Days till kickoff...
|
|
|
|
|
In the project I work for, every time we have problems with the Crypto API is because the host don't have the high encryption pack installed (since we are using high encryption).
Michel
It is a lovely language, but it takes a very long time to say anything in it, because we do not say anything in it, unless it is worth taking a very long time to say, and to listen to.
- TreeBeard
|
|
|
|
|
I have a CDialogBar derived object attached to the bottom of my MDI mainframe window. Works fine, except it is left justified in the frame/bar...I want it centered in the frame.
How do I do this?
I have tried overriding the OnWindowPosChanging and setting the position that way...which moves the window ok, but leaves garbage to the left of the window.
Gary Kirkham
A working Program is one that has only unobserved bugs
|
|
|
|
|
Try with void DockControlBar( CControlBar * pBar, UINT nDockBarID, LPCRECT lpRect) but specify lpRect for size and position, nDockBarID is ... well I guess you get the idea!
VOTD: 27 "Religion that God our Father accepts as pure and faultless is this:
to look after orphans and widows in their distress and to keep oneself from being polluted by the world." - Jam 1:27 (NIV)
|
|
|
|
|
i need to drag and drop menu items (or popup menu), do u know how to do it? any sample or idea will be great!
thx
includeh10
|
|
|
|
|
i develped an app, it has been used by customers for over 2 months (at least 16 hrs a day - for machines) with no problem, but i still warry about it, really need ur suggestion.
my question is:
in the app, i used a large buffer, some code as following:
//the large buffer, iSize>100,1000
char*pszBuf=new char[iSize];
char*p0=pszBuf+100;
char*p1=pszBuf+1000;
char ch=*p1;
*p1=0; //key point to warry, temp break the string
CString cs=p0;
*p1=ch;
in this way, access can be in high speed, main app uses in the way always (say, once/50 ms).
there are 3 threads use the buffer at same time (read only) and access whole buffer.
at first, i thought there must be troubles because i broke the buffer with *p1=0 and other threads can't access whole buffer. but after 2 months, no any problem!
in theory, i need to lock the buffer while doing break, but it is too complicated to do so.
why no problem? am i luck or OS helps me to do something i don't know?
thx.
includeh10
|
|
|
|
|
You should definately use locks and they are damn easy to use. Just look at EnterCriticalSection and LeaveCriticalSection functions in the MSDN documentation.
Mustafa Demirhan
http://www.macroangel.com
Sonork ID 100.9935:zoltrix
<nobr>They say I'm lazy but it takes all my time
|
|
|
|
|
'includeh\a'
Why do you worry about it? It's not the best piece of code that I have seen for sure but why are you worryied right now? It works since you are doing only 'read' access (I still think one thread is writing there...somehow!) or it doesn't matter if one thread reads last value stored (for one of these bytes) while other thread is writing. In anycase, the best solution is to synchronize access to your buffer.
VOTD: 27 "Religion that God our Father accepts as pure and faultless is this:
to look after orphans and widows in their distress and to keep oneself from being polluted by the world." - Jam 1:27 (NIV)
|
|
|
|
|
Yes, this looks rather dangerous.
Have you ever tested it on a 2 CPU machine? The probability it breaks there is much higher!
I would strongly recommend to use CriticalSections. CriticalSections cause a penality only if really two threads try to access it at the same time, which is not that probably because your threads access the buffer only every 50 ms.
Because your threds would lock the buffer only for a very small period, I would also recommend to use InitializeCriticalSectionAndSpinCount to set a small spin count for increased performance on SMP machines
--
Daniel Lohmann
http://www.losoft.de
(Hey, this page is worth looking! You can find some free and handy NT tools there )
|
|
|
|
|
Does anyone know where I can find some information on building an application database for the Windows CE handheld using (ADO or DAO) and SQL using Visual C++?
I've found VB code all over the place but the device I'm working on doesn't support VB.
Thanks.
|
|
|
|
|
I'm working on an ODBC database using Access as the source. I would like to use the SetModifiedFlag(); function so the user will be prompted to save when they change a record. When I tried implementing this I just get an error saying that it is an undeclared identifier. I am using CFormView as my base class.
I'd really appreciate any assistance.
Thanks
|
|
|
|