|
After Mike you could to find this secret,Cedric!
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
Hi,
I Have created 3 dialog boxes in my application, i want to move 3 dialog boxes using back and next.. with out loosing the dialog box selection state..
Can any one help me regarding this..?
Thanks in advance...
|
|
|
|
|
That would be called a wizard.
Do a search for Property Page, Property Sheet, or for MCF, CPropertyPage / CPropertySheet.
Good luck,
Iain.
Codeproject MVP for C++, I can't believe it's for my lounge posts...
|
|
|
|
|
Hi,
Thanks for your help on this.., i don't want tabs in single dialog. Below i am explaining my scenario:
1. I have two dialog boxes, have two buttons on each dialog, and have to move (shuffle) from one dialog to other..
Can you please explain how i have to achieve this..?
Thanks in advance
|
|
|
|
|
John502 wrote: i don't want tabs...
There aren't any tabs with a "wizard."
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Tabs, Property Pages and Wizards[^].
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
Hi,
Thanks for your help on this.., i don't want tabs in single dialog. Below i am explaining my scenario:
1. I have two dialog boxes, have two buttons on each dialog, and have to move (shuffle) from one dialog to other..
Can you please explain how i have to achieve this..?
Thanks in advance.
|
|
|
|
|
May be SetWindowPos() can help? You can make use of the "insert-after" parameter.
Thought it was "back-n-forth".
He never answers anyone who replies to him. I've taken to calling him a retard, which is not fair to retards everywhere.-Christian Graus
modified on Wednesday, March 4, 2009 6:03 AM
|
|
|
|
|
Hi,
Thanks for your help on this.., i don't want tabs in single dialog. Below i am explaining my scenario:
1. I have two dialog boxes, have two buttons on each dialog, and have to move (shuffle) from one dialog to other..
Can you please explain how i have to achieve this..
Thanks in advance
|
|
|
|
|
Then you can use SetWindowPos. First of all you need to create them as "Modaless" dialogs. Which can be created using "Create" call rather than using "DoModal". Then you can simply call SetWidowPos and pass the other CDialog's pointer as the first parameter. It gets shuffled by that. You need to do it vice-versa in the other dialog. So that it works both ways.
He never answers anyone who replies to him. I've taken to calling him a retard, which is not fair to retards everywhere.-Christian Graus
|
|
|
|
|
Hi...
How to get system ip address in C++ or Mfc?
Please can anyone help..?
THank you.
G.Paulraj
|
|
|
|
|
This is a bigger question than it looks.
I have a loopback address, my ethernet adapter has two addresses (don't ask), and my wifi adapter has one address (though not currently active).
Go to a command prompt, and type:
ipconfig /all
and see all the information you can shake a stick at.
Then do a search for GetIpAddrTable in MSDN, and that will show you a bunch of functions to interogate windows about network information.
Now, get scared and look for articles on codeproject (which you should have done first)
http://www.codeproject.com/KB/IP/[^]
http://www.codeproject.com/KB/IP/getipnr.aspx[^] looks pretty perfect for you.
Enjoy, and learn,
Iain.
Codeproject MVP for C++, I can't believe it's for my lounge posts...
|
|
|
|
|
Thank you so much for your reply.
G.Paulraj
|
|
|
|
|
#include <afxwin.h>
#include <afxsock.h>
:::::::::::
:::::::::::
char* CLogger::GetIPAdd()
{
WORD wVersionRequested;
WSADATA wsaData;
char Name[255];
PHOSTENT HostInfo;
wVersionRequested = MAKEWORD( 1, 1 );
char *IPAdd;
if ( WSAStartup( wVersionRequested, &wsaData ) == 0 )
{
if( gethostname ( Name, sizeof(Name)) == 0)
{
if((HostInfo = gethostbyname(Name)) != NULL)
{
int nCount = 0;
while(HostInfo->h_addr_list[nCount])
{
IPAdd = inet_ntoa(*(struct in_addr *)HostInfo->h_addr_list[nCount]);
++nCount;
}
}
}
}
return IPAdd;
}
|
|
|
|
|
You might want to reply to the person asking the question...
Iain.
Codeproject MVP for C++, I can't believe it's for my lounge posts...
|
|
|
|
|
#include <windows.h>
#include <tchar.h>
#include <stdio.h>
int _tmain(
int argc,
TCHAR *argv[]
)
{
DCB dcb;
HANDLE hCom;
BOOL fSuccess;
TCHAR *pcCommPort = TEXT("COM2");
hCom = CreateFile( pcCommPort,
GENERIC_READ | GENERIC_WRITE,
0,
NULL,
OPEN_EXISTING,
0,
NULL
);
if (hCom == INVALID_HANDLE_VALUE)
{
printf ("CreateFile failed with error %d.\n", GetLastError());
return (1);
}
:::::::::::::::::::::
:::::::::::::::::::::
return (0);
}
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Now you're just doing that on purpose!
Iain.
Codeproject MVP for C++, I can't believe it's for my lounge posts...
|
|
|
|
|
In a bad mood today?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Now where's that :hulk: emoticon...
Iain.
Codeproject MVP for C++, I can't believe it's for my lounge posts...
|
|
|
|
|
:pizza: and :'extra vergine' olive oil: for you.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
I trust you've added yourself to the THHB? If not, do so IMMEDIATELY!
Iain.
Codeproject MVP for C++, I can't believe it's for my lounge posts...
|
|
|
|
|
Here[^]
He never answers anyone who replies to him. I've taken to calling him a retard, which is not fair to retards everywhere.-Christian Graus
|
|
|
|
|
See also here [^].
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Hi
My Application CPU use very high.I ahve a globlem function and these function i am calling in InitDialog.
void ThreadRoute1( void* arg )
{
try{
USES_CONVERSION;
HANDLE hDir = CreateFile( CString("C:\\"),
FILE_LIST_DIRECTORY,
FILE_SHARE_READ|FILE_SHARE_DELETE,
NULL,
OPEN_EXISTING,
FILE_FLAG_BACKUP_SEMANTICS,
NULL
);
FILE_NOTIFY_INFORMATION Buffer[1024];
DWORD BytesReturned;
while( ReadDirectoryChangesW(
hDir,
&Buffer,
sizeof(Buffer),
TRUE,
FILE_NOTIFY_CHANGE_SECURITY|
FILE_NOTIFY_CHANGE_CREATION|
FILE_NOTIFY_CHANGE_LAST_ACCESS|
FILE_NOTIFY_CHANGE_LAST_WRITE|
FILE_NOTIFY_CHANGE_SIZE|
FILE_NOTIFY_CHANGE_ATTRIBUTES|
FILE_NOTIFY_CHANGE_DIR_NAME|
FILE_NOTIFY_CHANGE_FILE_NAME,
&BytesReturned,
NULL,
NULL
))
{
CTime tm = CTime::GetCurrentTime();
CString helper_txt;
switch(Buffer[0].Action)
{
case FILE_ACTION_ADDED: helper_txt = "The file was added to the directory"; break;
case FILE_ACTION_REMOVED: helper_txt = "The file was removed from the directory"; break;
case FILE_ACTION_MODIFIED: helper_txt = "The file was modified. This can be a change in the time stamp or attributes."; break;
case FILE_ACTION_RENAMED_OLD_NAME: helper_txt = "The file was renamed and this is the old name."; break;
case FILE_ACTION_RENAMED_NEW_NAME: helper_txt = "The file was renamed and this is the new name."; break;
}
int i=0;
do
{
CString(Buffer[i].FileName);
CString ad="C:\\";
CString adl= "C:\\";
ad +=CString(Buffer[i].FileName).Left(Buffer[i].FileNameLength / 2);
CString spath1 = tr;
int nLen = spath1.GetLength();
LPCSTR lpszBuf = spath1.GetBuffer(nLen);
spath1.ReleaseBuffer();
And Calling in
InitDialog()
{
_beginthread( ThreadRoute, 0, (void*)new Param(FILE_NOTIFY_CHANGE_FILE_NAME, CString("FILE_NOTIFY_CHANGE_FILE_NAME") ) );
}
Every things is working fine.How cani i remove CPU Uses problem .
Plz help me
|
|
|
|
|
Probably one of your while loops is a runaway...try breaking the execution of your program (debug) when it is eating the CPU and see what your thread is doing.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|