|
|
Hi,
Thanks for the reply.
I have the toolbar data in my application which is generally stored in the Registry.I want to store the Docking and floating information of the tool bars to be stored in the xml file rather than the registry and when i try to start my application it should be able to load that info from the xml file.Usually CDockState is a an MFC class which is used to store the info reg the docking and floating of the toolbar to the registry.
Swarna
|
|
|
|
|
Hello guys!
Need your help again on these:
1. How to disable the input focus of a listbox control in a dialog box.
2. What message is sent to the main dialog box when its listbox control is about to receive an input focus?
Thanks!
|
|
|
|
|
Check out the WM_SETFOCUS message.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
I am trying to receive the TV remote signal using the ipaq 3115.
The IR port on the pocket pc is Port 3. Its opened and configured. No errors there.
I constantly poll the port for any data. But I am getting none.
Here's my code -
BYTE rx;
int rcd[30];
int i=0;
DWORD dwbytesTransferred=0;
long one;
while(1)
{
one = ReadFile(m_irport, &rx, 1, &dwbytesTransferred, NULL);
if (dwbytesTransferred > 0)
{
rcd[i]=rx;
m_rcv="Data In";
UpdateData(FALSE);
i++;
}
else
{
m_rcv="No Data";
UpdateData(FALSE);
}
}
Any help would be greatly appreciated. Thanks.
-hithesh
|
|
|
|
|
Hi,
Could anyone help me to parse HL7 Messages
Be simple and Be sample.
|
|
|
|
|
hi all
i wrote the following function to append one project's accelerators to another because i thought there was no function doing that. but it has a problem, +10 (something more than 2) is required. why?
status appendAcceleratorsTable(HACCEL &hAccel,LPCTSTR lpszResourceName)<br />
{<br />
HINSTANCE hInst=AfxFindResourceHandle(lpszResourceName,RT_ACCELERATOR);<br />
ASSERT(hInst);<br />
HACCEL hNewAccel=LoadAccelerators(hInst,lpszResourceName);<br />
ASSERT(hNewAccel);<br />
<br />
int numAccel=CopyAcceleratorTable(hAccel,NULL,NP);<br />
int numNewAccel=CopyAcceleratorTable(hNewAccel,NULL,NP);<br />
<br />
LPACCEL lpAccel=(LPACCEL)GlobalAlloc(GPTR,(numAccel+numNewAccel+10)*sizeof(ACCEL));<br />
ASSERT(!lpAccel);<br />
<br />
VERIFY(CopyAcceleratorTable(hAccel,lpAccel,numAccel)==numAccel);<br />
VERIFY(CopyAcceleratorTable(hNewAccel,lpAccel+numAccel,numNewAccel)==numNewAccel);<br />
<br />
DestroyAcceleratorTable(hNewAccel);<br />
hNewAccel=CreateAcceleratorTable(lpAccel,numAccel+numNewAccel);<br />
ASSERT(hNewAccel);<br />
VERIFY(CopyAcceleratorTable(hNewAccel,NULL,NP)==numAccel+numNewAccel);<br />
DestroyAcceleratorTable(hAccel);<br />
hAccel=hNewAccel;<br />
}<br />
|
|
|
|
|
I'm interested in doing some work with Assembly. Does anyone know any good resources on the web for learning Win32 assembly from start to finish (coding to compiling)?
Additionally, I have a dll module that I want to decompile, modify, and recompile. Does anyone know how to do this, or know of resource through which to do it? (This is a module that I will NOT be redistributing, it's for my own tinkering pleasure)
Thanks for the help. Sorry if this is OT.
-- Adam
"If you can't beat your computer in chess, try kickboxing"
|
|
|
|
|
|
Arsalan Malik wrote:
Download PDF[^]
Interesting link; thanks for posting it.
-------------------------------
|
|
|
|
|
I am new to vc++. i have a function which on execution is throwing garbage value. Can someone tell me when a vc++ function throws a garbage value. Thanx in adv
|
|
|
|
|
Hi!
Can you elaborate on your function details?
It's much better if you could post your function definition (function body).
|
|
|
|
|
nitin_ten wrote:
i have a function which on execution is throwing garbage value.
This makes no sense at all. Technically speaking, exceptions are thrown. Please provide a code snippet of what you are trying to do, the value(s) that you are getting, and the value(s) you want instead. Provide as much pertinent details as necessary.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
I see in class CxxxDoc variable m_viewList, but where does this variable declare ?
Thank you
|
|
|
|
|
this variable is afxwin.h file in CDocument class on line number 4855. This is a list of pointers to the views that the document have.
http://www.priyank.in/
|
|
|
|
|
When I run my project that is MSDN example chatsrvr, I give this error :
--------------------Configuration: ChatSrvr - Win32 Unicode Debug--------------------
Linking...
LINK : fatal error LNK1104: cannot open file "mfc42ud.lib"
Error executing link.exe.
chatsrvr.exe - 1 error(s), 0 warning(s)
Please tell me what error is cannot open file "mfc42ud.lib"
Thanks in advance
|
|
|
|
|
|
Am about to embark on the process of upgrading our companies development systems from VC 6.0 to Visual Studio .Net C++. Am a bit confused why .Net C++ is only $110 a copy from MS, but .Net Professional is $700. Other than support for C# etc, are there any significant differences? Has anybody else had problems with such a change-over?
|
|
|
|
|
Since you already use Visual Studio v6, you can upgrade to Visual Studio .NET 2003 Professional for $550. It also comes with Visual Basic .NET and J#, if you need those. You get Windows Server 2003 Standard Edition. You get SQL Server 2000 Developer Edition. You get Microsoft Visual Studio Tools for Microsoft Office.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
Hello. Does anyone know how to code a Auto-Entry CDataCombo. CDataCombo is an Active X control. I created a auto-completing CCombobox and made my CDataCombo inherit from it. However, it does not behave the same way. For example when I invoke ShowDropDown(), my CDataCombo does not respond. Any thoughts, please help.
Roshan Haridas
Software Programmer
Exeltech
|
|
|
|
|
If the constant MECHANICAL was defined in the main class, I remove a menu item in InitInstance(). Now at the start of the application, the menu does get deleted. But when I go to File->New, the deleted menu reappears. How do I stop it from re-appearing? Thanks!
//MainApp
#define MECHANICAL
//In main app in function InitInstance()
#ifdef MECHANICAL
pMainFrame->OnChangeFileMenu();
#endif
void CMainFrame::OnChangeFileMenu()
{
CWnd* pMain = AfxGetMainWnd();
// Get the menu from the application window.
CMenu* mmenu = pMain->GetMenu();
// Look for "Tools" menu.
int pos = FindMenuItem(mmenu, &Tools");
if (pos > -1)
mmenu->DeleteMenu(pos, MF_BYPOSITION);
pMain->DrawMenuBar();
}
int CMainFrame::FindMenuItem(CMenu *menu, LPCTSTR menustr)
{
ASSERT(menu);
ASSERT(::IsMenu(menu->GetSafeHmenu()));
int count = menu->GetMenuItemCount();
for (int i = 0; i < count; i++)
{
CString str;
if (menu->GetMenuString(i, str, MF_BYPOSITION) &&
(strcmp(str, menustr) == 0))
return i;
}
return -1;
}
|
|
|
|
|
What am I trying to do....
Using VC++ 6 and MFC
The application does several things. It receives 3 threads of information via a TCP/IP connection. It also monitors a directory for new files. All of the data is processed and logged as it is received. A worker thread handles the multiple threads.
A dialog box interface will be used to display a summary of the information. The dialog needs to be a property sheet (tab dialog) with a summary page listing all data from all sources. The other tabs are more detailed breakdowns of each type of data.
My problem is...
So far, I have been using a list control on each tab for the data display. However, I can't figure out how to get the data to display in the list.
If I create a list box on the main dialog, I can use AddString or InsertItem just fine. But when I try to do the same with my property pages it doesn't work.
Please help.
<br />
#include "stdafx.h"<br />
#include "tryproppage.h"<br />
#include "tryproppageDlg.h"<br />
#include "MyPage1.h"<br />
#include "MyPage2.h"<br />
<br />
HWND hwndTPPDlg;<br />
<br />
<br />
CTryproppageDlg::CTryproppageDlg(CWnd* pParent )<br />
: CDialog(CTryproppageDlg::IDD, pParent)<br />
{<br />
m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);<br />
}<br />
void CTryproppageDlg:oDataExchange(CDataExchange* pDX)<br />
{<br />
CDialog:oDataExchange(pDX);<br />
}<br />
BEGIN_MESSAGE_MAP(CTryproppageDlg, CDialog)<br />
END_MESSAGE_MAP()<br />
<br />
<br />
BOOL CTryproppageDlg::OnInitDialog()<br />
{<br />
CDialog::OnInitDialog();<br />
<br />
static CPropertySheet myPropSheet;<br />
static CMyPage1 myPage1;<br />
static CMyPage2 myPage2;<br />
myPropSheet.AddPage(&myPage1);<br />
myPropSheet.AddPage(&myPage2);myPropSheet.Create();<br />
myPage1.m_listctrl1.InsertItem(0,"stuff");<br />
return TRUE;
}<br />
_________________________________________________________________<br />
<br />
<br />
#include "stdafx.h"<br />
#include "tryproppage.h"<br />
#include "tryproppageDlg.h"<br />
<br />
<br />
BEGIN_MESSAGE_MAP(CTryproppageApp, CWinApp)<br />
ON_COMMAND(ID_HELP, CWinApp::OnHelp)<br />
END_MESSAGE_MAP()<br />
<br />
CTryproppageApp::CTryproppageApp()<br />
{<br />
}<br />
CTryproppageApp theApp;<br />
BOOL CTryproppageApp::InitInstance()<br />
AfxEnableControlContainer();<br />
<br />
CTryproppageDlg dlg;<br />
m_pMainWnd = &dlg;<br />
int nResponse = dlg.DoModal();<br />
if (nResponse == IDOK)<br />
{<br />
}<br />
else if (nResponse == IDCANCEL)<br />
{<br />
}<br />
return FALSE;<br />
}<br />
<br />
<br />
_________________________________________________________________<br />
<br />
#include "stdafx.h"<br />
#include "tryproppage.h"<br />
#include "MyPage1.h"<br />
<br />
<br />
IMPLEMENT_DYNCREATE(CMyPage1, CPropertyPage)<br />
<br />
CMyPage1::CMyPage1() : CPropertyPage(CMyPage1::IDD)<br />
{<br />
}<br />
<br />
CMyPage1::~CMyPage1()<br />
{<br />
}<br />
<br />
void CMyPage1:oDataExchange(CDataExchange* pDX)<br />
{<br />
CPropertyPage:oDataExchange(pDX);<br />
DDX_Control(pDX, IDC_LIST_CTRL1, m_listctrl1);<br />
}<br />
<br />
<br />
BEGIN_MESSAGE_MAP(CMyPage1, CPropertyPage)<br />
ON_BN_CLICKED(IDC_BUTTON1, OnButton1)<br />
END_MESSAGE_MAP()<br />
<br />
<br />
BOOL CMyPage1::OnInitDialog() <br />
{<br />
CPropertyPage::OnInitDialog();<br />
return TRUE; <br />
}<br />
<br />
_________________________________________________________________<br />
<br />
<br />
class CMyPage1 : public CPropertyPage<br />
{<br />
DECLARE_DYNCREATE(CMyPage1)<br />
<br />
public:<br />
CMyPage1();<br />
~CMyPage1();<br />
<br />
enum { IDD = IDD_PAGE1 };<br />
CListCtrl m_listctrl1;<br />
<br />
<br />
protected:<br />
virtual void DoDataExchange(CDataExchange* pDX);
<br />
protected:<br />
virtual BOOL OnInitDialog();<br />
DECLARE_MESSAGE_MAP()<br />
<br />
};<br />
<br />
MyPage2 is identical to MyPage1
|
|
|
|
|
realius wrote:
BOOL CTryproppageDlg::OnInitDialog()
{
CDialog::OnInitDialog();
static CPropertySheet myPropSheet;
static CMyPage1 myPage1;
static CMyPage2 myPage2;
myPropSheet.AddPage(&myPage1);
myPropSheet.AddPage(&myPage2);myPropSheet.Create();
myPage1.m_listctrl1.InsertItem(0,"stuff");
return TRUE; // return TRUE unless you set the focus to a control
}
This seems very odd to me. Even though CPropertySheet is not derived from CDialog , it is managed in a similar fashion. I would suggest deriving CTryproppageDlg from CPropertySheet . Add a CPropertyPage member variable for each tab required. In CTryproppageDlg 's constructor, call AddPage() for each of those member variables. In each of the tab's OnInitDialog() method, call CListCtrl::InsertColumn() . Then populate the controls as necessary. Thus should be a much cleaner approach.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
I'm trying to set the height of a combobox (as opposed to the height of the dropdown list), but I just can't seem to find any quick fix for it on the net.
Is there a quick fix?
--
Schni Schna Schnappi! Schnappi Schnappi Schnapp!
|
|
|
|
|