|
Can you more explain about your program ?
|
|
|
|
|
Anu_Bala wrote: I got the assertion error in Winocc.cpp at line 345.
Assertions are part of debug builds.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
DavidCrow wrote: Assertions are part of debug builds.
Yeah, but he had to ship the debug build, may be because the release build was crrrashhing when it starts.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
Hi,
To solve my problem...Finally I installed VC in the system.Now the assertion error is not coming..its working.
But comunication is not working in COM port.
I create Dialog instance like this..
pDlg = new CMSCOMMDlg();
pDlg->Create(IDD_MSCOMM, this);
pDlg->OpenPort();
void CMSCOMMDlg::OpenPort()
{
m_Comm.SetCommPort (1); // Com port 1
m_Comm.SetSettings ("9600,e,8,1");
m_Comm.SetInputMode (1); // Binary mode
m_Comm.SetPortOpen (TRUE); // Open it
}
And i use this coding to glow LED in External keyboard conneced in serial port.
void CMSCOMMDlg::OnButton1()
{
// TODO: Add your control notification handler code here
//OpenPort();
CByteArray btArray;
btArray.Add (0xC5); // Byte 1
btArray.Add (0x0C); // Byte 2
COleVariant var(btArray);
m_Comm.SetOutput(var); // Send the data.
}
But the signal is not reached to keyboard.
I dnt know why this problem? still im searching for my problem.
But this EXE is running perfectly in my system(development system).
Anu
|
|
|
|
|
Anu_Bala wrote: To solve my problem...Finally I installed VC in the system.Now the assertion error is not coming..its working.
Way to go...
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
Hi
Can anybody help me with the following puzzling problem?
I have created a dialog using Visual Studio 2005 (MFC) and added a combo box to it. This combo has been set to type Drop List and I have set the list box height at design time by clicking the arrow and changing the height of the "ghost" image. I have also set the Vertical Scroll to True.
I have populated this with more items than should be possible to display in one go. However, when I run it, no scroll bar appears!!! That is, it simply drops down with all the entries.
Can anybody tell me what I've done wrong and ideally reproduce the problem as I'm going slightly crazy!!!
Thanks
Paul
|
|
|
|
|
I just did what you described, and had no trouble. It behaved as expected. So something else in your application is giving you trouble.
Are these just CComboBoxes? Or CMyCustomCombo?
Does it work on a freshly created dialog app project? If so, what are you doing differently?
Are you handling some fancy CBN_MEASURESTUFF notification and doing odd sums?
I'm just guessing now...
Iain.
Iain Clarke appearing in spite of being begged not to by CPallini.
|
|
|
|
|
Hi Iain
No, it is just a normal combo. Not handling anything. Very strange! I've tried it on two different machines (reproducing my steps) and get exaclty the same thing.
I've given the combo a variable i.e. m_comboBox and fill it using
m_comboBox.AddString(_T("Hello World")); etc
Is there any code in particular I could cut and paste to show what I've done?
Paul
|
|
|
|
|
Here's a copy of the resource:
IDD_DIALOG1 DIALOGEX 0, 0, 186, 90
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "My First Dialog"
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
DEFPUSHBUTTON "OK",IDOK,129,7,50,14
PUSHBUTTON "Cancel",IDCANCEL,129,24,50,14
CONTROL "Radio1",IDC_RADIO1,"Button",BS_AUTORADIOBUTTON,21,14,38,10
COMBOBOX IDC_COMBO2,22,39,57,14,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP
END
|
|
|
|
|
I just peeked at my resource, and I got:
COMBOBOX IDM_TOOLS_MEASUREMENTANGLE,36,8,60,116,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
There are two differences: CBS_SORT, which we can ignore, but I almost never use, and the cy value.
You have 22,39,57,14 and I have 36,8,60,116. Try editing yours to be a medium value (eg) 80, and see how you get on.
Your may be so small, windows is going "With the edit box, I can't even see one drop down. I'd better just show the lot". That would be a surprise, but not a shock. Probably some fix to be compatible with a program under Windows 3.0.
Iain.
Iain Clarke appearing in spite of being begged not to by CPallini.
|
|
|
|
|
Hi Iain
I tried your suggestion and still no luck. Very strange! This was done on VS 2008 but I get exactly the same thing in Visual Studio 2005.
Here's my dialog code:
// TestDialog.cpp : implementation file
//
#include "stdafx.h"
#include "mfc2008combodroplist.h"
#include "TestDialog.h"
// TestDialog dialog
IMPLEMENT_DYNAMIC(TestDialog, CDialog)
TestDialog::TestDialog(CWnd* pParent /*=NULL*/)
: CDialog(TestDialog::IDD, pParent)
{
}
TestDialog::~TestDialog()
{
}
void TestDialog::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
DDX_Control(pDX, IDC_COMBO1, m_comboBox);
}
BEGIN_MESSAGE_MAP(TestDialog, CDialog)
END_MESSAGE_MAP()
// TestDialog message handlers
BOOL TestDialog::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here
m_comboBox.AddString(_T("A"));
m_comboBox.AddString(_T("A"));
m_comboBox.AddString(_T("A"));
m_comboBox.AddString(_T("G"));
m_comboBox.AddString(_T("A"));
m_comboBox.AddString(_T("A"));
m_comboBox.AddString(_T("D"));
m_comboBox.AddString(_T("A"));
m_comboBox.AddString(_T("G"));
m_comboBox.AddString(_T("A"));
m_comboBox.AddString(_T("A"));
m_comboBox.AddString(_T("A"));
m_comboBox.AddString(_T("A"));
m_comboBox.AddString(_T("G"));
m_comboBox.AddString(_T("A"));
m_comboBox.AddString(_T("A"));
m_comboBox.AddString(_T("D"));
m_comboBox.AddString(_T("A"));
m_comboBox.AddString(_T("G"));
m_comboBox.AddString(_T("A"));
m_comboBox.AddString(_T("A"));
m_comboBox.AddString(_T("A"));
m_comboBox.AddString(_T("A"));
m_comboBox.AddString(_T("G"));
m_comboBox.AddString(_T("A"));
m_comboBox.AddString(_T("A"));
m_comboBox.AddString(_T("D"));
m_comboBox.AddString(_T("A"));
m_comboBox.AddString(_T("G"));
m_comboBox.AddString(_T("A"));
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
and the header:
#pragma once
#include "afxwin.h"
// TestDialog dialog
class TestDialog : public CDialog
{
DECLARE_DYNAMIC(TestDialog)
public:
TestDialog(CWnd* pParent = NULL); // standard constructor
virtual ~TestDialog();
// Dialog Data
enum { IDD = IDD_DIALOG1 };
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
DECLARE_MESSAGE_MAP()
public:
CComboBox m_comboBox;
virtual BOOL OnInitDialog();
};
|
|
|
|
|
Ah, I tried adding loads and loads of entries, so that the list won't fit on the screen and a scrollbar appears!
However, this isn't what I want. Obviously when the list box size is set in the resource editor the whole point is that it shouldn't be any bigger than intended.
I'm very puzzled but very grateful for the help your giving!
Paul
|
|
|
|
|
I made a virgin project, added a box, and it worked as we'd both expect. If you email me your address, I can zip it and send it. (Obviously don;t post it here). It is a VC6 project though. Which made me look at your post again, and I saw...
the line "#include "mfc2008combodroplist.h", makes me suspicious...
Maybe MFC is being naughtily helpful?
Are you under Vista, and it's being "helpful" too?
Have you tried editing the resource as I recommended and setting the CY value as something medium? (ie, well above 14!)
Iain.
Iain Clarke appearing in spite of being begged not to by CPallini.
|
|
|
|
|
Hi Iain
The include is merely the name I gave the application. I don't think it has anything to do with it because I had a different name on the Visual Studio 2005 version.
I'm using XP and Vista. The problem is on both.
Yep, I changed the CY value without any luck.
This is a strange one!!!!
Paul
p.s. I've sent you an email
|
|
|
|
|
Hi Iain
I've just tried to do the same thing in VC++ 6 and it works!!!
This is obviously an issue with VS2005!
I'm amazed there aren't more posts on the issue though. Surely others have encountered it!!!
Paul
|
|
|
|
|
HOWEVER - when I load the VC++ 6 project into Visual Studio 2005 it WORKS!!!
Paul
|
|
|
|
|
My bet is that it's a difference MCF'S combobox. I bet MFC v2005 is doing clever things - and the imported project is using mfc42.dll.
Try not using CComboBox as a member variable and DDX_Controlling.
Try using SendDlgItemMessage (CB_ADDSTRING.... etc)
Iain.
Iain Clarke appearing in spite of being begged not to by CPallini.
|
|
|
|
|
that's sounds sensible to me!
I'll give it a go and post if it works.
It does sound like a bug though doesn't it?
Paul
|
|
|
|
|
Hi Iain
I'm afraid I did't make much progress with your suggestion using SendMessage i.e. deadlines etc. However, I would like to thank you again for all your hard work in helping me with this problem.
Paul
|
|
|
|
|
Davros wrote: That is, it simply drops down with all the entries.
If all of the items are there, what's the problem?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
lol - well, because (1) the code isn't doing what it should and (2) you get list box which extends a large area and looks ugly.
(1) is the most important thing you - don't you agree?
|
|
|
|
|
Hi all,
I have a project to be done by this week!! i have a fingerprint censor from which i have to access the finger print data. Hoew do i access that data from that device. Drivers for the device is installed and can anybody help me to find some links and tutorials for accessing Hardware in MFC???
Please help me with some useful stuffs...
Thanks in advance
||SnAkeBed||
|
|
|
|
|
One key piece of information that may help people to help you is - how is the scanner attached to your PC, Serial cable, USB, FireWire, VMEBus, Bluetooth, WLAN 802.11.g &c
Once we've got that figured out I'd almost certainly suggest not writing the device communications stuff directly into your MFC app. Create a separate plain C++ Dll and possibly a stand alone test app to load it up and give it some exercise.
If you end up having to write a driver for your device remember there's a whole Driver Development Kit you can download from Microsoft with sample code and the like. Standards documents are also useful if you're dealing with a device that has to conform to some spec like USB or Ethernet.
Nothing is exactly what it seems but everything with seems can be unpicked.
|
|
|
|
|
hi,
Thanks for ur reply
Its a USB Device and the driver for the device is already installed.so i think there is no need of writing a seperate driver for that.
Since i'm new to this subject can u please help me in providing some links for accessing a USB device
Thanks in advance
||SnAkeBed||
|
|
|
|
|
The way to work with USB devices is to first get the handle to the driver by calling the CreateFile functions. Once you have the handle, you can start exchanging data with the device by calling ReadFile and WriteFile (passing the handle). You can also exchange specific IO control codes with the driver by calling DeviceIOControl.
That's from a high level overview. You should have received documentation with the driver itself describing how to use it the driver (what are the IO control codes you can exchange with it, which name you need to pass to the CreateFile function in order to retrieve the handle of the driver, ...).
|
|
|
|