|
OnInitDialog() is called before the dialog is actually shown. In this function, use either SetWindowPos() or MoveWindow() to change the window position. In this way, when it is shown it will appear initially in the correct place.
I would strongly suggest that if this is a commonly used dialog you save and restore the window position; this way users can put it whereever they want it, and it will appear there initially from then on.
Sometimes i only remember, The days when i was young Nowadays no one remembers when they were young and stupid... ADEMA, The Way You Like It
|
|
|
|
|
Thanks.
MoveWindow(...) works great.
Now I just need to save the position in the registry.
Kuphryn
|
|
|
|
|
kuphryn wrote:
Now I just need to save the position in the registry.
May I ask you why do you want to do this?
Mazy
"The path you tread is narrow and the drop is shear and very high,
The ravens all are watching from a vantage point near by,
Apprehension creeping like a choo-train uo your spine,
Will the tightrope reach the end;will the final cuplet rhyme?"Cymbaline-Pink Floyd
|
|
|
|
|
Sure. Shog9 implied that the dialog box should at the last position before the user closes it. The only way to do that is to save its last position int he registry.
Kuphryn
|
|
|
|
|
I would like to know what this printprocessor means for PRINTER_INFO_2 while using Addprinter. Basically i am trying to add printer programmatically but i cannot succed. Any help is most appreciated.
Somu.l
|
|
|
|
|
I want to read from file ,line be line and after reading each line modify it and write modify string to file.I use this code:]
CStdioFile inFile;
inFile.Open(strpath , CFile::modeReadWrite | CFile::typeBinary);
char buf[80];
while(inFile.ReadString(buf,5))
{
CString outdatastring;
for (int i =0 ;i < 5; i++)
{
}
inFile.WriteString(outdatastring);
}
inFile.Close();
But I got this error after in run time:
Disk full while accessing F:\Doc\Change List - Beta2 to RTM.doc.
Any suggestion?
Mazy
"The path you tread is narrow and the drop is shear and very high,
The ravens all are watching from a vantage point near by,
Apprehension creeping like a choo-train uo your spine,
Will the tightrope reach the end;will the final cuplet rhyme?"Cymbaline-Pink Floyd
|
|
|
|
|
First question: you use CStdioFile, why do you open the file with the CFile::typeBinary parameter?????? Normally CStdioFiles are opened with CFile::typeText! If you need to read binary data you should use the normal CFile class. My suggestion: change CFile::typeBinary to CFile::typeText.
Second question: why is the char buf[80] 80 chars long and you use only 5 chars of it? My suggestion: read the COMPLETE string (can be much longer than 80 chars, so extend the size of buf) and then process only the first 5 chars. Thats much better. I don't know how ReadString reacts when it doesn't reach the end-of-line character and then is called again.
|
|
|
|
|
is there a notification message that will tell me when a dialog has finished initializing for the first time?
thank you
|
|
|
|
|
hi friend
wut u want??
for y u specify at first time????
WM_INITDIALOG is a message will post when a dialog initiates..
i think u aimed to do some trick with single instance...am i right??
Renjith
Hai Friends me from Pandalam..and i think there is a sofware behind everything...
so enjoy with the codes...
|
|
|
|
|
WM_INITDIALOG happens when the dialog is about to inialize. i have a function that i want to run after the dialog is inialized.
|
|
|
|
|
I"m not sure about this, but
BOOL m_bFirstPass;
CDialog:CDialog()
{
m_bFirstPass = FALSE;
}
CDialog::OnInitDialog()
{
m_bFirstPass = TRUE;
}
CDialog::OnActivate()
{
if(m_bFirstPass == TRUE)
m_bFirstPass = FALSE;
}
This might work!
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
Hi
We have a problem adding message handling functions for Non Dialog Controls in MFC with Visual C++ 7.0.
We cant find a way to do this the easy way. The Class Wizard which existed under 6.0 doesn't exist here, and thru the events in the properties of a class only menu and accelarator IDs are accessible. None of the Buttons from a Toolbar for example is available.
Thanks
Lars
|
|
|
|
|
Well, first of all, in most cases where you have toolbar buttons, you should also have a corresponding menu item, or at least an accelerator. In these cases, the Events property sheet will work. If you absolutely cannot have a menu or accelerator for your button, it is trivial to add the message map entry manually:
ON_COMMAND(Command ID of button, Handler function)
Sometimes i only remember, The days when i was young Nowadays no one remembers when they were young and stupid... ADEMA, The Way You Like It
|
|
|
|
|
Is there any way GDi objects can be trapped,ie Images of the application.At the operating system level,Probably Input output request packet(irp) form the gdi objects,but that would involve hooking the kernel....
Thanks for spending time...
Vineet Sharma
|
|
|
|
|
You can try API Capture. Someone just posted an article on this topic. With this technique you could trap all of the GDI calls from a particular app, change the calls, or just spy on them, it up to you.
Checkout my Guide to Win32 Paint for Intermediates
|
|
|
|
|
I know this is the C++ forum, however it was the suggestion of another to post this question here. Suppose someone were writing a "firewall" application that was "watching" or listening for activity over an incoming IP address, what is the best way to cover all ports. In all the examples I have read, someone creates an instance of TcpListener and supplies a port to listen to. Surely you don't have to do that for each of the 65,000+ ports. Could someone lead me in the right direction. I am going to do this in C#, Thanks in advance.
Nick Parker
|
|
|
|
|
OS only uses a predefined number of ports ..even there is more than 64000,like HTTP(80),FTP(21 i think...not sure ) such like...
Hai Friends me from Pandalam..and i think there is a sofware behind everything...
so enjoy with the codes...
|
|
|
|
|
Hi,
I use the htonl() fonction to convert an IP address from "host byte order" to "network byte order" but it does not work, or sometimes it work and sometimes not!!!.
here is the portion of code that i used to display the IP address :
in_addr addr;ip = htonl(ip);// ip is an u_long already initialized
addr.S_un.S_addr = ip;char* dst = inet_ntoa(addr);AfxMessageBox(dst);
what is going wrong ?
|
|
|
|
|
WSAStartup ?
|
|
|
|
|
hi friend
char szHostName[256];
char szIpAddress[256];
WSADATA wsaData;
HOSTENT *pHP;
SOCKADDR_IN myaddr;
myaddr.sin_family = AF_INET;
if (InitialiseSocket(wsaData))
{
gethostname(szHostName,256);
pHP = gethostbyname(szHostName);
memcpy((char FAR *)&(myaddr.sin_addr), pHP->h_addr,pHP->h_length);
wsprintf(szIpAddress,"%d.%d.%d.%d",myaddr.sin_addr.S_un.S_un_b.s_b1,myaddr.sin_addr.S_un.S_un_b.s_b2,myaddr.sin_addr.S_un.S_un_b.s_b3,myaddr.sin_addr.S_un.S_un_b.s_b4);
WSACleanup();
}
i t will solve ur problem..it is easy & cool ....
u will get the IP address in szIpAddress Buffer
try it now..!!
Renjith
Hai Friends me from Pandalam..and i think there is a sofware behind everything...
so enjoy with the codes...
|
|
|
|
|
The snipit of program below should create a table 25*25 with the alphabet in each row(in theory i think.
Dose any body know how i can use that table? i basically want to compare a word entered with that table. But cant seem to do this.
Any code will be very helpful
void CFinal3Dlg::OnBeta()
{
radio_select=2;
//create table
for (row= 0; row<=25; row++)
{
ch='A'+row;
for (col=0; col<=25 ; col++)
{
ch++;
if (ch>'z') ch = 'A';
}
}
// compare entered data with table
{
****
|
|
|
|
|
How do you want to compare a word ? This sounds like a solution looking for a problem to me.
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
"I'm somewhat suspicious of STL though. My (test,experimental) program worked first time. Whats that all about??!?!
- Jon Hulatt, 22/3/2002
|
|
|
|
|
if you want to compare words you can use strcmp for char type. if you are using cstrings, they have a compare function built-in. note though they are case sensitive.
|
|
|
|
|
Hi there,
I wrote program by VC++ 6.0 on WinXP, and i made the setup disk by InstallShield ...
InstallShield added MFC42.DLL and MSVCRT.DLL to setup project !
When i run the setup disk on Win98SE, Win98SE crashes !!!
And Win98SE shows me error about MSVCRT.DLL error and something about NTDLL.DLL
(Now, i have to re-install Win98)
Hmmm, well i have reply for myself, WinXP is NT based and Win98 is not !
and the MSVCRT.DLL in WinXP is the main reason !
In fact i need the Setup disk for Win2000 Pro ...
I wanna know, Is there any problem later, If i run my setup program on this OS ?
By the way, what is exactly MSVCRT.DLL ?
Please reply about my main question that was about running the setup disk on Win2000 ...
And if you have time, please write some points about making setup disks ...
Thank you very much !
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
Hadi_Rezaie wrote:
By the way, what is exactly MSVCRT.DLL ?
It's the C Runtime. You need, I believe, to install a different one for 9x and for NT based OS's.
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
"I'm somewhat suspicious of STL though. My (test,experimental) program worked first time. Whats that all about??!?!
- Jon Hulatt, 22/3/2002
|
|
|
|