|
How do I change the TitleBar color (background and text) ?
|
|
|
|
|
I can not figure out the syntax how to copy my compiled DLL to another directory, or if I should put that code in the commands or outputs section on the Custom Build Tab in the Project Settings. I am looking to put the compiled DLL outside of the target directory. Using MSVC++ 6
Thanks in advance.
|
|
|
|
|
In the Project->Settings->Post Build Step tab, try something like:
Debug: copy Debug\*.dll "D:\SomeOtherFolder\MyFolder"
Release: copy Release\*.dll "D:\SomeOtherFolder\MyFolder"
|
|
|
|
|
How can I make the text on a tab look as if it is grayed out (to make the tab have the effect of not being able to be selected). I have an app with multiple tabs, and several of those need to be disabled at specific times. I realize I can make the tab unable to display the appropriate dialog when being clicked but how do you make the text have the look of being grayed out?
|
|
|
|
|
This might help...
http://support.microsoft.com/support/kb/articles/Q151/6/62.asp
Good luck,
Frank
|
|
|
|
|
Hi!
How would the code for overriding the OnPaint() function look like? I have been trying to set the color of a slider I created with MFC. I managed to color it's background but didn't manage to change the slider "knob" or "path" color, how is this done?
I also have a Combobox wich I would like to change the color of as well, but it didn't work out either.
Then there's the frame of the window, I beieve I should override OnNcPaint() function for this but either I'm wrong or doig it wrong. =)
And changing the color of the entire application menu would be very nice if I could do this too.
Thanks in advance!
/Fredrik
|
|
|
|
|
OnPaint() is the wrong way to do it. You can change the thumb and track colors pretty easily using custom draw.
As for the combobox, look up the docs on CWnd::OnCtlColor().
|
|
|
|
|
Ah, I have tried to do custom draw but I don't get it to work, how do I make menu and the other things(mentioned earlier) with custom draw, I could use some samples of code, since I seem to be doing something wrong when I don't get it to work. =)
Thanks,
/Fredrik
|
|
|
|
|
My application asks user to enter a hex value. First of all, can I read and store it in a variable directly as hex value? If not, I should declare a CString to read and store it, right? Then, how can I covert this CString value into hex value. An example will be most appreciated. Please help. Thank you.
|
|
|
|
|
Hi,
One solution is:
CString sHexNumber = "ABC";
DWORD dwDecNumber = 0;
sscanf( sHexNumber, _T("%16x"), &dwDecNumber );
Best regards
Holger
|
|
|
|
|
Howdy all,
I'm looking for either a library or a snippet as to how to parse tokens embedded in nested parentheses. For instance, I need to convert something like:
(A, B, (C, D))
into a tree like:
A
B
(Parent)->C
(Parent)->D
Of course, other trees would have different formats:
((A, B), C, D)
((A,B), (C,D))
etc..
I think this borders on a grammar topic, but my brain isn't quite what it used to be ;-( Any suggestions would be welcome. Thanks.
|
|
|
|
|
Probably need to use Polish Notation logic. I don't remember just how it goes, but you should be able to
find a compiler design book that covers it.
|
|
|
|
|
I think there is an expression parser in the CodeGuru web site but there might be one in this web site too. They might help but might be too much.
I think you only need a syntactical parser. You probably do not need a symantics parser. Are you familiar with Lexx? It is a compiler that generates a syntactical parser written in C.
Also see: http://www.snippets.org/ and look for "Jari Laaksonen's comment utilities in C++" near the bottom. It might help.
|
|
|
|
|
Hi Everyone,
How do I declare an Array inside another Array?
For example, I have the following two arrays:
/////////////////////////////////////////////////////////
int UserInputSize1, UserInputSize2;
int *array1;
array1= new int[UserInputSize1];
int *array2;
array2=new int[UserInputSize2];
//the size of the arrays will be determined by the user input during runtime.
///////////////////////////////////////////////////////
How do I declare them so under array1, it’ll contain the other array?
So for example, if the size of array1 is 3 and the size of array2 is 10, then under every element in array1, I’ll be able to store 10 numbers. Then I’ll be able to store a total of 30 numbers with this example.
I would like to do something like this:
Array1[0].Array2[0]=5;
Array1[0].Array2[1]=10;
Array1[0].Array2[3]=11;
…
If anyone knows, Please let me know.
Thanks in advance
Steve
|
|
|
|
|
You first make an array of int* (in effect, an array of arrays) and then allocate one array for each of the int pointers. Thus:
int** bigarray = new int* [UserInputSize1];
for (int i=0; i < UserInputSize1; i++)
bigarray[i] = new int [UserInputSize2];
bigarray[0][0] = 5;
bigarray[0][1] = 10;
bigarray[0][2] = 15;
Then free the memory in reverse order:
for (int i=0; i < UserInputSize1; i++)
delete [] bigarray[i];
delete [] bigarray;
|
|
|
|
|
The following is a complete program. Is it what you are asking for? If so, then there are many good books about the C and C++ languages that would cover such things much better than the volunteers helping with this forum.
#include <iostream>
using namespace std;
int main(int argc, char *argv[], char *envp[]) {
int Array[3][10], i=0, i1, i2;
for (i1=0; i1<3; ++i1)
for (i2=0; i2<10; ++i2)
Array[i1][i2] = i++;
for (i1=0; i1<3; ++i1) {
for (i2=0; i2<10; ++i2)
cout << Array[i1][i2] << ' ';
cout << endl;
}
return 0;
}
|
|
|
|
|
I have a pdf file. I can read the file, but I can't edit it.
Is there any way of printing text on top of the pdf file
without printing the file and then asking the user to put
the paper back into the printer to print the text on top of
it.
Please, any response any one can give me will be greatly
appreciated.
Sincerely,
Erich J. Ruth (an overworked graduate student)
|
|
|
|
|
1) Customize ghostscript, which claims to be able to handle .pdf files.
2) Hook into GDI, before each EndPage call, add some TextOut calls.
|
|
|
|
|
i'm trying to compile pgp from the source and i need to get the win95 ddk to get it working. microsoft offers the win98 ddk, the win2000 ddk, and the winNT ddk, but i still need the win95 ddk. is there any other place i can find it? thanks in advance.
|
|
|
|
|
Is it possible to stretch a bitmap to the size of a CStatic?
I´m currently using a CStatic control with the SS_BITMAP style to display a bitmap but with this style
the control automatically sizes itself to accommodate it.
The bitmap I want to stretch was included in the project as a resource file.
-------------------------------------------
Marcelo Guerra
|
|
|
|
|
(1) Create a CStatic frame NOT bitmap, but invisible.
(2) Get Chris Maunder's CDIBSectionLite class to draw the bitmap.
(3) Find the size of your CStatic, and using CDIBSectionLite::Stretch draw the stretched bitmap.
HTH
Jerry
|
|
|
|
|
Hi Everyone,
I would like to use an array that has a size that is determined by the user
input. But I'm getting this problem of " array must contain constant " from
this array declaration:
int UserInput;
int TheArray[UserInput];
How do I declare the size of the array with user input?? if anyone knows,
Please let me know.
Thanks in Advance!
|
|
|
|
|
1. If it is a maximum possible array size, you can declare array of this size, like this:
#define MAX_USER_INPUT 255
int TheArray[MAX_USER_INPUT];
Do not forget to check UserInput in this case.
if (UserInput > MAX_USER_INPUT)
// show error message
2. Or use new() and delete()
int *TheArray = NULL;
BOOL InitArray(int *&TheArray, int UserInput)
{
if (UserInput <= 0)
return FALSE;
if (TheArray)
delete[] TheArray;
TheArray = new int[UserInput];
return TheArray != NULL;
}
Don't forget to delete[] TheArray.
|
|
|
|
|
int theUserInput;
theUserInput = 10; // or from user input
int *array;
array = new int[theUserInput];
array[0] = 5; // whatever
|
|
|
|
|
I'm looking for a way to bring up the security dialog (as in file + properties) when I create a file or entry in the registry. I want to give the user a possibility to change the permission (who and what kind of access) of a file/registry entry. Is it possible?
Thanks/Regards
Magnus
|
|
|
|