|
Is there a simple way of making the Exe for my program get a different icon depending on whether it's a debug or release build?
I can change the icon the main dialog uses at run time without problem, but not the icon that the exe has in explorer
--
Help me! I'm turning into a grapefruit!
Buzzwords!
|
|
|
|
|
F*****G CodeProject
I enter a message and hit Suhbmit, and the progress bar in Explorer goes to 100% and then just sits there!
Okay, as I type this in for the THIRD time...
Why not?
You can just add two different icons to your program based upon conditional compilation of the RC file.
Put a different one in there for release and debug.
I am pretty sure Explorer just uses the icon with the lowest numerical index.
Hope this one makes it into the forum...
|
|
|
|
|
Hmm, from experience I've found that compiler directives really don't work too well inside RC files
But I'll give it a try and see what happens
--
Help me! I'm turning into a grapefruit!
Buzzwords!
|
|
|
|
|
If you are using Visual Studio 6.0, it has an explicit tab for setting resource compiler settings.
See Project Settings Dialog : Resources Tab : PREPROCESSOR DEFINITIONS Edit Field
So, one of my projects, for exmaple, already has _DEBUG defined for the debug build.
Inside your RC or .RC2 file, do something like this
#ifdef _DEBUG<br />
1 ICON "MyDebug.Ico"<br />
#else<br />
1 ICON "MyRelease.Ico"<br />
#endif
and see if that works for you.
I would probably put it into the RC2 file, since the resource editor usually yacks on 'unexpected' preprocessor statements.
|
|
|
|
|
i want to create an array whose size is dynamic. Each node of the array should be an array of characters of length 20.And then i want to send this as an argument in a function.
This is what i have done.....
<br />
char *m_strTemp[10] = new char[count];<br />
After getting the value of "count" i start filling the array.
Now to send it as an argument of a function i declared the function as follows.
void CIdentifyDlg::SetVariable(char *str[10])<br />
{<br />
char *tempStr[10] = new char[count];<br />
tempStr = str;<br />
}<br />
The function is called as follows
<br />
SetVariable(m_strTemp[10]);<br />
This is giving error.
Can anyone please help me out. Hope my question is clear....
|
|
|
|
|
nripun wrote:
This is giving error.
I give up. What's the error?
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
nripun wrote:
char *m_strTemp[10] = new char[count];
here you allocate an array of 10 char pointers and assign the char pointer returned by new to element zero (m_strTemp[0]). It's not an array of 10 (valid) pointers to char arrays.
nripun wrote:
char *tempStr[10] = new char[count];
tempStr = str;
same issue as above. Furthermore, in the second line you set the pointer tempStr to point to the same location as str points to (which is an array of 10 char pointers, where the first one points to a valid array). You do not copy the data pointed to by str into the array pointed to by tempStr.
nripun wrote:
This is giving error.
which error?
I would use containers instead, either MFC containers or STL ones.
Cheers
Steen.
"To claim that computer games influence children is ridiculous. If Pacman had influenced children born in the 80'ies we would see a lot of youngsters running around in dark rooms eating pills while listening to monotonous music"
|
|
|
|
|
Why don't you use std::string (from the Standard Template Library) or CString (from MFC) instead ?
It will look like this:
void CIdentifyDlg::SetVariable(std::string* StringsArray, int nCount)<br />
{<br />
for (int i=0;i<nCount;i++)<br />
{<br />
std::string TempString = StringsArray[i];<br />
}<br />
}<br />
|
|
|
|
|
can you please tell me how to store numbers in a CString object??
|
|
|
|
|
Why do you want to store numbers ???? The problem is exactly the same as a standard string except you don't need to manage the memory yourself...
But if you need to send integers then use an integer array instead (int*) that is much more easy than store the numbers into char strings (and how would you do that ???)
|
|
|
|
|
This is what i want to do..........
<br />
sprintf(m_strTemp[i],"%d)\t%lf%% Match",i+1,m_final);
But m_strTemp is CString. So it gives the following error.
sprintf' : cannot convert parameter 1 from 'class CString' to 'char *'
|
|
|
|
|
Use Format() from CString, it will gives you exactly the same results:
m_strTemp[i].Format("%d)\t%lf%% Match",i+1,m_final);
|
|
|
|
|
Thank You very much ............
|
|
|
|
|
nripun wrote:
SetVariable(m_strTemp[10]);
How about this?
SetVariable(m_strTemp);
John
|
|
|
|
|
I am programming a C++ MFC GUI application. During every execution of a for loop in my app I want the application to pause for about 1 second. How can I do this? I have been screwing around with WM_TIMER and SetTimer and KillTimer but I just can't get it to pause. Any help/examples would be a great help.
Thanks!
Lilli
|
|
|
|
|
You mean Sleep(1000) ?
But if your loop is in the main thread, your application will freeze also during 1 second...
|
|
|
|
|
I'm sensing a potentially bad design here. Why exactly do you need a one-second pause?
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
Yes, as if the souls of a million maintenance programmers were crying out in agony...
|
|
|
|
|
I am programming an Easter Egg into the app I am working on. When a user picks a certain color to change the background to, the application rapidly switches between 25 random colors before going to the color the user chose. It's funny, but I need there to be a brief ~.2 second delay on each color so you can see it. Sleep(200) worked PERFECTLY.
|
|
|
|
|
Timers looks much more appropriate for doing that !! With the Sleep, your application will freeze (and thus not respond to user commands) during the Sleep time... In general, the use of Sleep is usefull for some very specific cases...
|
|
|
|
|
Yes, like telling your app that it's time to do something.
|
|
|
|
|
Hallo,
i try with VisualC++ 6 to read the LDAP user list, but all the examples didn't work.
See the problem:
--------------------Konfiguration: Test5 - Win32 Debug--------------------<br />
Kompilierung läuft...<br />
Test5.cpp<br />
d:\program files\microsoft visual studio\vc98\include\iads.h(27) : error C2146:<br />
Syntaxfehler : Fehlendes ';' vor Bezeichner 'IADs'<br />
(Syntax error: missing ';' befor identifier 'IADs') <br />
d:\program files\microsoft visual studio\vc98\include\iads.h(27) : fatal error C1004:<br />
Unerwartetes Dateiende gefunden<br />
(unexpected file end found)<br />
Fehler beim Ausführen von cl.exe.<br />
<br />
Test5.exe - 2 Fehler, 0 Warnung(en)<br />
In the iads.h(27) you find this: "typedef interface IADs IADs;".
I think i forgot a compiler directive or a lib file, but i didn't find information in the tutorials and forums.
Thanks in advance!
Carl
|
|
|
|
|
I noticed one sample included this file as well:
#include <activeds.h>
Does that help at all?
|
|
|
|
|
Not real,
I know the samples on this pages and also on MSDN. From this i built this example:
<br />
#include "stdafx.h"<br />
#include <afxwin.h><br />
#include <activeds.h><br />
#include <Adshlp.h><br />
#include <iads.h><br />
<br />
int main(int argc, char* argv[])<br />
{<br />
HRESULT hr;<br />
IADS *pads;<br />
<br />
hr = ADsGetObject( L"LDAP://rootDSE", IID_IADs, (void**)&pads);<br />
return 0;<br />
}<br />
I know the main function didn't real work, but it is enough for a build, i think.
|
|
|
|
|
I also saw this in MSDN:
Library: Included as a resource in Activeds.dll.
GUID: IID_IADs is defined as FD8256D0-FD15-11CE-ABC4-02608C9E7553.
Which makes me think you need to import the ActiveDS.Dll into your project to get the interface library.
See about the #import directive:
The #import directive is used to incorporate information from a type library. The content of the type library is converted into C++ classes, mostly describing the COM interfaces.
|
|
|
|