|
I know of nmake.exe... but where do I find it/use it?
Patrick
-- modified at 11:19 Monday 24th July, 2006
|
|
|
|
|
It's in the \vc98\bin folder.
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Note that nmake and GNU make syntax are often not compatible, so you might have to either download and use GNU make on Windows, or bite the bullet and maintain both a GNU-compatible makefile and a Visual Studio project file.
|
|
|
|
|
Hello.
I have an application that needs to launch multiple dialog boxes. To do this, I create the first dialog box in modal, and the others as non-modal.
Yet, I have one issue: when I launch the other dialogs, they don't have a title in the task bar and when I minimize them they get minimized just over the task bar. So, it's as if I did specify it to be a child (but I had put "parent" to NULL)...
How can I have multiple dialogs, that would have their own button in the taskbar, in one application?
Thank you
S. Ali Tokmen
http://ali.tokmen.com/
|
|
|
|
|
|
Hi all,
I would like to create a toolbar with standard bitmaps like a play, record and a pause button but I do not know where I can find these bitmaps or how I can use these.
Could somebody give me a hint?
Thanks.
|
|
|
|
|
what I've done in the past is open up the tool bar and draw what you'd like for each button.
you can adjust the size of the toolbar (length and width) by going in to your ".rc" and looking for:
<br />
<br />
IDR_MAINFRAME TOOLBAR 45, 45<br />
the "45, 45" are the length and width of the toolbar
Kitty5
|
|
|
|
|
Thank you Kitty5,
but there should be a way to use all these standard bitmaps. I think they are somewhere in the system32 folder in windows xp.
I don't like to redraw these icons if they already exist. Yes, it is easy for such simple bitmaps like a green triangle as play button or a red circle as record button. But it becomes harder if you try to redraw e.g. this folder bitmap of the open icon.
|
|
|
|
|
this might help:
ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.VisualStudio.v80.en/dv_vcresed/html/971c181b-40f5-44be-843d-677a7c235667.htm
Kitty5
-- modified at 9:29 Monday 24th July, 2006
also, those file folders, etc. are located in:
C:\WINDOWS\system32\SHELL32.dll
... not sure how u'll get the bitmaps out of the dll file...
|
|
|
|
|
Use the brute force & pig ignorance solution - it's simple, easy to explain, and it works. And you don't have to think too much.
Open an application which uses the icons you want on its toolbar (Windows accessories /Audio recorder, for example.)
Press Alt-PrtScr to copy the application window image to clipboard.
Paste the image into Windows Paint (or whatever graphics editor you choose)
Copy the images of the toolbar buttons one by one, and paste into Resource editor for your toolbar.
|
|
|
|
|
Hi all,
I am unable to get a clear idea why i am getting wrong.
//=======================================================================
int x;
unsigned long y;
x = -1;
y = 100;
if(x > y){
MessageBox("X is greater than Y");
}
else
MessageBox("Y is greater than X");
//=========================================================================
in the above statement first statement is being executed why.
please let me know.
Uday
|
|
|
|
|
x is being cast to an unsigned int. (UINT)-1 = really_big_positive_number
|
|
|
|
|
//====================================This is the Solution
int x;
unsigned long y;
x = -1;
y = 100;
if( x > (int) y ) //Typecaste here
{
MessageBox("x>y");
}else
MessageBox("y>x");
//=================================================================
any more suggestion please let me know
uday.
|
|
|
|
|
Chris is correct of course; 'y' is unsigned while 'x' is signed. If you check the output window in your IDE the compiler should have issued warnings indicating that you're mixing signed and unsigned values in the assignment and comparison. The reason -1 is actually interpreted as the largest positive number relates to how 2's compliment arithmetic works; you may want to look this up if you’re curious. You used a type cast to fix the problem ; while this works a better solution (if appropriate) would be to simply make 'y' signed. I would also suggest that if you must type cast use static_cast instead of a C-style cast. e.g.
static_cast<int>(y)
There are many reasons to prefer C++ casting operators to C-style casts: in this case visibility applies (in other casting examples there are more pressing reasons to prefer C++ casting operators).
|
|
|
|
|
If I have a string definfed as this: char sir[17] how can i remove any new line or carriage return from the end or the begining of it?
|
|
|
|
|
tanarnelinistit
wroteremove any new line or carriage return
void check(char p[])
{
for(int i=0;i < strlen(p)-1;i++)
{
if(p[i]=='\n')
else
}
}
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Go the end of the string, start backing up character-by-character while whitespace (or whatever you want to trim) is found. When you find the first non-matching character, place a NUL into that location to terminate the string at that point.
You do not have to do something crazy like copying the string or moving it into and out of a string object.
Peace!
-=- James If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! DeleteFXPFiles & CheckFavorites (Please rate this post!)
|
|
|
|
|
What about beginning of string?
Any sufficiently gross incompetence is nearly indistinguishable from malice.
|
|
|
|
|
Just reverse the algorithm, being sure not to walk past the end of the string.
Peace!
-=- James If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! DeleteFXPFiles & CheckFavorites (Please rate this post!)
|
|
|
|
|
tanarnelinistit wrote: how can i remove any new line or carriage return from the...begining of it?
Something like the following comes to mind:
void TrimLeft( char *str, const char ch )
{
char *pStr = str;
while (ch == *pStr)
pStr++;
strcpy(str, pStr);
} Fine tune it to fit your needs.
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Method using CString:
char buffer[17] = {0};
InitializeBuffer(buffer);
CString strBuffer(buffer);
strBuffer.TrimLeft();
strBuffer.TrimRight();
memset(buffer, 0, 17);
strncpy(buffer, strBuffer, 16);
Method using std::string:
char buffer[17] = {0};
InitializeBuffer(buffer);
std::string sBuffer(buffer);
int start_pos = sBuffer.find_first_not_of("\t\n\r ");
int end_pos = sBuffer.find_last_not_of("\t\n\r ");
if (start_pos == npos)
{
start_pos = 0;
}
if (end_pos = npos)
{
end_pos = strlen(buffer) - 1;
}
std::string sTemp = sBuffer.substr(start_pos, end_pos - start_pos + 1);
memset(buffer, 0, 17);
strncpy(buffer, sTemp.c_str(), 16);
Method using char:
int FindFirstNotOf(const char* chars, size_t chars_size, const char* str, size_t str_size)
{
int ret = -1;
for (int i = 0; i < str_size; ++i)
{
bool bFound = false;
for (int j = 0; j < chars_size; ++j)
{
if (str[i] == chars[j])
{
bFound = true;
break;
}
}
if (bFound == false)
{
ret = i;
break;
}
}
return ret;
}
int FindLastNotOf(const char* chars, size_t chars_size, const char* str, size_t str_size)
{
int ret = -1;
for (int i = str_size - 1; i >= 0; --i)
{
bool bFound = false;
for (int j = 0; j < chars_size; ++j)
{
if (str[i] == chars[j])
{
bFound = true;
break;
}
}
if (bFound == false)
{
ret = i;
break;
}
}
return ret;
}
char buffer[17] = {0};
InitializeBuffer(buffer);
char chars[5] = "\t\r\n ";
int start_pos = FindFirstNotOf(chars, 5, buffer, 17);
int end_pos = FindLastNotOf(chars, 5, buffer, 17);
if (start_pos == -1)
{
start_pos = 0;
}
if (end_pos == -1)
{
end_pos = strlen(buffer) - 1;
}
char newBuffer[17] = {0};
strncpy(newBuffer, &buffer[start_pos], end_pos - start_pos);
memset(buffer, 0, 17);
strncpy(buffer, newBuffer, 16);
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week
Zac
|
|
|
|
|
OK - perhaps a simple example of trimming a string in-place, because you did not mention the word "copy" in your post (this code comes slightly modified from my TStaticString class):
void TrimRight( LPTSTR cpString,
LPCTSTR cpTrimWhat = _T( " " ) )
{
size_t stStrLen = ::_tcslen( cpString );
if( !stStrLen )
{
return;
}
LPTSTR cpCursor = ( cpString + ( stStrLen - 1 ) );
size_t stCount = 0;
while( ( stCount < stStrLen) &&
( ::_tcschr( cpTrimWhat, *cpCursor ) ) )
{
++stCount;
--cpCursor;
}
if( stCount )
{
++cpCursor;
*cpCursor = _T( '\0' );
}
return;
} See how that works for you. Specify the characters to Example of use:
TCHAR caTest[ 32 ];
strcpy( caTest, _T( "abc\t " ) );
TrimRight( caTest );
strcpy( caTest, _T( "abc\t " ) );
TrimRight( caTest, "\t " );
The first call will trim up to the tab character, the second will also trim the tab character.
Peace!
-=- James If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! DeleteFXPFiles & CheckFavorites (Please rate this post!)
|
|
|
|
|
plz send me da code how vc++ can connect to access database either DAO/ODBC
janan
|
|
|
|
|
See here[^]
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
See the semi-related article here.
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|