|
The default button is the button that is activated when you press [enter]
When you press tab, the button that got focus is actually made the default button. This continues till the focus goes to a control that's not a button. Then the original default button is again made default.
You can do that too from within your code
Nish
|
|
|
|
|
>> made the default button
is this BS_DEFBUSHBUTTON button style, or setDefID in the dialog, or both? Do I have to reset it, handle Button.KillFocus etc?
|
|
|
|
|
m_button.SetFocus();
DWORD original_default_id=SetDefID (IDC_BUTTON10);
That should do the trick.
By default you'll only get BN_CLICKED and BN_DOUBLECLICKED
If you wanta handle the KillFocus events you'll have to subclass it I guess....
Nish
|
|
|
|
|
Thanks Nish, works perfect!
|
|
|
|
|
Hi,
I am working on SDI Database application. I have a class CLibraryView inherited from the CRecordView. CLibraryView class has a formview dialog. I have inserted a CTabCtrl on the Form in the resource editor. OnInitialUpdate method of the CLibraryView I have updated the CTabCtrl to insert tabs.
// Insert First Tab
tci.pszText = "Issued Books";
((CTabCtrl *)GetDlgItem(IDC_TABMAIN))->InsertItem(0,&tci);
// Insert Second Tab
tci.pszText = "Library Books";
((CTabCtrl *)GetDlgItem(IDC_TABMAIN))->InsertItem(1,&tci);
// Insert Third Tab
tci.pszText = "Library Members";
((CTabCtrl *)GetDlgItem(IDC_TABMAIN))->InsertItem(2,&tci);
Now I want to insert the different layouts of CEdits & CButtons on different tabs. How can I do so? I mean each should have different layout. How to make it possible any idea in CRecordView scenario? I have an example in my book but it tells in simple CFrameWnd scenario where each stuff is created with Create member function.
Plz help......
Thanks for ur time .....
~Statbat( );
|
|
|
|
|
Hello Gurus,
I have small issue about on building DLL using MFC win32.
We have written, a DLL to call from ASP page by having the DLL instance
in ASP page to send the mail to a ID ( SMTP of the WinNT ).
When asked my system admin to register it to place in System32 folder, he
done.
But, is depended on following dlls
MFC42d.dll, MFCn42.dll, MFC042.dll, MSVCrtd.dll
How to include these required dll at compile time, so that I can give only
one DLL ?
Will solve my problem? Please give me suggestion?
Thank you inadvance.
--
SubbaReddy M
Sr programmer,
Frontlinesoft Ltd, Hyderabad, India
Ph: 91 40 3392147 (O)
SubbaReddy M
Sr programmer,
Frontlinesoft Ltd, Hyderabad, India
Ph: 91 40 3392147 (O)
|
|
|
|
|
First, if you don't want to distribute the VC and MFC dlls with your dll you have to link statically to MFC. Not sure about the VC dll though, although they're probably present on all machines (I think they are Win2K system DLLs).
Second, your dll depends on debug versions of the VC and MFC dlls. This is a no-no. You should distribute a release version of your dll, not a debug one. Actually, you're not allowed to distribute the debug versions of the MFC dlls (don't know about the VC ones) - but since you don't want to distribute any additional dlls I guess this is an academic question Anyway, distribute a release version of your dll, not a debug one.
Cheers
Steen.
"To claim that computer games influence children is rediculous. If Pacman had influenced children born in the 80'ies we would see a lot of youngsters running around in dark rooms eating pills while listening to monotonous music"
|
|
|
|
|
Help !!!!
I am trying to get some data out of a piece of equipement via our network, using windows sockets.
Does anybody have any code which shows very easily how to connect to a ip address + port and send and receive data from it.
I have tried the examples from MSDN and it only gets as far as the Bind() then fails.
Any ideas ?
Adrian
|
|
|
|
|
Hi
I've put some source code below.
It'snot complete...
But it should give you a start
Nish
CSocket s;
s.Create();
s.Connect("127.0.0.1",25);
CString buff;
buff="helo buster\r\n";
s.Send(buff,buff.GetLength());
char rbuff[128];
s.Receive(rbuff,64,0);
buff=rbuff;
s.Close();
|
|
|
|
|
|
VC++6 , W2k(sp2)
I created an MFC( Dynamic link ) DLL ,and I have put an ActiveX control on it.
When I Load the DLL and call the ActiveX's method i.e
"Play", then I am not able to access the window at all
( i.e cannot press any button ), because the window freezes.
Can someone please give me the solution
Thanks
Sanjay
|
|
|
|
|
Microsoft released a web based app to change some fine tune settings with ClearType in WindowsXP. The setting FontSmoothingGamma is found in HKEY_CURRENT_USER\Control Panel\Desktop which controls this setting. Microsofts web program only allows for 6 different setting, so I created an app that gives a little bit greater control over the settings. My problem is that once the settings have been changed I need to force an update to reflect the new settings. In Microsofts web app as soon as you hit apply the settings are changed. Any help in that direction would be great!
The Microsoft app can be found here
Joshua
|
|
|
|
|
I havent used XP yet
But you could try this....
SendNotifyMessage(HWND_BROADCAST,WM_SETTINGCHANGE,NULL,NULL)
Nish
|
|
|
|
|
Hey Nish, thanks for the reply. The WM_SETTINGCHANGED message did not do the trick, but I think it sent me in the right direction. Thanks for the help and let me know if you can think of anything else.
Joshua
|
|
|
|
|
I've been recently experimenting with threads and found that I got an error when i tried to pass a class member function as the Thread entry point (something about not converting void(void *) to void(__cdcl)(void *). I tried attaching the __cdcl (somethin like __cdcl anyway) to the function definition but it did not help. Is this possible and if not is there a way to have global functions access member variables (friend keyword??)?
- X
|
|
|
|
|
You cannot pass non-static functions as the thread proc.
But what you can do is to pass a pointer to your class's instance as the LPVOID parameter
Then you can cast the pointer to your class and use the members from the global function.
Nish
|
|
|
|
|
Thankyou greatly. A reply in 6 minutes. Who would have thought??
- X
|
|
|
|
|
That's Code Project for you
Nish
|
|
|
|
|
|
You can make the function as Static member of the class(instead of global class) and then pass it to thread function.
Deepak Khajuria
|
|
|
|
|
But then he wont be able to access the non-static members
Nish
|
|
|
|
|
Yes, he has to pass the instance of the class as parameter,or something similar.
But the main difference is that the static function of the class has full access to the class, where as global function cannot access the protected/private members.
Deepak Khajuria
|
|
|
|
|
He can always call the static functions of his class from his global function anyway. Thus he can also access all static members (via the static function, of course)
Nish
|
|
|
|
|
The static functions & global functions are same in sense that you do have instance of the class(this) in it. You need to get instance of the class from somewhere to call its non-static members.
But the main difference is that the static function of the class has access to the protected/private members of the object of same class.
This does not hold true for the global functions.(unless you make them friend)
So in a thread where you require direct access to class protected/private members, it is better to make thread function as static member of the class.
Deepak Khajuria
|
|
|
|
|
the MIME file of eml looks like this:
From: "Doug Sauder" <doug@example.com>
To: "Joe Blow" <jblow@example.com>
Subject: Test message from Microsoft Outlook 00
Date: Wed, 17 May 2000 19:42:10 -0400
Message-ID: <ndbbiakopkhfgplcodiggekfchaa.doug@example.com>
MIME-Version: 1.0
Content-Type: multipart/mixed;
boundary="----=_NextPart_000_0008_01BFC037.FDD8EE90"
X-Priority: 3 (Normal)
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0)
Importance: Normal
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300
This is a multi-part message in MIME format.
------=_NextPart_000_0008_01BFC037.FDD8EE90
Content-Type: multipart/alternative;
boundary="----=_NextPart_001_0009_01BFC037.FDD8EE90"
------=_NextPart_001_0009_01BFC037.FDD8EE90
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
All cows eat grass=20
=20
------=_NextPart_001_0009_01BFC037.FDD8EE90
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
All cows eat grass =
=20
------=_NextPart_001_0009_01BFC037.FDD8EE90--
------=_NextPart_000_0008_01BFC037.FDD8EE90
Content-Type: image/png;
name="greenball.png"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename="greenball.png"
iVBORw0KGgoAAAANSUhEUgAAABsAAAAbCAMAAAC6CgRnAAADAFBMVEX///8AAAAAEAAAGAAAIQAA
CAAAMQAAQgAAUgAAWgAASgAIYwAIcwAIewAQjAAIawAAOQAAYwAQlAAQnAAhpQAQpQAhrQBCvRhj
xjFjxjlSxiEpzgAYvQAQrQAYrQAhvQCU1mOt1nuE1lJK3hgh1gAYxgAYtQAAKQBCzhDO55Te563G
55SU52NS5yEh3gAYzgBS3iGc52vW75y974yE71JC7xCt73ul3nNa7ykh5wAY1gAx5wBS7yFr7zlK
7xgp5wAp7wAx7wAIhAAQtQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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V3bxn/XdhR/NYeeN0ggsLAAAACV0RVh0Q29tbWVudABj
bGlwMmdpZiB2LjAuNiBieSBZdmVzIFBpZ3VldDZzO7wAAAAASUVORK5CYII=
------=_NextPart_000_0008_01BFC037.FDD8EE90
Content-Type: image/png;
name="redball.png"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename="redball.png"
iVBORw0KGgoAAAANSUhEUgAAABsAAAAbCAMAAAC6CgRnAAADAFBMVEX///8AAAABAAALAAAVAAAa
AAAXAAARAAAKAAADAAAcAAAyAABEAABNAABIAAA9AAAjAAAWAAAmAABhAAB7AACGAACHAAB9AAB0
AABgAAA5AAAUAAAGAAAnAABLAABvAACQAAClAAC7AAC/AACrAAChAACMAABzAABbAAAuAAAIAABM
AAB3AACZAAC0GRnKODjVPT3bKSndBQW4AACoAAB5AAAxAAAYAAAEAABFAACaAAC7JCTRYWHfhITm
f3/mVlbqHx/SAAC5AACjAABdAABCAAAoAAAJAABnAAC6Dw/QVFTek5PlrKzpmZntZWXvJSXXAADB
AACxAACcAABtAABTAAA2AAAbAAAFAABKAACBAADLICDdZ2fonJzrpqbtiorvUVHvFBTRAADDAAC2
AAB4AABeAABAAAAiAABXAACSAADCAADaGxvoVVXseHjveHjvV1fvJibhAADOAAC3AACnAACVAABH
AAArAAAPAACdAADFAADhBQXrKCjvPDzvNTXvGxvjAADQAADJAAC1AACXAACEAABsAABPAAASAAAC
AABiAADpAADvAgLnAADYAADLAAC6AACwAABwAAATAAAkAABYAADIAADTAADNAACzAACDAABuAAAe
AAB+AADAAACkAACNAAB/AABpAABQAAAwAACRAACpAAC8AACqAACbAABlAABJAAAqAAAOAAA0AACs
AACvAACtAACmAACJAAB6AABrAABaAAA+AAApAABqAACCAACfAACeAACWAACPAAB8AAAZAAAHAABV
AACOAACKAAA4AAAQAAA/AAByAACAAABcAAA3AAAsAABmAABDAABWAAAgAAAzAAA8AAA6AAAfAAAM
AAAdAAANAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAD8LtlFAAAAAXRSTlMAQObYZgAAABZ0RVh0U29mdHdhcmUAZ2lmMnBuZyAyLjAu
MT1evmgAAAIISURBVHicY2CAg/8QwIABmJhZWFnZ2Dk4MaU5uLh5eHn5+LkFBDlQJf8zC/EIi4iK
iUtI8koJScsgyf5nlpWTV1BUUlZRVVPX4NFk1UJIyghp6+jq6RsYGhmbKJgK85mZW8Dk/rNaSlhZ
29ja2Ts4Ojkr6Li4urFDNf53N/Ow8vTy9vH18w8IDAoWDQkNC4+ASP5ni4wKio6JjYtPSExKTnFW
SE1LF4A69n9GZlZ2Tm5efkFhUXFySWlZlEd5RSVY7j+TkGRVdU1tXX1DY1Ozcktpa1t7h2YnOAj+
d7l1tyo79vT29SdNSJ44SbFVdHIo9xSIHNPUaWqTpifNSJrZnK00S0U1a/acUG5piNz/uXLzVJ2q
m6dXz584S2WB1cJFi5cshZr539xVftnyFKUVTi2TVjqvyhJLXb1m7TqoHPt6F/HW0g0bN63crGqV
tWXrtu07BJihcsw71+zanRW8Z89eq337RQ/Ip60xO3gIElX/LbikDm8T36KwbNmRo7O3zpHkPSZw
HBqL//8flz1x2OOkyKJTi7aqbzutfUZI2gIuF8F2lr/D5dw2+fZdwpl8YVOlI+CJ4/9/joOyYed5
QzMvhGqnm2V0WiClm///D0lfXHtJ6vLlK9w7rx7vQk5SQJbFtSms1y9evXid7QZacgOxmSxktNzd
tSwwU+J/VICaCPFIYU3XAJhIOtjf5sfyAAAAJXRFWHRDb21tZW50AGNsaXAyZ2lmIHYuMC42IGJ5
IFl2ZXMgUGlndWV0NnM7vAAAAABJRU5ErkJggg==
------=_NextPart_000_0008_01BFC037.FDD8EE90--
the question is :
Can you tell why the line "boundary="----=_NextPart_000_0008_01BFC037.FDD8EE90"
" is required.
and ------=_NextPart_000_0008_01BFC037.FDD8EE90--
???
any suggestions?
thanks in advance!
|
|
|
|