|
Just drag and drop Tab Control from ToolBox to your dialog.Attach a control variable to it and proceed to work.
-@SuDhIrKuMaR@-
|
|
|
|
|
how will change view on click on tab button
|
|
|
|
|
TCN_SELCHANGE Notification ()
Notifies a tab control's parent window that the currently selected tab has changed. This message is sent in the form of a WM_NOTIFY message.
-@SuDhIrKuMaR@-
|
|
|
|
|
The best way to use tab controls is to create your views on the fly depending on which tab is used. You can then create each view depending on the tab that was clicked. To show the views you can create them and move them to be the size of a static control you place in the tab control (I usually place a picture holder). Look at CWnd::Create() and CWnd::MoveWindow(). Remember, the Rectangle for the MoveWindow contains the dimensions of your static control.
|
|
|
|
|
can someone pls tel me how, i can read DATE and TIME field from MDB and display them into a List box. I can get string var displayed but not float var.
recset.Open(AFX_DAO_USE_DEFAULT_TYPE,"SELECT * FROM Bookings WHERE BookingDate = DATE()",NULL);
while(!recset.IsEOF()) // Do until EOF
{
int i = 0;
recset.GetFieldValue("Booking",Bookings);
Bookings = (LPCSTR)var.pbstrVal;
m_ShowBookings.SetItemText(0,1,Bookings);
i = i++;
recset.MoveNext();
}
recset.Close();
thank you
Gpat
|
|
|
|
|
Hi all,
I m using SDI type splitter application i want it is always show as maximize.
so i m using ShowWindow(SW_MAXIMIZE); in InitInstance() of .cpp file of application.
and in CMainFrame class in PreCreateWindow (CREATESTRUCT& cs)
function use this code.
cs.style = WS_OVERLAPPED|WS_SYSMENU |WS_MINIMIZEBOX|WS_BORDER;
return CFrameWnd::PreCreateWindow(cs);
Using of all, these the window is initially maximize,or the Maximize or Restore button is disabled but on double clicking on titlebor it is minimized.
How can disable the function of double clicking on Title bar.
Thanks in advance.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
Just Use this code.
BOOL CMainFrame::PreTranslateMessage(MSG* pMsg)
{
if (pMsg->message == WM_NCLBUTTONDBLCLK)
return TRUE; // message handled or ignored
return CFrameWnd::PreTranslateMessage(pMsg);
}
-@SuDhIrKuMaR@-
|
|
|
|
|
Just add this to your PreCreateWindow (instead of what you show)
cs.style &= ~(WS_THICKFRAME | WS_MAXIMIZEBOX);
Hope that helps.
Karl - WK5M
PP-ASEL-IA (N43CS)
PGP Key: 0xDB02E193
PGP Key Fingerprint: 8F06 5A2E 2735 892B 821C 871A 0411 94EA DB02 E193
|
|
|
|
|
Hi all,
please tell me how can i m using print preview for SDI type splitter application.
How can i get print preview without Doc/View architecture for this type of application.
Please tell me .
Thanks in advance.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
void CTestForm::OnLvnKeydownList(NMHDR *pNMHDR, LRESULT *pResult)
{
LPNMLVKEYDOWN pLVKeyDow = reinterpret_cast<LPNMLVKEYDOWN>(pNMHDR);
NMLVKEYDOWN* nmkd = (NMLVKEYDOWN*)pNMHDR;
switch(nmkd->wVKey)
{
case VK_SPACE:
int nIndex = GetNextItem(-1, LVNI_SELECTED);
CString strItem = GetItemText(nIndex, 0);
MessageBox("Test");
}
*pResult = 0;
}
i m using this function in FormView derived class and CDialog base class.
Here i m using a list and using this code for Space key fuction on the list.
This code is working fine for Dialog box but gives error"
Unhandled exception at 0x5d0f0892 in Demo.exe: 0xC0000094: Integer division by zero." for Formview please tell me any suggestion.
I m waiting for your valuable suggestions.
Thanks in advance.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
Use your debugger to see more in details what's happening there. Put breakpoints and inspect the values of the different variables.
|
|
|
|
|
i need some help to scale a 60*60 binary image to 100*100 binary image.
it is urgent.
shafaeat
|
|
|
|
|
Use GDI+ Bitmap::GetThumbnailImage()
|
|
|
|
|
|
Hint: there is a small link below my signature.
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 all,
[1]Having some 5 Client which are EXEs. And these 5 Clients need to communicate with a single Server which again is an EXE. All the clients and the single server are on same machine.
[2]Clients can send some data to Server which server should store internally.
[3]Clients can request some data which server should return.
[4]Clients need result of executing some procedure and this procedure is in server.
[5]Server need to keep track of all the client processes.
Have gone through various mechanism like :
[1]RPC which is robust but requires more work.
[2]Named pipes
[3]WM_COPYDATA
Suggestion is required regarding which IPC mechanism should be used to achive all the above listed requirements. And roughly how much effort needs to be invested.
Thanks.
|
|
|
|
|
Are the 5 Clients are instances of same client EXE.
-@SuDhIrKuMaR@-
|
|
|
|
|
No. They can be of different application.
|
|
|
|
|
If they are different applications then you can use WM_COPYDATA.It is very easy to use.
-@SuDhIrKuMaR@-
|
|
|
|
|
I have written software with your requirements, except that it could run on multiple networked machines. The approach I took was Named Pipes. I wrote a Generic Server, and a Generic Client, and, in effect, an RPC Procedure. In effect a 'SendMessage' procedure on the Client side, which gathered and wrapped all the Calling Info, created a Header, indicating where in the package each item resides, and, send it over the pipe. On the Server Side, you wait for the message, unwrap it, and present it to the function. For this to work, I created a MessageMap type of structure. For it to work better, Server and Client had only the Basic Bones in the Message Map for initial communication. At startup of the Client, it sends it's message map to the server, which the server registers.
When you have this Generic Server/Client system written, you make each app both a server and a client. Be sure though to make plenty of use of Synchronisation Objects.
N.B. The efford is always substantial, whatever route you take. I took this way because:
1. I considered RPC an overkill, and yet something else I had to learn and which Bill Gates could change on a whim.
2. Fully Debuggable, Very Few System calls you cannot debug into
Regards
Regards,
Bram van Kampen
|
|
|
|
|
My program needs to download a file off the internet to get some information needed to continue. It does not need to save the information, just needs to read it once for the next step.
I have tried
CString TempFile;
URLDownloadToCacheFile(NULL, _T("http://validurl/script.cfm?key=value"), TempFile.GetBufferSetLength(MAX_PATH), MAX_PATH, validcallback);
Once those lines run, TempFile gets filled with a valid path to a temporary file, but the file doesn't actually exist - therefore I can't open it. The following code is what I'm using now, and it works. But I don't like it because it has a hard-coded temporary filename (therefore multiple instances may conflict).
CString TempFile;
TempFile.GetEnvironmentVariable(_(T"TEMP"));
TempFile.Appened(_T("\\MyProg.tmp"));
URLDownloadToFile(NULL, _T("sameurlasabove"), TempFile, validcallback);
After those lines run, the file is created and contains the needed information. But again, it uses a hardcoded temp file, therefore multiple instances cannot run.
So now for the questions:
First of all, is URLDownloadToCacheFile failing because it's a text file generated by a script, and not a binary data file (like a jpg), therefore it doesn't cache it?
Second, what is more practical in this situation. Would you implement code to generate a "random" temporary filename that's not in use? Or should I write code that can read the file right off the internet without saving it to disk first? I don't want to shoot a fly with a cannon, but I'm not sure which is the cannon.
|
|
|
|
|
"The security attributes for the handle to the new thread. These security attributes include an inheritance flag that determines whether the handle can be inherited by child processes."
Can any 1 help me understand this?
|
|
|
|
|
Without context, I wasn't sure what you were talking about. Googling your statement, reveals that this is part of "CreateThread".
Is that what you are asking about?
It sounds like you can pass security rights to a thread and give it the same rights you have acquired somewhere else?
From: http://msdn.microsoft.com/en-us/library/ms682453(VS.85).aspx[^]
HANDLE WINAPI CreateThread(
__in_opt LPSECURITY_ATTRIBUTES lpThreadAttributes,
__in SIZE_T dwStackSize,
__in LPTHREAD_START_ROUTINE lpStartAddress,
__in_opt LPVOID lpParameter,
__in DWORD dwCreationFlags,
__out_opt LPDWORD lpThreadId
);
lpThreadAttributes [in, optional]
A pointer to a SECURITY_ATTRIBUTES structure that determines whether the returned handle can be inherited by child processes. If lpThreadAttributes is NULL, the handle cannot be inherited.
The lpSecurityDescriptor member of the structure specifies a security descriptor for the new thread. If lpThreadAttributes is NULL, the thread gets a default security descriptor. The ACLs in the default security descriptor for a thread come from the primary token of the creator.
Windows XP/2000: The ACLs in the default security descriptor for a thread come from the primary or impersonation token of the creator. This behavior changed with Windows XP SP2 and Windows Server 2003. For more information, see Remarks
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
Peter Weyzen<br />
Staff Engineer<br />
<a href="http://www.soonr.com">SoonR Inc -- PC Power delivered to your phone</a>
|
|
|
|
|
just use NULL. if you don't understand that you don't need to worry about security. your threads will be fine
|
|
|
|
|
Hi,
I'm a bit desperate... so I'll do the old Police thing ... S.O.S
We work on an application that has been up and running for several years now - MFC based, links with Stingray. Until recently, CCheckListBoxes worked nice and easy. A new version is about to be released and we just realized that these "@!*!# check listboxes were not displaying strings in release mode running on WindowsXP, when the display is in "Windows 2000 (classic)" theme. The string ARE there, we just can't see them.
In between versions we have split up our app into 4 dll's.. but I still don't get it, it's basically the same code....
Any help, idea or creative suggestion to commit suicide is very much welcome....
Thanks
PS. I built a small test dialog application, and it works. Seems to be a bit more complicated...
|
|
|
|