|
If I understand your question correctly, then...
The TLS *index* ("slot" location) is a process-wide global variable. The value that is stored in the TLS (slot) location referenced by the index is Thread-specific.
-=- James.
|
|
|
|
|
- Thanks pal!
- Your reply clarifies my doubts.
- Have a nice weekend,
Maer
|
|
|
|
|
I constructed a resizeable dialog and of course put a class behind it. I want to create an instance of this class and then do several DoModals on it. This means I want to open the Dialog and then close it several times. Because the window can be resized and repositioned I want to store this data and set it back when the dialog opens again. I tried it with Get/SetWindowPosition(), but if I do the SetWindowPosition() in OnInitDialog() and the window was maximized before, the window is drawn two times. The first time it is in its initial size and the second time in the correct stored size. So when the window is opened it is flickering. Has anybody an idea how to restore the old window size after the dialog is opened again without drawing it twice?
Thank you very much!
|
|
|
|
|
Good idea.
Sorry to dissapoint you all with my lack of a witty or poignant signature.
|
|
|
|
|
What's a good idea?
Nish
|
|
|
|
|
Bla?
What's that mean?
Nish
|
|
|
|
|
Sorry, I hit the submit button instaed of the preview button...
I just edited the posting...
KHB.
|
|
|
|
|
Use the PreCreateWindow virtual function in your dialog class. Modify CREATESTRUCT& cs to contain your desired window size, and Bob's your Uncle.
Sorry to dissapoint you all with my lack of a witty or poignant signature.
|
|
|
|
|
How do I set focus & "thick border" to a button, as If the user had Tabbed to it?
SetFocus only sets the focus (dotted rectangle). The "Default-Like" state remains at the original button.
I guess SetDefID to set the default button is the wrong way, since the default button is by default preserved when I tab away from the buttons (e.g. to an edit)
TIA
Peter
|
|
|
|
|
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
|
|
|
|