|
|
|
yesss. that's it. i forgot the #define. ok man thank you! i appreciate your efforts!
|
|
|
|
|
Hi!
I have a dialog based application with severeal dialogs. There is a main dialog, which calls via Button and Menu all other dialogs.
Till now, I used only ordinary dialogs. But to make it more clear to the user, I tried to transform some of the dialog classes into PropertyPages. While using the dialog class, parameters were given to the main program while pressing the OK-Button.
Because there is no OK-Button in a PropertyPage-dialog, I don't know, how to give over the parameters now.
I Already implemented a function OnRefer(WPARAM, LPARAM), but only that was too less.
I already serached in the codeproject's articles but couldn't find something accordingly.
It would be great, if somebody could help me with this problem (Links, Hints or whatever)!!
Hanno
-- modified at 4:46 Wednesday 1st February, 2006
|
|
|
|
|
hanno25 wrote: parameters were referred while pressing the OK-Button
What do you mean exactely with "refer" ?
~RaGE();
|
|
|
|
|
Sorry about that, my mothertongue isn't the english language.
I want to say: to send parameters, to give over parameters. Is that a better expression?
Hanno
|
|
|
|
|
hanno25 wrote: to send parameters, to give over parameters
OK! I was not sure what you meant.
The idea behind the Property pages is:
You have a property sheet containing property pages.
You set up the property sheet, adding the property pages one by one, then the property sheet is called with a DoModal() from your base dialog. Now to exchange data between the property pages and your base dialog, you do the following:
The data you want to retrieve is saved in each property page in member variables.( I usually save everything in each property page in the OnDestroy() function, which is called when the property page is destroyed.)
Before doing the propsheet.Domodal() , you initialize all member variables of the property pages.
When the user clicks OK, the property sheet object still exist, and so do the property pages. You can then retrieve the data from the prop pages member variables.
A small code snippet:
CPage5Dlg page5;
page5.m_EnvList =m_EnvList;
page5.m_psp.dwFlags &=~PSP_HASHELP;
page5.m_AllowMultisession=m_AllowMultisession;
page5.m_AppendProject=m_AppendNewProject;
page5.m_psp.dwFlags| =PSP_USETITLE;
page5.m_psp.dwFlags& =~PSP_HASHELP;
page5.m_psp.pszTitle ="Environment";
CPage3Dlg page3comp;
page3comp.m_ShowLog=m_ShowCompilerLog;
page3comp.m_ShowComp=m_ShowCompilerWindow;
page3comp.m_CheckInno=m_CheckInno;
page3comp.m_DoComp=true;
page3comp.m_strarrNames.Copy(m_strarrNames);
page3comp.m_strarrOpt.Copy(m_strarrOpt);
page3comp.m_psp.dwFlags|=PSP_USETITLE;
page3comp.m_psp.dwFlags&=~PSP_HASHELP;
page3comp.m_psp.pszTitle="Compiler";
CPropertySheet Hello;
Hello.SetTitle("Settings...");
Hello.m_psh.dwFlags&=~PSH_HASHELP;
Hello.m_psh.dwFlags|=PSH_NOAPPLYNOW|PSH_USEHICON;
Hello.m_psh.hIcon=m_hIcon;
Hello.AddPage(&page5);
Hello.AddPage(&page3comp);
if (Hello.DoModal()==IDOK)
{
m_EnvList = page5.m_EnvList;
m_NamesArr = page3comp.strarrOpt;
}
~RaGE();
|
|
|
|
|
Use the PSM_QUERYSIBLINGS message that is designed for this purpose.
http://www.codeproject.com/property/Psm_QuerySiblings.asp#xx878390xx[^]
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" - mYkel - 21 Jun '04
"There's not enough blatant self-congratulatory backslapping in the world today..." - HumblePie - 21 Jun '05
Within you lies the power for good - Use it!
|
|
|
|
|
I need to know if there is any API call to find out the *unique* serial number of mother board, processor, etc..
Aljechin Alexander
|
|
|
|
|
|
I suggest you to follow the link given below
http://www.codeproject.com/system/PIIISN.asp
reply me back if you have some problems
Wishes.
Anshuman Dandekar
Dare to Dream,
Care to Achieve.............
|
|
|
|
|
Just making my first steps in DLL and wanna see a very simple example of loading DLL by using function LoadLibrary or DEF files.My DLL is kinda of simple math library for adding ,substracting ,...but dont know how to load it by using LoadLibrary or DEF.Best Regards
|
|
|
|
|
HINSTANCE hinstLib;
hinstLib=LoadLibrary("Path to the dll");//replace with your path to the dll
CreateFn pfnCreate = (CreateFn) GetProcAddress((HINSTANCE) hinstLib, _T("Yourfunction"));// replace YourFunction with// function name
FreeLibrary(hinstLib);
Does this solve your problem
Wishes.
Anshuman Dandekar
Dare to Dream,
Care to Achieve.............
-- modified at 3:44 Wednesday 1st February, 2006
|
|
|
|
|
Can anyone help?
If there is an array has be randomly generated, and its size is in the range 2 to 5, how can I swap the h with the other elements as I dont know the exact location of the others at the beginning?
C | A
B | h
In the above case, am I wrong if I hit 4 at the keyboard to swap h with B, hit 8 to swap h with A, and hit 7 to swap h with C?
|
|
|
|
|
I'll assume we have an array as follows:
enum
{
MatrixWidth = 2,
MatrixHeight = 2
};
char g_Matrix[MatrixWidth][MatrixHeight];
I'll store the coordinates of the hole in the following variables:
int g_HoleX;
int g_HoleY;
To clarrify your matrix has the following properties:
g_Matrix[0][0] = 'C';
g_Matrix[1][0] = 'A';
g_Matrix[0][1] = 'B';
g_Matrix[1][1] = 'h';
g_HoleX = 1;
g_HoleY = 1;
The following function should move the hole:
enum Direction
{
Up,
Down,
Left,
Right
};
bool Move(Direction dir)
{
int x = g_HoleX;
int y = g_HoleY;
switch(dir)
{
case Up:
if (g_HoleY == 0)
{
return false;
}
y -= 1;
break;
case Down:
if (g_HoleY == MatrixHeight-1)
{
return false;
}
y += 1;
break;
case Left:
if (g_HoleX == 0)
{
return false;
}
x -= 1;
break;
case Right:
if (g_HoleX == MatrixWidth-1)
{
return false;
}
x += 1;
break;
}
char temp = g_Matrix[g_HoleX][g_HoleY];
g_Matrix[g_HoleX][g_HoleY] = g_Matrix[x][y];
g_Matrix[x][y] = temp;
g_HoleX = x;
g_HoleY = y;
return true;
}
NOTE: I have not tested any of this. If you want diagonals you'll have to modify it slightly.
Steve
-- modified at 4:56 Wednesday 1st February, 2006
|
|
|
|
|
Hello,
What is the ascii code for CTRL+ESC???
In one of my applications, to enter one test I have to press CTRL+ESC and ESC for returning from it.
I know the ASCII code for ESC. It is 27(0x1B).
But, what is code for CTRL+ESC??
Somebody help!!!!
Regards,
mysticlol
|
|
|
|
|
There are no ASCII code for CTRL-ESC.
The CTRL key is used to remove 0x40 from the normal charater key pressed.
That way one can produce a control-ASCII character from a normal keyboard. For instance, pressing CTRL G will give the ASCII code 0x7 (BEL(L)).
Pressing a plain G will produce the ASCII character G (obviously!), wich has the ASCII code 0x47.
So you have to check for the virtual key codes to be able to trap CTRL-ESC.
|
|
|
|
|
Use GetKeyState() to check if the CTRL key is down when you handle the ESC key.
if (KeyPressed == VK_ESCAPE && (GetKeyState(VK_CONTROL) & (1 << sizeof(SHORT) * 8 - 1)))
{
} The & (1 << sizeof(SHORT) * 8 -1) code is used to check only the high-order bit of GetKeyState 's return value.
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" - mYkel - 21 Jun '04
"There's not enough blatant self-congratulatory backslapping in the world today..." - HumblePie - 21 Jun '05
Within you lies the power for good - Use it!
|
|
|
|
|
please help me:
i have to create an extension for thunderbird not for firefox so i want tutorial for how to create extension and use this.
reply me ASAP.
Bankey Khandelwal
Software Engineer
|
|
|
|
|
Hi
I am writing an application, which i am using to find out the files opened through the Open/Save As dialog of Ms-Office. The WM_OBJECTSEL message is generated by the dialog whenever a new file is opened. Does anyone know the messages identifier of this message. Thanks in advance.
|
|
|
|
|
Info seems sketchy but I'm guessing like this:
UINT WM_OBJECTSEL = RegisterWindowMessage(_T("WM_OBJECTSEL"));
Steve
|
|
|
|
|
Thanks . But how can i get the filename from this message. Whether the LPARAM or WPARAM will have the value. Can you please brief me on this.
|
|
|
|
|
Hi,
When I run my application the memory usage increases upto 30MB. The moment I minimize the GUI, the memory usage comes down to less than 1MB. Even when I maximize it back, the memory increase is just 2-3MB. I understand that when we minimize the app. the physical memory is temporarily written to the page file on the hard disk. But once I maximize the app, the page file should be written back to physical memory, but it shows much lesser memory usage. Though my application is running fine, but this memory thing is bothering me. Any idea what could be happening?
Thanx,
Ratna
|
|
|
|
|
What language is it written in? What libraries are used? For example, I believe this kind of behavior is common with dotNET applications (from what I hear).
Steve
|
|
|
|
|
Hi,
The front end is in VB6, but no major memory allocation is being done in VB. The backend(dll) is in VC++, where 99% of the memory work is done. Other than that no particular libraries are being used.
Thnx,
Ratna
|
|
|
|