|
Hi guys,
Thanks for clarifying this.
I indeed confused 'current directory' with 'directory the app is in'.
In fact for what I want I don't need GetCurrentDirectory().
Nish, you're right, I should use GetModuleFileName().
Thank you.
Geert.
|
|
|
|
|
Hello guys,
I have two toolbar, but when they are created, they are place one under the other. I would align them on the same row. How can I do that?.
Thank you.
Giancarlo
|
|
|
|
|
Create a CReBar and add your toolbars to the rebar.
By default they'll be on the same line.
If you want them on separate lines you'll need to use RBBS_BREAK flag explicitly when adding the toolbars to the rebar
Nish
Sonork ID 100.9786 voidmain
www.busterboy.org
Nish is a BIG fan of Goran Ivanisevic
|
|
|
|
|
Have a look at my CGSToolbar class on CP - it shows you how to put them in a row without having to lose floatability ( rebars do not float ).
Christian
After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001
Sonork ID 100.10002:MeanManOzI live in Bob's HungOut now
|
|
|
|
|
Hi All...
Pls Help me to resolve this problem...
I want to Give Filter Command in a File Dialog...
I could give one Line in that Combo Box..How can I Insert more that One line In that Combo Box
Thanks in Advance
|
|
|
|
|
Hello,
Each line should be shared by a character - "| ", and last ast to come to an end a double character "|| "
Best regards
Eugene Pustovoyt
|
|
|
|
|
Is anyone to able send me a working example of this article?
http://msdn.microsoft.com/library/en-us/sysinfo/regapi_0tq1.asp?frame=true
Unfortunly, I know C++ to bad to compile it myself.
Thanks a lot!
PS. sorry for my english.
==============
www.design.kg
|
|
|
|
|
All you need to do is create a dialog class that contains the appropriately named list boxes and copy and paste this function. If you're not capable of that you should NOT be touching code that plays with the registry.
If you really can't create a dialog based project and copy/paste some code, I'd be happy to advise you, but I'm serious about how seriously you can screw Windows if you play with the Registry and don't know what you're doing.
Christian
After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001
Sonork ID 100.10002:MeanManOzI live in Bob's HungOut now
|
|
|
|
|
Of cource I can do it all,
how do you think, if I'll be on this forum if I can't create a dialog box?
When I compile it, VC create some errors as:
: error C2660: 'SetDlgItemTextA' : function does not take 3 parameters
: error C2660: 'SetDlgItemInt' : function does not take 4 parameters
: error C2664: 'void __thiscall CWnd::GetDlgItem(int,struct HWND__ ** ) const' : cannot convert parameter 1 from 'struct HWND__ *' to 'int'
: error C2660: 'SendMessageA' : function does not take 4 parameters
: error C2664: 'RegEnumKeyExA' : cannot convert parameter 4 from 'const int' to 'unsigned long *'
: error C2664: 'void __thiscall CWnd::GetDlgItem(int,struct HWND__ ** ) const' : cannot convert parameter 1 from 'struct HWND__ *' to 'int'
: error C2660: 'SendMessageA' : function does not take 4 parameters
: error C2660: 'MessageBoxA' : function does not take 4 parameters
: error C2664: 'void __thiscall CWnd::GetDlgItem(int,struct HWND__ ** ) const' : cannot convert parameter 1 from 'struct HWND__ *' to 'int'
: error C2660: 'SendMessageA' : function does not take 4 parameters
: fatal error C1004: unexpected end of file found
that way ...
And I thought that it will be easy for me to see ready project, becourse I speek english wery bad ... and it will be easy to look throo ready sample.
best regrads ...
==============
www.design.kg
|
|
|
|
|
mmmmmmmmmmmmmmmmmmmmm
That's what happens when you copy/paste API code into MFC projects.
tell you what, all those places where you got errors prefix the function call with ::
That should remove these bugs
Nish
Sonork ID 100.9786 voidmain
www.busterboy.org
If you don't find me on CP, I'll be at Bob's HungOut
|
|
|
|
|
Nish, while this is the cause of his last problem, this MSDN article had serious, serious problems - it simply would not work as it appears in MSDN.
Christian
After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001
Sonork ID 100.10002:MeanManOzI live in Bob's HungOut now
|
|
|
|
|
Karavaev Denis wrote:
how do you think, if I'll be on this forum if I can't create a dialog box?
Well, you *did* say Unfortunly, I know C++ to bad to compile it myself.. You'd be amazed at some of the questions we get around here. Most are intelligent but some are just out of control.
C1004 means you either didn't put a final bracket, or you didn't include stdafx.h. The missing bracket is at the end. The HANDLE parameter should be a HKEY. Where the code checks if retValue == ERROR_SUCCESS, it should check for != ERROR_NO_MORE_ITEMS. Where it passes in MAX_PATH to RegEnumValues, it should set a DWORD to = MAX_PATH, pass in a pointer to that variable, and reset the variable to MAX_PATH. I think that was all, but my code follows to make sure. This smaple is SCREWED.
#define MAX_VALUE_NAME 255
VOID QueryKey(HWND hDlg, HKEY hKey)
{
CHAR achKey[MAX_PATH];
CHAR achClass[MAX_PATH] = "";
DWORD cchClassName = MAX_PATH;
DWORD cSubKeys;
DWORD cbMaxSubKey;
DWORD cchMaxClass;
DWORD cValues;
DWORD cchMaxValue;
DWORD cbMaxValueData;
DWORD cbSecurityDescriptor;
FILETIME ftLastWriteTime;
DWORD i, j;
DWORD retCode, retValue;
CHAR achValue[MAX_VALUE_NAME];
DWORD cchValue = MAX_VALUE_NAME;
CHAR achBuff[80];
RegQueryInfoKey(hKey,
achClass,
&cchClassName,
NULL,
&cSubKeys,
&cbMaxSubKey,
&cchMaxClass,
&cValues,
&cchMaxValue,
&cbMaxValueData,
&cbSecurityDescriptor,
&ftLastWriteTime);
SendMessage(GetDlgItem(hDlg, IDL_LISTBOX),
LB_ADDSTRING, 0, (LONG) "..");
DWORD dwLength = MAX_PATH;
SetCursor(LoadCursor(NULL, IDC_WAIT));
for (i = 0, retCode = ERROR_SUCCESS;
retCode != ERROR_NO_MORE_ITEMS; i++)
{
retCode = RegEnumKeyEx(hKey,
i,
achKey,
&dwLength,
NULL,
NULL,
NULL,
&ftLastWriteTime);
if (retCode != (DWORD)ERROR_NO_MORE_ITEMS)
{
SendMessage(GetDlgItem(hDlg, IDL_LISTBOX),
LB_ADDSTRING, 0, (LONG) achKey);
}
dwLength = MAX_PATH;
}
SetCursor(LoadCursor (NULL, IDC_ARROW));
SetCursor(LoadCursor(NULL, IDC_WAIT));
if (cValues)
{
for (j = 0, retValue = ERROR_SUCCESS;
j < cValues; j++)
{
cchValue = MAX_VALUE_NAME;
achValue[0] = '\0';
retValue = RegEnumValue(hKey, j, achValue,
&cchValue,
NULL,
NULL,
NULL,
NULL);
if (retValue != (DWORD) ERROR_SUCCESS &&
retValue != ERROR_INSUFFICIENT_BUFFER)
{
wsprintf (achBuff,
"Line:%d 0 based index = %d, retValue = %d, "
"ValueLen = %d",
__LINE__, j, retValue, cchValue);
MessageBox (hDlg, achBuff, "Debug", MB_OK);
}
achBuff[0] = '\0';
if (!lstrlen(achValue))
lstrcpy(achValue, "<NO NAME>");
wsprintf(achBuff, "%d) %s ", j, achValue);
SendMessage(GetDlgItem(hDlg,IDL_LISTBOX2),
LB_ADDSTRING, 0, (LONG) achBuff);
}
}
SetCursor(LoadCursor(NULL, IDC_ARROW));
}
and in OnPaint:
CDialog::OnPaint();
HKEY key;
DWORD result;
RegCreateKeyEx(HKEY_CURRENT_USER, _T("Software"), NULL,
NULL, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &key, &result);
ASSERT(REG_OPENED_EXISTING_KEY == result);
QueryKey(m_hWnd, key);
RegCloseKey(key);
Christian
After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001
Sonork ID 100.10002:MeanManOzI live in Bob's HungOut now
|
|
|
|
|
Than you very much for your underasanding
but ... one more:
: error C2664: 'void __thiscall CWnd::GetDlgItem(int,struct HWND__ ** ) const' : cannot convert parameter 1 from 'struct HWND__ *' to 'int'
this error I get with your code?
Is I did wrong something again?
==============
www.design.kg
|
|
|
|
|
For some reason it knows to call ::GetDlgItem for me, but for you it's trying the CWnd:: function of the same name. Preface the function with :: and you'll be fine.
Christian
After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001
Sonork ID 100.10002:MeanManOzI live in Bob's HungOut now
|
|
|
|
|
Hello,
I have a class derived from CFrameWnd.
Is it okay for me to do this from within my class?
while (GetMessage(&msg, NULL, 0, 0))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
if (msg.message==WM_CLOSE)
break;
}
What I want to know is, will this interfere with MFC's message handling?
Nish
Sonork ID 100.9786 voidmain
www.busterboy.org
Nish is a BIG fan of Goran Ivanisevic
|
|
|
|
|
In principle it should not interfere with MFC's message handling. But your message loop does not conform to the MFC standard. You would loose PreTranslateMessage and idle time processing (which updates menus and toolbars). Some MFC classes might stop working properly.
The msdn contains some articles how to write an MFC conformant message loop: Idle Loop Processing.
Another (maybe better) method is described in knowledge base article Q99999.
regards Oliver
|
|
|
|
|
Thanks Oliver.
I was expecting more responses though.
Your reply was the single solace
Nish
Sonork ID 100.9786 voidmain
www.busterboy.org
If you don't find me on CP, I'll be at Bob's HungOut
|
|
|
|
|
Dear friends
Will you please help me how to display contents by maintaining scrollbar movement.I think i have to display line by line an WM_PAINT but it didn't work and access violation error comes.
Actually i am displaying the contents of clipboard so it should be of varying length and i am accessing it line by line from clipboard.
so please give me solution to do it in a right way.If possible please send me some code example.
i shall be ever great ful to you for this.
Thanking you in advance.
Binnu
|
|
|
|
|
Dear friends
Will you please help me how to display contents by maintaining scrollbar movement.I think i have to display line by line an WM_PAINT but it didn't work and access violation error comes.
Actually i am displaying the contents of clipboard so it should be of varying length and i am accessing it line by line from clipboard.
so please give me solution to do it in a right way.If possible please send me some code example.
i shall be ever great ful to you for this.
Thanking you in advance.
Binnu
|
|
|
|
|
how do you make it so a string or some variable that changes whithin the program will be dislayed in a tooltip box?
-Raffi
|
|
|
|
|
Do you want tooltip to the controls?
Eugene Pustovoyt
|
|
|
|
|
Hi,
Does anyone here have a favorite algorithm and/or method for generating serial numbers for users on applications you have written? If so, I would be very appreciative if you would share them
I am on the verge of writing my first shareware application and would like to implement this feature.
Also if you have any other ways or methods I would greatly appreciate hearing them...(i.e. links to articles on web pages, links to algorithms or methods, etc...)
I am not looking for something CRACK proof but something just to make it look a little more professional, and have casual users register.
TIA for any answers.
Sam C
----
Systems Manager
Hospitality Marketing Associates
|
|
|
|
|
How can I retrieve the desktop patterns and wallpaper displayed in the control\display pane?
|
|
|
|
|
There is a DrawDesktop api call ( that might not be the name, but it's something *like* that ).
Christian
After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001
Sonork ID 100.10002:MeanManOzI live in Bob's HungOut now
|
|
|
|
|
This registry key has a list of all the patterns
HKEY_CURRENT_USER\Control Panel\Patterns
I cant figure out where it saves the current pattern
Nish
Sonork ID 100.9786 voidmain
www.busterboy.org
Nish is a BIG fan of Goran Ivanisevic
|
|
|
|
|